ATI, glCompileShader and raymarching uber-shader
category: code [glöplog]
Maybe check your file encoding too, ANSI vs. UTF-8 (BOM, no-BOM @ start) etc. I've had some problems with that...
Suddenly I got this. And this sucks.
Quote:
> ntdll.dll!_RtlReportCriticalFailure@8() Unknown
ntdll.dll!_RtlpReportHeapFailure@4() Unknown
ntdll.dll!_RtlpLogHeapFailure@24() Unknown
ntdll.dll!_RtlpCoalesceFreeBlocks@16() Unknown
ntdll.dll!@RtlpFreeHeap@16() Unknown
ntdll.dll!_RtlFreeHeap@12() Unknown
ntdll.dll!_RtlDebugFreeHeap@12() Unknown
ntdll.dll!@RtlpFreeHeap@16() Unknown
ntdll.dll!_RtlFreeHeap@12() Unknown
atioglxx.dll!69f5f2a9() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for atioglxx.dll]
atioglxx.dll!69b3a31c() Unknown
atioglxx.dll!69b3a31c() Unknown
atioglxx.dll!69b3a31c() Unknown
atioglxx.dll!69b35c29() Unknown
atioglxx.dll!69b2e351() Unknown
atioglxx.dll!69b2f44b() Unknown
atioglxx.dll!69a9dccc() Unknown
atioglxx.dll!69a9d98c() Unknown
atioglxx.dll!69b31e5b() Unknown
atioglxx.dll!69b315dd() Unknown
kernel32.dll!@BaseThreadInitThunk@12() Unknown
ntdll.dll!___RtlUserThreadStart@8() Unknown
ntdll.dll!__RtlUserThreadStart@8() Unknown
After some time of debugging together with las (thanks a lot!) he found out the problem... ATI's compiler dislikes the comma operator.
Consider this:
And Ctrl+Alt+Test's Shader Minifier does exactly that kind of optimization. Some statements are rewriten so that it becomes a single
Consider this:
Code:
You'd expect that it first executes return n.xy+=p,max(0,foo);
Code:
and then n.xy+=p;
Code:
But no! It just fucks the entire heap up and takes some years off your life.return max(0,foo);
And Ctrl+Alt+Test's Shader Minifier does exactly that kind of optimization. Some statements are rewriten so that it becomes a single
Code:
line. Can someone please contact LLB and tell him to offer a switch to toggle this return-statement-rewriting optimization off? That'd be most kind!return a,b,c,d,e;
wasn't the order of operations separated by the comma op not specified anyhow?
(compiler can shuffle these around at will)
(compiler can shuffle these around at will)
Nope - it's specified ("sequence (,) operator") - from left to right, returning the value of the right-most expression. (See GLSL 4.2 Spec, pdf page 87, 5.9).
Actually I failed creating a "minimal reproducer" - shader up to now. The thing happens under certain circumstances - not 100% sure what exactly causes it - but without the sequence operator the problem is gone.
Actually I failed creating a "minimal reproducer" - shader up to now. The thing happens under certain circumstances - not 100% sure what exactly causes it - but without the sequence operator the problem is gone.
Even if the order was not specified, a compiler should not simply crash. We had the same problem on last years Evoke. The intro on ATI sometimes crashed, sometimes showed garbled graphics and sometimes worked correctly.
from reading the topic i could have sworn its about the "optimizing" of the shaderCompiler itself
1.) used too many registers, maybe due to 2.)
or
2.) unrolling loops, not being able to exactly set any amounts.
good you got it sorted! always like to have good entries at evoke! mine is a fastshot, so your chances to win are pretty good right now! :)
1.) used too many registers, maybe due to 2.)
or
2.) unrolling loops, not being able to exactly set any amounts.
good you got it sorted! always like to have good entries at evoke! mine is a fastshot, so your chances to win are pretty good right now! :)
Thanks for sharing the outcome of the debugging session.
Sharing is caring :) Thanks :)
I never compile a shader with opengl. I can't help. I've made my own shader compiler.