aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vs.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-11-23 23:26:00 -0800
committerKenneth Graunke <[email protected]>2014-11-24 15:30:09 -0800
commit62b425448ca92f568a571e656133e6d234434b4c (patch)
tree4221eaee3a761689b9f96a2322429a9a131544f3 /src/mesa/drivers/dri/i965/brw_vs.c
parentd54925df9c9c024c06b7d54334d5e7a1035bcaf8 (diff)
i965: Pass gl_program pointers into precompile functions.
We'd like to do precompiling for ARB vertex and fragment programs, which only have gl_program structures - gl_shader_program is NULL. This patch makes the various precompile functions take a gl_program parameter directly, rather than accessing it via gl_shader_program. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index edaa82cb4c3..bab72cb8888 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -523,7 +523,9 @@ const struct brw_tracked_state brw_vs_prog = {
};
bool
-brw_vs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
+brw_vs_precompile(struct gl_context *ctx,
+ struct gl_shader_program *shader_prog,
+ struct gl_program *prog)
{
struct brw_context *brw = brw_context(ctx);
struct brw_vs_prog_key key;
@@ -531,18 +533,14 @@ brw_vs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
struct brw_vs_prog_data *old_prog_data = brw->vs.prog_data;
bool success;
- if (!prog->_LinkedShaders[MESA_SHADER_VERTEX])
- return true;
-
- struct gl_vertex_program *vp = (struct gl_vertex_program *)
- prog->_LinkedShaders[MESA_SHADER_VERTEX]->Program;
+ struct gl_vertex_program *vp = (struct gl_vertex_program *) prog;
struct brw_vertex_program *bvp = brw_vertex_program(vp);
memset(&key, 0, sizeof(key));
brw_vec4_setup_prog_key_for_precompile(ctx, &key.base, bvp->id, &vp->Base);
- success = do_vs_prog(brw, prog, bvp, &key);
+ success = do_vs_prog(brw, shader_prog, bvp, &key);
brw->vs.base.prog_offset = old_prog_offset;
brw->vs.prog_data = old_prog_data;