Summary: | [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections | ||
---|---|---|---|
Product: | Mesa | Reporter: | Tomasz Czapiewski <xeros> |
Component: | Drivers/Gallium/r300 | Assignee: | Default DRI bug account <dri-devel> |
Status: | RESOLVED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | xeros |
Version: | git | ||
Hardware: | x86 (IA32) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Screenshot of the problem - xonotic000023.jpg
data/glsl/default.glsl - problematic shaders file glxinfo RADEON_DEBUG=vp,fp log RADEON_DEBUG=vp,fp log with both offset mapping and relief mapping |
Description
Tomasz Czapiewski
2010-10-20 14:04:32 UTC
Created attachment 39596 [details]
Screenshot of the problem - xonotic000023.jpg
Created attachment 39597 [details]
data/glsl/default.glsl - problematic shaders file
Created attachment 39598 [details]
glxinfo
Graphic card: ATI Radeon 9600 256MB AGP (RV350)
Created attachment 39600 [details]
RADEON_DEBUG=vp,fp log
Created attachment 39601 [details]
RADEON_DEBUG=vp,fp log with both offset mapping and relief mapping
The RADEON_DEBUG=noops doesn't help either.
Your hardware is not capable of executing these shaders. The function OffsetMapping (from data/glsl/default.glsl) has three texture look-ups that depend on the value of the previous look-up. This function is being called by two shaders that use its return value in a fourth texture look-up. This creates four texture indirections, but this hardware only supports three. I would recommend contacting the developers of this application and ask if they can come up with an alternate shader. Thank you very much, I've reported it to game developers as suggested. Game developers have just checked that the same shader works on Windows on the same chipset as mine and are suggesting that it might be "off-by-one in counting the indirections". r3xx/r4xx actually supports 4 indirections, so if the current code is limiting it to 3, it should be upped to 4. See US_CONFIG.NLEVEL I'm reopening this bug report as suggested that my hardware supports 4 indirections but driver limits it to 3. Btw, I've tried the modified shader with 3 indirections and then offset mapping worked properly but it's just a temporary build for test and it won't be included in official game source. (In reply to comment #9) > r3xx/r4xx actually supports 4 indirections, so if the current code is limiting > it to 3, it should be upped to 4. See US_CONFIG.NLEVEL Isn't the level 3 indirection limited to reading from input registers? (In reply to comment #11) > (In reply to comment #9) > > r3xx/r4xx actually supports 4 indirections, so if the current code is limiting > > it to 3, it should be upped to 4. See US_CONFIG.NLEVEL > > Isn't the level 3 indirection limited to reading from input registers? I though you could have up to 4 indirections in addition to the input, but it's been a while since I looked at 3xx. If the shader works on the same hw using the proprietary driver, it would seem to indicate that was the case (barring some other bug). (In reply to comment #12) > > I though you could have up to 4 indirections in addition to the input, but it's > been a while since I looked at 3xx. If the shader works on the same hw using > the proprietary driver, it would seem to indicate that was the case (barring > some other bug). I looked at through the docs again, and I'm pretty sure you are right about this. I think we need to start using the {ALU,TEXT}_OFFSET fields of US_CODE_OFFSET, to give us the input + 4 indirections. I'll write a patch for this. (In reply to comment #13) > (In reply to comment #12) > > > > I though you could have up to 4 indirections in addition to the input, but it's > > been a while since I looked at 3xx. If the shader works on the same hw using > > the proprietary driver, it would seem to indicate that was the case (barring > > some other bug). > > I looked at through the docs again, and I'm pretty sure you are right about > this. I think we need to start using the {ALU,TEXT}_OFFSET fields of > US_CODE_OFFSET, to give us the input + 4 indirections. I'll write a patch for > this. Ok, so it looks like I was wrong about this. I input a shader with 4 indirections to the AMD Shader Analyzer and it crashed, so I'm pretty sure r300 is limited to 3 indirections. I'm guessing that the reason this works on Windows with r300 hardware is because that driver has some sort of software fall-back, which r300g doesn't have. (In reply to comment #14) > > Ok, so it looks like I was wrong about this. I input a shader with 4 > indirections to the AMD Shader Analyzer and it crashed, so I'm pretty sure r300 > is limited to 3 indirections. I'm guessing that the reason this works on > Windows with r300 hardware is because that driver has some sort of software > fall-back, which r300g doesn't have. So does fglrx on Linux have this software fall-back, too? As now it's been confirmed that on fglrx on Linux it worked, too before fglrx dropped R300-R500 support. And game developers have told me that this shader code was specially designed for Radeon 9600 (RV350) with fglrx. > Ok, so it looks like I was wrong about this. I input a shader with 4
> indirections to the AMD Shader Analyzer and it crashed, so I'm pretty sure r300
> is limited to 3 indirections. I'm guessing that the reason this works on
> Windows with r300 hardware is because that driver has some sort of software
> fall-back, which r300g doesn't have.
I dunno maybe the driver does some tricks like trying to move out the calculation leading to the first texture lookup back to the vertex shader? No idea if that would actually work...
You were right, it was really too many indirections (game engine GLSL code has changed but comment not) and current testing of last working fglrx for r300 cards on old Ubuntu 8.10 prove it - simmilar behaviour on fglrx and r300g. Some time ago OffsetMapping could work on fglrx as it was using -1 indirections compared to now. The simplified GLSL OffsetMapping code in game has been now pushed to Xonotic git master and works again. Sorry for mislead and yours occupied time trying to resolve a problem in bug report which could not be fixed in driver. |
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.