diff options
author | Timothy Arceri <[email protected]> | 2016-11-09 23:38:46 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-01-06 11:21:42 +1100 |
commit | f584f3821426955b94f36c77191edcfe1b1cc7d5 (patch) | |
tree | 043484b6571b8ab26fde0f128b98e245d67cec49 /src/mesa/state_tracker | |
parent | 2784128398e405405f0263d318ebe4121d1baf4c (diff) |
st/mesa/glsl: add new is_arb_asm flag in gl_program
Set the flag via the _mesa_init_gl_program() and NewProgram()
helpers.
In i965 we currently check for the existance of gl_shader_program
to decide if this is an ARB assembly style program or not.
Adding a flag makes the code clearer and will help removes a
dependency on gl_shader_program in the i965 codegen functions.
Also this will allow use to skip initialising sampler units for
linked shaders, we currently memset it to zero again during linking.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_program.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 77b7a263796..b104649b036 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -54,38 +54,39 @@ * fragment program. */ static struct gl_program * -st_new_program(struct gl_context *ctx, GLenum target, GLuint id) +st_new_program(struct gl_context *ctx, GLenum target, GLuint id, + bool is_arb_asm) { switch (target) { case GL_VERTEX_PROGRAM_ARB: { struct st_vertex_program *prog = rzalloc(NULL, struct st_vertex_program); - return _mesa_init_gl_program(&prog->Base, target, id); + return _mesa_init_gl_program(&prog->Base, target, id, is_arb_asm); } case GL_FRAGMENT_PROGRAM_ARB: { struct st_fragment_program *prog = rzalloc(NULL, struct st_fragment_program); - return _mesa_init_gl_program(&prog->Base, target, id); + return _mesa_init_gl_program(&prog->Base, target, id, is_arb_asm); } case GL_GEOMETRY_PROGRAM_NV: { struct st_geometry_program *prog = rzalloc(NULL, struct st_geometry_program); - return _mesa_init_gl_program(&prog->Base, target, id); + return _mesa_init_gl_program(&prog->Base, target, id, is_arb_asm); } case GL_TESS_CONTROL_PROGRAM_NV: { struct st_tessctrl_program *prog = rzalloc(NULL, struct st_tessctrl_program); - return _mesa_init_gl_program(&prog->Base, target, id); + return _mesa_init_gl_program(&prog->Base, target, id, is_arb_asm); } case GL_TESS_EVALUATION_PROGRAM_NV: { struct st_tesseval_program *prog = rzalloc(NULL, struct st_tesseval_program); - return _mesa_init_gl_program(&prog->Base, target, id); + return _mesa_init_gl_program(&prog->Base, target, id, is_arb_asm); } case GL_COMPUTE_PROGRAM_NV: { struct st_compute_program *prog = rzalloc(NULL, struct st_compute_program); - return _mesa_init_gl_program(&prog->Base, target, id); + return _mesa_init_gl_program(&prog->Base, target, id, is_arb_asm); } default: assert(0); @@ -290,7 +291,7 @@ static struct gl_program * st_new_ati_fs(struct gl_context *ctx, struct ati_fragment_shader *curProg) { struct gl_program *prog = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, - curProg->Id); + curProg->Id, true); struct st_fragment_program *stfp = (struct st_fragment_program *)prog; stfp->ati_fs = curProg; return prog; |