i965/vs: Use the proper dimensionality for the sampler result register.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 2 Jan 2012 23:51:58 +0000 (15:51 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 4 Jan 2012 23:07:40 +0000 (15:07 -0800)
commitfbbbc8c04e2462a0ae272d81e61eee5f85f08aa6
tree713a807f4703726383c9d7190dc2fae1b50398cb
parent207cbc68dc43049c56c3af7a460ce07bd4284aa9
i965/vs: Use the proper dimensionality for the sampler result register.

textureSize() returns an int, ivec2, or ivec3, but never an ivec4.
Creating the destination register as an ivec4 triggered later failures,
even though the register did hold the proper values.

For example, piglit test vs-textureSize-compare calls textureSize on a
2D texture and compares the result to an expected value.  Unfortunately,
our generated code also tried to compare the third and fourth components
which were undefined, and failed.

Fixes piglit test vs-textureSize-compare as well as 19 subcases of
oglconform's glsl-bif-tex-size test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44339
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp