diff options
author | Timothy Arceri <[email protected]> | 2016-11-03 16:00:37 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-12-30 10:57:16 +1100 |
commit | 700bc94dcebf4257740483d2ba467b138234fa1a (patch) | |
tree | da45fbee155479d7692bbe68c534a3c1c67385b3 /src/mesa/state_tracker | |
parent | 31c04e4e229bec4e059779b4034cf597ceeadf97 (diff) |
mesa/glsl: move LinkedTransformFeedback from gl_shader_program to gl_program
This will help allow us to store gl_program in the CurrentProgram array rather
than gl_shader_program which will allow a bunch of simplifications.
Note that we make LinkedTransformFeedback a pointer so we don't waste
memory creating a struct for each stage. We also store a pointer to
the gl_program that will contain the pointer in gl_shader_program so
we can get easy access to the correct stage.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_xformfb.c | 8 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_cb_xformfb.c b/src/mesa/state_tracker/st_cb_xformfb.c index a5cf3dfd5a9..bbc9e03dd07 100644 --- a/src/mesa/state_tracker/st_cb_xformfb.c +++ b/src/mesa/state_tracker/st_cb_xformfb.c @@ -124,8 +124,8 @@ st_begin_transform_feedback(struct gl_context *ctx, GLenum mode, struct st_buffer_object *bo = st_buffer_object(sobj->base.Buffers[i]); if (bo && bo->buffer) { - unsigned stream = - obj->shader_program->LinkedTransformFeedback.Buffers[i].Stream; + unsigned stream = obj->shader_program->xfb_program-> + sh.LinkedTransformFeedback->Buffers[i].Stream; /* Check whether we need to recreate the target. */ if (!sobj->targets[i] || @@ -203,8 +203,8 @@ st_end_transform_feedback(struct gl_context *ctx, pipe_so_target_reference(&sobj->draw_count[i], NULL); for (i = 0; i < ARRAY_SIZE(sobj->targets); i++) { - unsigned stream = - obj->shader_program->LinkedTransformFeedback.Buffers[i].Stream; + unsigned stream = obj->shader_program->xfb_program-> + sh.LinkedTransformFeedback->Buffers[i].Stream; /* Is it not bound or already set for this stream? */ if (!sobj->targets[i] || sobj->draw_count[stream]) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index c9ebb5ade8f..95992965ed8 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -6919,7 +6919,7 @@ st_translate_stream_output_info(glsl_to_tgsi_visitor *glsl_to_tgsi, struct pipe_stream_output_info *so) { struct gl_transform_feedback_info *info = - &glsl_to_tgsi->shader_program->LinkedTransformFeedback; + glsl_to_tgsi->shader_program->xfb_program->sh.LinkedTransformFeedback; st_translate_stream_output_info2(info, outputMapping, so); } diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index bf1503197e0..e9dd5846698 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -390,7 +390,7 @@ st_translate_vertex_program(struct st_context *st, stvp->tgsi.type = PIPE_SHADER_IR_NIR; stvp->tgsi.ir.nir = nir; - st_translate_stream_output_info2(&stvp->shader_program->LinkedTransformFeedback, + st_translate_stream_output_info2(stvp->shader_program->xfb_program->sh.LinkedTransformFeedback, stvp->result_to_output, &stvp->tgsi.stream_output); return true; |