mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 11:00:11 +01:00
glsl: Implement GLSL ES restriction on images being either readonly or writeonly.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
This commit is contained in:
parent
527ae5d428
commit
ee7bf349d8
1 changed files with 18 additions and 0 deletions
|
|
@ -2469,6 +2469,24 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual,
|
|||
|
||||
var->data.image_format = GL_NONE;
|
||||
}
|
||||
|
||||
/* From page 70 of the GLSL ES 3.1 specification:
|
||||
*
|
||||
* "Except for image variables qualified with the format qualifiers
|
||||
* r32f, r32i, and r32ui, image variables must specify either memory
|
||||
* qualifier readonly or the memory qualifier writeonly."
|
||||
*/
|
||||
if (state->es_shader &&
|
||||
var->data.image_format != GL_R32F &&
|
||||
var->data.image_format != GL_R32I &&
|
||||
var->data.image_format != GL_R32UI &&
|
||||
!var->data.image_read_only &&
|
||||
!var->data.image_write_only) {
|
||||
_mesa_glsl_error(loc, state, "image variables of format other than "
|
||||
"r32f, r32i or r32ui must be qualified `readonly' or "
|
||||
"`writeonly'");
|
||||
}
|
||||
|
||||
} else if (qual->flags.q.read_only ||
|
||||
qual->flags.q.write_only ||
|
||||
qual->flags.q.coherent ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue