diff options
author | Chris Forbes <chrisf@ijw.co.nz> | 2014-05-04 20:23:55 +1200 |
---|---|---|
committer | Chris Forbes <chrisf@ijw.co.nz> | 2014-06-04 19:35:51 +1200 |
commit | 240974e93f2df10f64aae17e1ed257379bdac5f7 (patch) | |
tree | 545aade64701cd27cbb34d10c2bff0d203d17370 /src/glsl/ast_to_hir.cpp | |
parent | 1ace51f0918822a1453cc5e661494bcd7dba9ee9 (diff) |
glsl: Add support for int -> uint implicit conversions
This is required for ARB_gpu_shader5.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 659e8cb1145..d1c77f1ec82 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -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; } } |