Summary: | when sampling textures from both fragment and vertex shaders the vertex texture has the incorrect texture bound | ||
---|---|---|---|
Product: | Mesa | Reporter: | Julian Adams <joolsa> |
Component: | Mesa core | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | git | ||
Hardware: | x86 (IA32) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Adds a test demonstrating the bug to piglit
log of testcase run with shader dumping enabled updated version of the patch to add a testcase demonstrating the bug to piglit |
Description
Julian Adams
2011-03-31 13:34:23 UTC
Created attachment 45107 [details]
log of testcase run with shader dumping enabled
To me the Mesa IR looks odd: both the fragment program and the vertex program sample from texture[0]. In the testcase I posted there is code which is commented out from the vertex shader. Uncommenting this makes the tests pass, although it simply declares another texture and uses it, writing to a interpolator which is ignored in the fragment shader. It has the side effect of making the texture lookup we want in the vertex shader have a different index in the Mesa IR.
The test program has a few minor issues. 1. "@file fbo-drawbuffers-blend-add.c" is wrong 2. There's a mix of tab and space indention that's inconsistent. Either use spaces everywhere or tabs everywhere. I'd also replace "slot" with "unit". It looks like the logic in update_textures() in st_atom_texture.c is wrong. Basically, we need to loop over the vertex/geometry/fragment shader types and do validation for each texture referenced by each of those shader types. I'll try to fix this when I get a little time. Created attachment 45588 [details] [review] updated version of the patch to add a testcase demonstrating the bug to piglit this (hopefully) addresses the whitespace issues mentioned in comment 2 and replaces slot with unit as per comment 3. Thanks. I've committed the piglit patch with some additional fixes (put declarations before code, etc). I've hopefully fixed this in master for gallium drivers, by doing what Brian suggested. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.