[Mesa-dev] r600/sb loop issue

Vadim Girlin vadimgirlin at gmail.com
Fri Dec 5 20:56:34 PST 2014


On 12/06/2014 07:50 AM, Matt Turner wrote:
> On Fri, Dec 5, 2014 at 8:13 PM, Vadim Girlin <vadimgirlin at gmail.com> wrote:
>> I suspect we should rather get rid of such loops somehow, i.e. convert to
>> something else, the loop that never repeats is not really a loop anyway.
>> AFAICS "continue" is not supported in switch statements according to GLSL
>> specs, so the loops generated for switch will never be repeated. Am I
>> missing something? Even if repeating is possible somehow, at least we can
>> get rid of the loops that are not repeated.
>
> I don't think that's true. I don't see anything in the spec that would
> lead me to believe continue cannot occur in a switch statement.

I've double-checked some versions of GLSL spec (1.30, 1.50, 3.30, 4.40) 
and all of them say the same (section "6.4 Jumps"):

"The continue jump is used only in loops."

> In fact, we have some relatively complicated shaders that have a
> continue in a switch. See
> tests/shaders/glsl-fs-continue-in-switch-in-do-while.shader_test
>



More information about the mesa-dev mailing list