[Mesa-dev] [PATCH 2/6] glsl: Add support for int -> uint implicit conversions
Chris Forbes
chrisf at ijw.co.nz
Sun Apr 27 02:44:52 PDT 2014
This is required for ARB_gpu_shader5.
Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
src/glsl/ast_to_hir.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 39ad418..17c68e7 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -171,6 +171,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;
}
}
--
1.9.2
More information about the mesa-dev
mailing list