glsl/mesa: add reference to gl_shader_program_data from gl_program

We also add the stubs for the standalone compiler in this change.

By adding a reference here we can now refactor some code to use
gl_program where we were previously awkwardly using gl_shader_program.

Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Timothy Arceri
2016-12-20 21:37:25 +11:00
parent 9d99dc4bc1
commit 68245aa6f5
5 changed files with 21 additions and 0 deletions

View File

@@ -2208,6 +2208,8 @@ link_intrastage_shaders(void *mem_ctx,
return NULL;
}
_mesa_reference_shader_program_data(ctx, &gl_prog->sh.data, prog->data);
/* Don't use _mesa_reference_program() just take ownership */
linked->Program = gl_prog;

View File

@@ -53,6 +53,15 @@ _mesa_warning(struct gl_context *ctx, const char *fmt, ...)
va_end(vargs);
}
void
_mesa_reference_shader_program_data(struct gl_context *ctx,
struct gl_shader_program_data **ptr,
struct gl_shader_program_data *data)
{
(void) ctx;
*ptr = data;
}
void
_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
struct gl_shader *sh)

View File

@@ -38,6 +38,11 @@
extern "C" void
_mesa_warning(struct gl_context *ctx, const char *fmtString, ... );
extern "C" void
_mesa_reference_shader_program_data(struct gl_context *ctx,
struct gl_shader_program_data **ptr,
struct gl_shader_program_data *data);
extern "C" void
_mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
struct gl_shader *sh);