Skip to contentSkip to conversation

New: [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

Bug 31013 [email protected] 1 participant 18 messages Oct 20, 2010 – Oct 30, 2010

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=31013

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
Version: git
Platform: x86 (IA32)
OS/Version: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/r300
AssignedTo: [email protected]
ReportedBy: [email protected]

When I enable "offset mapping" option in Xonotic (new open source FPS game, Nexuiz fork) all the textures are black and I get something like this on console:

Loading shaders from file glsl/default.glsl...
GLSL shader glsl/default.glsl flatcolor compiled.
GLSL shader glsl/default.glsl depth/shadow compiled.
GLSL shader glsl/default.glsl vertexcolor offsetmapping compiled. r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl vertexcolor glow offsetmapping compiled. r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl flatcolor offsetmapping compiled. r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl flatcolor colormapping glow offsetmapping compiled.
r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl flatcolor colormapping offsetmapping compiled. r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl flatcolor colormapping glow offsetmapping reflectcube compiled.
r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl refraction compiled.
GLSL shader glsl/default.glsl lightdirection diffuse glow offsetmapping compiled.
r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl lightsource diffuse offsetmapping compiled. r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.

Simmilar logs with offset mapping+relief mapping:
GLSL shader glsl/default.glsl flatcolor compiled.
GLSL shader glsl/default.glsl depth/shadow compiled.
GLSL shader glsl/default.glsl vertexcolor compiled.
GLSL shader glsl/default.glsl vertexcolor glow compiled.
GLSL shader glsl/default.glsl flatcolor colormapping glow compiled. GLSL shader glsl/default.glsl flatcolor colormapping compiled. GLSL shader glsl/default.glsl flatcolor colormapping glow reflectcube compiled. GLSL shader glsl/default.glsl refraction compiled.
Draw_CachePic: failed to load gfx/hud/luminos/dock
Draw_CachePic: failed to load gfx/hud/scoreboard_scoreboard_bg GLSL shader glsl/default.glsl vertexcolor offsetmapping reliefmapping compiled. r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl vertexcolor glow offsetmapping reliefmapping compiled.
r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl flatcolor offsetmapping reliefmapping compiled. r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl flatcolor colormapping glow offsetmapping reliefmapping compiled.
r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl flatcolor colormapping offsetmapping reliefmapping compiled.
r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl flatcolor colormapping glow offsetmapping reliefmapping reflectcube compiled.
r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl vertexcolor offsetmapping compiled. r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl vertexcolor glow offsetmapping compiled. r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl flatcolor offsetmapping compiled. r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl flatcolor colormapping glow offsetmapping compiled.
r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl flatcolor colormapping offsetmapping compiled. r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.
GLSL shader glsl/default.glsl flatcolor colormapping glow offsetmapping reflectcube compiled.
r300 FP: Compiler Error:
r300_fragprog_emit.c::begin_tex(): Too many texture indirections Using a dummy shader instead.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#1 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #1 from Tomasz Czapiewski <[email protected]> 2010-10-20 14:05:28 PDT --- Created an attachment (id=39596)
--> (https://bugs.freedesktop.org/attachment.cgi?id=39596)
Screenshot of the problem - xonotic000023.jpg

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#2 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #2 from Tomasz Czapiewski <[email protected]> 2010-10-20 14:06:48 PDT --- Created an attachment (id=39597)
--> (https://bugs.freedesktop.org/attachment.cgi?id=39597)
data/glsl/default.glsl - problematic shaders file

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#3 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #3 from Tomasz Czapiewski <[email protected]> 2010-10-20 14:08:49 PDT --- Created an attachment (id=39598)
--> (https://bugs.freedesktop.org/attachment.cgi?id=39598)
glxinfo

Graphic card: ATI Radeon 9600 256MB AGP (RV350)

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#4 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #4 from Tomasz Czapiewski <[email protected]> 2010-10-20 14:14:38 PDT --- Created an attachment (id=39600)
--> (https://bugs.freedesktop.org/attachment.cgi?id=39600)
RADEON_DEBUG=vp,fp log

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#5 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #5 from Tomasz Czapiewski <[email protected]> 2010-10-20 14:19:32 PDT --- Created an attachment (id=39601)
--> (https://bugs.freedesktop.org/attachment.cgi?id=39601)
RADEON_DEBUG=vp,fp log with both offset mapping and relief mapping

The RADEON_DEBUG=noops doesn't help either.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#6 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

Tom Stellard <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #6 from Tom Stellard <[email protected]> 2010-10-20 19:26:01 PDT --- 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.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#7 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #7 from Tomasz Czapiewski <[email protected]> 2010-10-21 01:19:49 PDT --- Thank you very much, I've reported it to game developers as suggested.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#8 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #8 from Tomasz Czapiewski <[email protected]> 2010-10-21 12:59:21 PDT --- 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".

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#9 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #9 from Alex Deucher <[email protected]> 2010-10-21 13:42:48 PDT --- 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

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#10 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

Tomasz Czapiewski <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |

--- Comment #10 from Tomasz Czapiewski <[email protected]> 2010-10-21 14:43:54 PDT --- 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.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#11 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #11 from Tom Stellard <[email protected]> 2010-10-23 00:45:06 PDT --- (In reply to comment #9)

Quoted 2 lines

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?

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#12 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #12 from Alex Deucher <[email protected]> 2010-10-23 09:29:24 PDT --- (In reply to comment #11)

Quoted 5 lines

(In reply to comment #9)

Quoted 2 lines

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).

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#13 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #13 from Tom Stellard <[email protected]> 2010-10-23 13:01:28 PDT --- (In reply to comment #12)

Quoted 5 lines

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.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#14 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #14 from Tom Stellard <[email protected]> 2010-10-26 21:08:20 PDT --- (In reply to comment #13)

Quoted 11 lines

(In reply to comment #12)

Quoted 5 lines

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.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#15 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #15 from Tomasz Czapiewski <[email protected]> 2010-10-26 22:29:52 PDT --- (In reply to comment #14)

Quoted 6 lines

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.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#16 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

--- Comment #16 from Roland Scheidegger <[email protected]> 2010-10-27 06:43:24 PDT ---

Quoted 5 lines

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...

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#17 lore raw

[Bug 31013] [r300g][glsl] Textures are black in Xonotic with offset mapping - r300 FP: Compiler Error: r300_fragprog_emit.c::begin_tex(): Too many texture indirections

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=31013

Tomasz Czapiewski <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID

--- Comment #17 from Tomasz Czapiewski <[email protected]> 2010-10-30 12:51:32 PDT --- 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.

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.