On 06/15/2011 04:59 PM, Kenneth Graunke wrote:
> Bryan,
> Thanks for your work on this!  I'm glad to see GLSL IR->TGSI happening.
> A few quick comments on "mesa,st/mesa: add native support for integers
> in shaders"...
> glsl_type::get_vec4_type(base) is equivalent to
> glsl_type::get_instance(base, 4, 1) except that it returns error_type
> instead of NULL.  You might want to use get_instance directly or
> implement get_vec4_type on top of it.

Thanks, I didn't notice get_instance.  I'll go ahead and make a commit
that removes get_vec4_type and uses get_instance directly instead.

> For the ir_unop_u2f, ir_unop_bit_not, ir_binop_lshift,
> ir_binop_rshift, ir_binop_bit_and, ir_binop_bit_xor, and
> ir_binop_bit_or cases...you don't need the glsl_version >= 130 check. 
> These were first introduced in GLSL 1.30 and should never occur in
> prior versions.  (If anything, I'd assert instead of emitting nothing.)

Actually, they already assert when the GLSL version is less than GLSL
1.30 in order to match the behavior of ir_to_mesa.  It might not be
obvious from reading that code the first time, but the break for each of
those cases is inside the "glsl_version >= 130" block.  When the GLSL
version is 120 or lower for any of those cases, it falls through to the
assertion after ir_binop_round_even.

mesa-dev mailing list

Reply via email to