summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/clip.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2012-09-11 22:14:59 -0700
committerKenneth Graunke <[email protected]>2012-09-12 22:13:05 -0700
commit28f4be9eb91b12a2c6b1db6660cca71a98c486ec (patch)
tree5053de8c23c5c8702cdd7af7a11fb89366455e33 /src/mesa/main/clip.c
parent0fc163408e6b9521d545daba19f70631011d5752 (diff)
i965: Fix out-of-order sampler unit usage in ARB fragment programs.
ARB fragment programs use texture unit numbers directly, unlike GLSL which has an extra indirection. If a fragment program only uses one texture assigned to GL_TEXTURE1, SamplersUsed will only contain a single bit, which would make us only upload a single surface/sampler state entry. However, it needs to be the second entry. Using _mesa_fls() instead of _mesa_bitcount() solves this. For ARB programs, this makes num_samplers the ID of the highest texture unit used. Since GLSL uses consecutive integers assigned by the linker, _mesa_fls() should give the same result as _mesa_bitcount().. Fixes a regression since 85e8e9e000732908b259a7e2cbc1724a1be2d447, which caused GPU hangs in ETQW (and probably others), as well as breaking piglit test fp-fragment-position. v2: Add a comment, as suggested by Matt. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54098 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54179 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Tested-by: meng <[email protected]>
Diffstat (limited to 'src/mesa/main/clip.c')
0 files changed, 0 insertions, 0 deletions