[Mesa-dev] [PATCH 2/5] gallium: document breakc and switch/case/default/endswitch

Christoph Bumiller e0425955 at student.tuwien.ac.at
Fri Apr 19 02:22:20 PDT 2013


On 19.04.2013 09:26, Jose Fonseca wrote:
>
> ----- Original Message -----
>> From: Roland Scheidegger <sroland at vmware.com>
>>
>> docs were missing, especially the opcode-from-hell switch however is anything
>> but obvious.
>> ---
>>  src/gallium/docs/source/tgsi.rst |   57
>>  ++++++++++++++++++++++++++++++++++----
>>  1 file changed, 51 insertions(+), 6 deletions(-)
>>
>> diff --git a/src/gallium/docs/source/tgsi.rst
>> b/src/gallium/docs/source/tgsi.rst
>> index b7180f8..b46347e 100644
>> --- a/src/gallium/docs/source/tgsi.rst
>> +++ b/src/gallium/docs/source/tgsi.rst
>> @@ -861,7 +861,18 @@ This instruction replicates its result.
>>  
>>  .. opcode:: BRK - Break
>>  
>> -  TBD
>> +  Unconditionally moves the point of execution to the instruction after the
>> +  next endloop or endswitch. The instruction must appear within a
>> loop/endloop
>> +  or switch/endswitch.
>> +
>> +
>> +.. opcode:: BREAKC - Break Conditional
>> +
>> +  Conditionally moves the point of execution to the instruction after the
>> +  next endloop or endswitch. The instruction must appear within a
>> loop/endloop
>> +  or switch/endswitch.
>> +  Condition evaluates to true if src0.x != 0 where src0.x is interpreted
>> +  as an integer register.
> This is fine. But I do wonder if hardware can really benefit from "UIF foo; BREAK; ENDIF" vs "BREAKC foo", or if this is just syntactic sugar that merely burdens developers. 

IF; BREAK; ENDIF usually gets optimized into a BREAKC anyway, so, it's
just easier on the compiler and people who write shaders in TGSI, and
drivers without optimization.




More information about the mesa-dev mailing list