[Mesa-dev] [PATCH 03/10] glsl: Extend ir_expression_operation for GLSL 3.00 pack/unpack functions

Ian Romanick idr at freedesktop.org
Thu Jan 10 10:44:19 PST 2013


On 01/10/2013 10:42 AM, Chad Versace wrote:
> On 01/10/2013 10:28 AM, Ian Romanick wrote:
>> On 01/10/2013 12:10 AM, Chad Versace wrote:
>>> For each function {pack,unpack}{Snorm,Unorm,Half}2x16, add a corresponding
>>> opcode to enum ir_expression_operation.  Validate the new opcodes in
>>> ir_validate.cpp.
>>>
>>> Also, add opcodes for scalarized variants of the Half2x16 functions.  (The
>>> code generator for the i965 fragment shader requires that all vector
>>> operations be scalarized.  A lowering pass, to be added later, will
>>> scalarize the Half2x16 functions).
>>>
>>> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
>>
>> One nit below...
>>
>>> ---
>>>    src/glsl/ir.cpp                 | 27 +++++++++++++++++++++++++++
>>>    src/glsl/ir.h                   | 31 +++++++++++++++++++++++++++++++
>>>    src/glsl/ir_validate.cpp        | 26 ++++++++++++++++++++++++++
>>>    src/mesa/program/ir_to_mesa.cpp | 12 +++++++++++-
>>>    4 files changed, 95 insertions(+), 1 deletion(-)
>
>
>>> +   case ir_unop_pack_snorm_2x16:
>>> +   case ir_unop_pack_unorm_2x16:
>>> +   case ir_unop_pack_half_2x16:
>>> +   case ir_unop_unpack_snorm_2x16:
>>> +   case ir_unop_unpack_unorm_2x16:
>>> +   case ir_unop_unpack_half_2x16:
>>> +   case ir_unop_unpack_half_2x16_split_x:
>>> +   case ir_unop_unpack_half_2x16_split_y:
>>> +   case ir_binop_pack_half_2x16_split:
>>> +      assert(!"should be handled by lower_packing_builtins");
>>> +      break;
>>
>> ir_to_mesa can't handle the shifts, etc. that are generated by the lowering pass
>> either, so this message is kind of a lie. :)
>
>  From that I infer that drivers that use ir_to_mesa do not support GL 3.0,
> correct?

Correct.  i915 and (classic) swrast do not support GLSL 1.30.

> How about changing it to: assert(!"not supported")

That sounds good to me.  I believe there are other, similar cases 
elsewhere in that switch.



More information about the mesa-dev mailing list