aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vs.c
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2015-01-22 17:08:23 +0200
committerFrancisco Jerez <[email protected]>2015-03-20 16:55:36 +0200
commitfd149628e142af769c1c0ec037bc297d8a3e871f (patch)
treeac36bb2ca9097fdf9e9a42c755edaffddd8e30a7 /src/mesa/drivers/dri/i965/brw_vs.c
parent706b916960c898cfc24110f14fa4def84caaba93 (diff)
i965: Set nr_params to the number of uniform components in the VS/GS path.
Both do_vs_prog and do_gs_prog initialize brw_stage_prog_data::nr_params to the number of uniform *vectors* required by the shader rather than the number of uniform components, contradicting the comment. This is inconsistent with what the state upload code and scalar path expect but it happens to work until Gen8 because vec4_visitor interprets it as a number of vectors on construction and later on overwrites its original value with the number of uniform components referenced by the shader. Also there's no need to add the number of samplers, they're not actually passed in as uniforms. Fixes a memory corruption issue on BDW with SIMD8 VS. Cc: "10.5" <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 2aefd35832c..ba2c23d4405 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -241,15 +241,7 @@ do_vs_prog(struct brw_context *brw,
rzalloc_array(NULL, const gl_constant_value *, param_count);
stage_prog_data->pull_param =
rzalloc_array(NULL, const gl_constant_value *, param_count);
-
- /* Setting nr_params here NOT to the size of the param and pull_param
- * arrays, but to the number of uniform components vec4_visitor
- * needs. vec4_visitor::setup_uniforms() will set it back to a proper value.
- */
- stage_prog_data->nr_params = ALIGN(param_count, 4) / 4;
- if (vs) {
- stage_prog_data->nr_params += vs->num_samplers;
- }
+ stage_prog_data->nr_params = param_count;
GLbitfield64 outputs_written = vp->program.Base.OutputsWritten;
prog_data.inputs_read = vp->program.Base.InputsRead;