gl_FrontFacing crash (ATI driver problem?)

void main()
{
    gl_Position = ftransform();
}
void main()
{
if( !gl_FrontFacing )
    gl_FragColor = vec4(1,1,1,1);
else
    gl_FragColor = vec4(0.2,0.2,0.2,1);
}

the following shader crashes on ATI during glDrawElements(). :frowning:

did anyone got around to support two sided rendering on both ATI & NV? if so, how do you detect ATI & NV reliably and future proof or do you perhaps use a generic view vector dot face normal test or … hmm … some other method?

a while ago there was http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=11;t=000411 behaviour but I suppose it regressed to a crash now.

drivers: ATI Catalyst 5.6, 5.10, 5.11 BETA
HW: ATI 9600XT

Using gl_FrontColor and gl_BackColor in the vertex shader and then reading gl_Color in the fragment shader works.

Color trick works only partially for me - only for really simple shaders. On more complex ones, adding gl_BackColor = vec4(0.0,0.0,0.0,1.0) to the vertex shader disables the output alltogether.

I could drill down to the smallest possible shader which triggers the case, but that will take time. Anyone from ATI willing to accept the distilled test case?

I’m always willing to accept test cases. (epersson ‘at’ ati.com).

Using gl_FrontFacing should not crash, but it should go into software though since R300 doesn’t have this flag. The R420 and R520 series should support it though. For R300 PsychoLns’s trick is the best option.

@Humus: I’ve sent you the bug report for gl_BackColor over the email. If you find Shader Designer repro. form suitable I could try to make a minimal gl_FrontFace sw. mode crash repro?

CC here for peer review: :cool:

Shader Designer simple repro case:

ftp://speedy.dyndns.org/ATI%20BUG%20REPORT%20gl_BackColor%20shader%20bug.zip

hw & drivers:
Club3D ATI 9600XT
ATI Catalyst 5.11 BETA (http://downloads.guru3d.com/download.php?det=1243)
ATI Catalyst 5.10

step by step repro:

  1. download shader designer from http://www.typhoonlabs.com/index.php?action=shaderdesigner.htm
  2. install it
  3. run it
  4. unpack the attachment & open shader project “gl_BackColor bug on ATI 3.gdp”
  5. in Project -> Textures dialog:
    • increase no of T.I. to units to 1
    • click on “…” next to the FileName: and select Tunnel_Boden_RE.tga
    • click Accept
  6. you should see the normal output
  7. click on “gl_BackColor bug on ATI 3.vert” tab
  8. uncomment gl_BackColor = vec4(0.5,0.5,0.5,1.0); line
  9. press F4 to recompile
  10. object in the upper left preview window becomes black?!?

(NOTE: as a reference, I’ve also tried this on NVIDIA hw., it is an
ATI specific glitch)

This bug turned out to already be fixed and should appear in a future driver.

I do hope you meant to say “disappear” :wink:

Thanks for looking into it.

Oops, yes. :slight_smile: I meant to say the fix should appear in a future driver.

Thanks for looking into it. :]

Using gl_FrontFacing should not crash, but it should go into software though since R300 doesn’t have this flag. The R420 and R520 series should support it though. For R300 PsychoLns’s trick is the best option.
I’ve checked it out, R300 indeed falls back into the software mode, but then crashes the process. As I can’t reproduce the crash in Shader Designer, the culprit seems to be some specific init sequence of my code.

Hmm, is there a way to record the OpenGL state machine changes so you can replay it and trigger the bug (all VBO & no textures required)? If not, I’ll perhaps send you the compiled exe or make a minimal .sln project which triggers the bug. Naturally it’s of looow priority, as it is a software mode bug.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.