summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2018-10-25 16:00:14 +0200
committerErik Faye-Lund <[email protected]>2018-11-02 11:10:36 +0100
commit12f001f013c71ac43b67df7bf67f9cd3581c9871 (patch)
treeb28e288d4a12592e3af9eaa242dc3c820cf8ad77 /src/compiler/glsl
parent9f009c1a8f93b29c3a09fd68f81bab248e0686f2 (diff)
glsl: add has_implicit_conversions()-helper
This makes the code a bit easier to read, as well as will reduce repetition when we add support for EXT_shader_implicit_conversions. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp2
-rw-r--r--src/compiler/glsl/glsl_parser_extras.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 084b7021a9f..6d4b2c6aa5d 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -315,7 +315,7 @@ apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
return true;
/* Prior to GLSL 1.20, there are no implicit conversions */
- if (!state->is_version(120, 0))
+ if (!state->has_implicit_conversions())
return false;
/* From page 27 (page 33 of the PDF) of the GLSL 1.50 spec:
diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h
index 966d848509c..edd41601c35 100644
--- a/src/compiler/glsl/glsl_parser_extras.h
+++ b/src/compiler/glsl/glsl_parser_extras.h
@@ -344,6 +344,11 @@ struct _mesa_glsl_parse_state {
return ARB_bindless_texture_enable;
}
+ bool has_implicit_conversions() const
+ {
+ return is_version(120, 0);
+ }
+
void process_version_directive(YYLTYPE *locp, int version,
const char *ident);