mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 22:08:26 +02:00
i965/gen7: Set up all samplers even if samplers are sparsely used.
In GLSL, sampler indices are allocated contiguously from 0. But in the case of ARB_fragment_program (and possibly fixed function), an app that uses texture 0 and 2 will use sampler indices 0 and 2, so we were only allocating space for samplers 0 and 1 and setting up sampler 0. We would read garbage for sampler 2, resulting in flickering textures and an angry simulator. Fixes bad rendering in 0 A.D. and ETQW. This was fixed for pre-gen7 by28f4be9eb9Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=25201 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58680 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> NOTE: This is a candidate for stable branches. (cherry picked from commit5bb05c6e6d)
This commit is contained in:
parent
4e35ffa762
commit
be7048477a
1 changed files with 1 additions and 1 deletions
|
|
@ -195,7 +195,7 @@ gen7_upload_samplers(struct brw_context *brw)
|
|||
|
||||
GLbitfield SamplersUsed = vs->SamplersUsed | fs->SamplersUsed;
|
||||
|
||||
brw->sampler.count = _mesa_bitcount(SamplersUsed);
|
||||
brw->sampler.count = _mesa_fls(SamplersUsed);
|
||||
|
||||
if (brw->sampler.count == 0)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue