summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_vs.c
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2016-05-28 17:57:31 -0700
committerJordan Justen <[email protected]>2016-05-29 09:59:55 -0700
commit7398a32c501ed7fedb5619ee7505f9070551d4bd (patch)
tree2639d5cfd78f6e5aa7c955ba48bba4768704e79c /src/mesa/drivers/dri/i965/brw_vs.c
parent160063b110d50d528217492308bbe353af2186e8 (diff)
i965: Shrink stage_prog_data param array length
It appears we were over-allocating these arrays. Previously we would use nir->num_uniforms directly for scalar programs, and multiply it by 4 for vec4 programs. Instead we should have been dividing by 4 in both cases to convert from bytes to a gl_constant_value count. The size of gl_constant_value is 4 bytes. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_vs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 2478e62c180..abf03b1fb7a 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -80,9 +80,7 @@ brw_codegen_vs_prog(struct brw_context *brw,
* prog_data associated with the compiled program, and which will be freed
* by the state cache.
*/
- int param_count = vp->program.Base.nir->num_uniforms;
- if (!compiler->scalar_stage[MESA_SHADER_VERTEX])
- param_count *= 4;
+ int param_count = vp->program.Base.nir->num_uniforms / 4;
if (vs)
prog_data.base.base.nr_image_params = vs->base.NumImages;