zeckensack
New member
I've finally managed to wrap my head around the ATI_fragment_shader spec. Nice. But I've ran into my first problem.
I'm working on something that could loosely be described as a shader compiler, ie it takes an abstract mathematical description of the operations and spits out a fragment shader.
It works well but I've started running into unexpected behaviour for some shaders which include conditionals and dot products.
What I'm thinking at the moment, what might be causing that, is that I can't guarantee the same number of ColorFragmentOps and AlphaFragmentOps in these cases.
I can't find any description in the spec detailing the exact order the ops are executed. Now, ColorOps for themselves execute in order, AlphaOps do as well, that's pretty straightforward.
But as I gather these are executed in pairs (ColorOp+AlphaOp). I don't know whether I need 'NOPs' for empty slots to preserve ordering, or if the extension sorts that out for itself.
Example:
This is supposed to be a shader (no dependant reads, just simple stuff), where I need the results of the second color op for the third alpha op. Do I have to issue Alpha-'NOPs' in between (second slot where I put the '-'), or will the extension API solve that dependence.
Sorry for the longwinded post but I think it's kinda hard to describe and wanted to put enough in it to make it easy to understand first shot.
And I really think ATI should add some language regarding the issue to the extension document.
I'm working on something that could loosely be described as a shader compiler, ie it takes an abstract mathematical description of the operations and spits out a fragment shader.
It works well but I've started running into unexpected behaviour for some shaders which include conditionals and dot products.
What I'm thinking at the moment, what might be causing that, is that I can't guarantee the same number of ColorFragmentOps and AlphaFragmentOps in these cases.
I can't find any description in the spec detailing the exact order the ops are executed. Now, ColorOps for themselves execute in order, AlphaOps do as well, that's pretty straightforward.
But as I gather these are executed in pairs (ColorOp+AlphaOp). I don't know whether I need 'NOPs' for empty slots to preserve ordering, or if the extension sorts that out for itself.
Example:
Code:
Color Alpha
X X Mul/Mul
X - Sub
X X Dot3/Dot3
X X Mul/CND
Sorry for the longwinded post but I think it's kinda hard to describe and wanted to put enough in it to make it easy to understand first shot.
And I really think ATI should add some language regarding the issue to the extension document.
Last edited: