glsl: disallow implicit conversions in ESSL shaders
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -291,6 +291,10 @@ apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
|
|||||||
if (!state->is_version(120, 0))
|
if (!state->is_version(120, 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* ESSL does not allow implicit conversions */
|
||||||
|
if (state->es_shader)
|
||||||
|
return false;
|
||||||
|
|
||||||
/* From page 27 (page 33 of the PDF) of the GLSL 1.50 spec:
|
/* From page 27 (page 33 of the PDF) of the GLSL 1.50 spec:
|
||||||
*
|
*
|
||||||
* "There are no implicit array or structure conversions. For
|
* "There are no implicit array or structure conversions. For
|
||||||
|
@@ -1139,6 +1139,13 @@ glsl_type::can_implicitly_convert_to(const glsl_type *desired,
|
|||||||
if (this == desired)
|
if (this == desired)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
/* ESSL does not allow implicit conversions. If there is no state, we're
|
||||||
|
* doing intra-stage function linking where these checks have already been
|
||||||
|
* done.
|
||||||
|
*/
|
||||||
|
if (state && state->es_shader)
|
||||||
|
return false;
|
||||||
|
|
||||||
/* There is no conversion among matrix types. */
|
/* There is no conversion among matrix types. */
|
||||||
if (this->matrix_columns > 1 || desired->matrix_columns > 1)
|
if (this->matrix_columns > 1 || desired->matrix_columns > 1)
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user