Commit 12f001f0 authored by Erik Faye-Lund 's avatar Erik Faye-Lund

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 's avatarErik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Tapani Pälli's avatarTapani Pälli <tapani.palli@intel.com>
parent 9f009c1a
......@@ -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:
......
......@@ -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);
......
......@@ -1425,7 +1425,7 @@ glsl_type::can_implicitly_convert_to(const glsl_type *desired,
* state, we're doing intra-stage function linking where these checks have
* already been done.
*/
if (state && !state->is_version(120, 0))
if (state && !state->has_implicit_conversions())
return false;
/* There is no conversion among matrix types. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment