steve3d Posted October 12, 2011 Posted October 12, 2011 I'm trying to create some new post shaders, when studying the default shaders, I've found there are some keywords before if and for loop, like [branch] [unroll], but these keywords don't exists in opengl shader part. So what's the meaning of these keywords? and is there any more keywords? I only found [branch] and [unroll] keywords so far. and another one, why [branch] keywords only appear before some if condition, some other if condition don't have this keywords?
alexei.garbuzenko Posted October 12, 2011 Posted October 12, 2011 In HLSL loops can be unrolled - their code would be repeated up to N times: http://msdn.microsoft.com/en-us/library/windows/desktop/bb509602(v=vs.85).aspx Conditional statements (if and switch) could be flattened or branched: http://msdn.microsoft.com/en-us/library/windows/desktop/bb509610(v=VS.85).aspx These attributes are specific for HLSL language and you should refer to its manual instead of this forum.
Recommended Posts