glsl: Add support for int -> uint implicit conversions
authorChris Forbes <chrisf@ijw.co.nz>
Sun, 4 May 2014 08:23:55 +0000 (20:23 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Wed, 4 Jun 2014 07:35:51 +0000 (19:35 +1200)
This is required for ARB_gpu_shader5.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ast_to_hir.cpp

index 659e8cb11459b7758217d0d66bc7011ecfdba408..d1c77f1ec825879c153822c1d99c628a766564f1 100644 (file)
@@ -176,6 +176,14 @@ get_conversion_operation(const glsl_type *to, const glsl_type *from,
       default: return (ir_expression_operation)0;
       }
 
+   case GLSL_TYPE_UINT:
+      if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable)
+         return (ir_expression_operation)0;
+      switch (from->base_type) {
+         case GLSL_TYPE_INT: return ir_unop_i2u;
+         default: return (ir_expression_operation)0;
+      }
+
    default: return (ir_expression_operation)0;
    }
 }