From 0fe254168be26e71777dc2648e86976bdcd2e707 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 15 Mar 2016 10:51:33 -0700 Subject: [PATCH] mesa: Expose compile_shader() and link_program() beyond the file. This will allow me to use them directly from Meta, bypassing the versions that work with GL integer handles. Signed-off-by: Kenneth Graunke Reviewed-by: Timothy Arceri --- src/mesa/main/shaderapi.c | 20 ++++++++++---------- src/mesa/main/shaderapi.h | 6 ++++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index c7b1047..32fad56 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -959,8 +959,8 @@ shader_source(struct gl_shader *sh, const GLchar *source) /** * Compile a shader. */ -static void -compile_shader(struct gl_context *ctx, struct gl_shader *sh) +void +_mesa_compile_shader(struct gl_context *ctx, struct gl_shader *sh) { if (!sh) return; @@ -1020,8 +1020,8 @@ compile_shader(struct gl_context *ctx, struct gl_shader *sh) /** * Link a program's shaders. */ -static void -link_program(struct gl_context *ctx, struct gl_shader_program *shProg) +void +_mesa_link_program(struct gl_context *ctx, struct gl_shader_program *shProg) { if (!shProg) return; @@ -1264,8 +1264,8 @@ _mesa_CompileShader(GLuint shaderObj) GET_CURRENT_CONTEXT(ctx); if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glCompileShader %u\n", shaderObj); - compile_shader(ctx, - _mesa_lookup_shader_err(ctx, shaderObj, "glCompileShader")); + _mesa_compile_shader(ctx, _mesa_lookup_shader_err(ctx, shaderObj, + "glCompileShader")); } @@ -1512,8 +1512,8 @@ _mesa_LinkProgram(GLuint programObj) GET_CURRENT_CONTEXT(ctx); if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glLinkProgram %u\n", programObj); - link_program(ctx, _mesa_lookup_shader_program_err(ctx, programObj, - "glLinkProgram")); + _mesa_link_program(ctx, _mesa_lookup_shader_program_err(ctx, programObj, + "glLinkProgram")); } #if defined(HAVE_SHA1) @@ -2153,7 +2153,7 @@ _mesa_CreateShaderProgramv(GLenum type, GLsizei count, struct gl_shader *sh = _mesa_lookup_shader(ctx, shader); _mesa_ShaderSource(shader, count, strings, NULL); - compile_shader(ctx, sh); + _mesa_compile_shader(ctx, sh); program = create_shader_program(ctx); if (program) { @@ -2167,7 +2167,7 @@ _mesa_CreateShaderProgramv(GLenum type, GLsizei count, get_shaderiv(ctx, shader, GL_COMPILE_STATUS, &compiled); if (compiled) { attach_shader(ctx, program, shader); - link_program(ctx, shProg); + _mesa_link_program(ctx, shProg); detach_shader(ctx, program, shader); #if 0 diff --git a/src/mesa/main/shaderapi.h b/src/mesa/main/shaderapi.h index 8922c4d..d2d7f16 100644 --- a/src/mesa/main/shaderapi.h +++ b/src/mesa/main/shaderapi.h @@ -54,6 +54,12 @@ extern void _mesa_active_program(struct gl_context *ctx, struct gl_shader_program *shProg, const char *caller); +extern void +_mesa_compile_shader(struct gl_context *ctx, struct gl_shader *sh); + +extern void +_mesa_link_program(struct gl_context *ctx, struct gl_shader_program *sh_prog); + extern unsigned _mesa_count_active_attribs(struct gl_shader_program *shProg); -- 2.7.4