summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-03-15 10:51:33 -0700
committerKenneth Graunke <[email protected]>2016-03-16 23:57:11 -0700
commit0fe254168be26e71777dc2648e86976bdcd2e707 (patch)
tree1b361ede58361137dd22c020c7d3ea6f854cd46b /src
parent7753657cf2cf3c1090186f9e33335a0417ce35fe (diff)
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 <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/shaderapi.c20
-rw-r--r--src/mesa/main/shaderapi.h6
2 files changed, 16 insertions, 10 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index c7b1047bea1..32fad56f651 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 8922c4d0640..d2d7f16ec7c 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);