i965: Set nr_params to the number of uniform components in the VS/GS path.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 22 Jan 2015 15:08:23 +0000 (17:08 +0200)
committerFrancisco Jerez <currojerez@riseup.net>
Fri, 20 Mar 2015 14:55:36 +0000 (16:55 +0200)
commitfd149628e142af769c1c0ec037bc297d8a3e871f
treeac36bb2ca9097fdf9e9a42c755edaffddd8e30a7
parent706b916960c898cfc24110f14fa4def84caaba93
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" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
src/mesa/drivers/dri/i965/brw_vs.c