glsl: handle differences between ARB/EXT versions of shader_image_load_store

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2019-07-12 15:50:38 +02:00
committed by Marek Olšák
parent 5db28b0cf7
commit cd45d09226
4 changed files with 21 additions and 3 deletions

View File

@@ -3488,7 +3488,8 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual,
}
} else {
if (var->data.mode == ir_var_uniform) {
if (state->es_shader) {
if (state->es_shader ||
!(state->is_version(420, 310) || state->ARB_shader_image_load_store_enable)) {
_mesa_glsl_error(loc, state, "all image uniforms must have a "
"format layout qualifier");
} else if (!qual->flags.q.write_only) {

View File

@@ -674,7 +674,14 @@ static bool
shader_image_load_store(const _mesa_glsl_parse_state *state)
{
return (state->is_version(420, 310) ||
state->ARB_shader_image_load_store_enable);
state->ARB_shader_image_load_store_enable ||
state->EXT_shader_image_load_store_enable);
}
static bool
shader_image_load_store_ext(const _mesa_glsl_parse_state *state)
{
return state->EXT_shader_image_load_store_enable;
}
static bool
@@ -682,6 +689,7 @@ shader_image_atomic(const _mesa_glsl_parse_state *state)
{
return (state->is_version(420, 320) ||
state->ARB_shader_image_load_store_enable ||
state->EXT_shader_image_load_store_enable ||
state->OES_shader_image_atomic_enable);
}
@@ -1194,6 +1202,7 @@ enum image_function_flags {
IMAGE_FUNCTION_MS_ONLY = (1 << 7),
IMAGE_FUNCTION_AVAIL_ATOMIC_EXCHANGE = (1 << 8),
IMAGE_FUNCTION_AVAIL_ATOMIC_ADD = (1 << 9),
IMAGE_FUNCTION_EXT_ONLY = (1 << 10),
};
} /* anonymous namespace */
@@ -6936,6 +6945,9 @@ get_image_available_predicate(const glsl_type *type, unsigned flags)
IMAGE_FUNCTION_AVAIL_ATOMIC))
return shader_image_atomic;
else if (flags & IMAGE_FUNCTION_EXT_ONLY)
return shader_image_load_store_ext;
else
return shader_image_load_store;
}

View File

@@ -725,6 +725,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
EXT(EXT_shader_framebuffer_fetch),
EXT(EXT_shader_framebuffer_fetch_non_coherent),
EXT(EXT_shader_image_load_formatted),
EXT(EXT_shader_image_load_store),
EXT(EXT_shader_implicit_conversions),
EXT(EXT_shader_integer_mix),
EXT_AEP(EXT_shader_io_blocks),

View File

@@ -337,7 +337,9 @@ struct _mesa_glsl_parse_state {
bool has_shader_image_load_store() const
{
return ARB_shader_image_load_store_enable || is_version(420, 310);
return ARB_shader_image_load_store_enable ||
EXT_shader_image_load_store_enable ||
is_version(420, 310);
}
bool has_bindless() const
@@ -836,6 +838,8 @@ struct _mesa_glsl_parse_state {
bool EXT_shader_framebuffer_fetch_non_coherent_warn;
bool EXT_shader_image_load_formatted_enable;
bool EXT_shader_image_load_formatted_warn;
bool EXT_shader_image_load_store_enable;
bool EXT_shader_image_load_store_warn;
bool EXT_shader_implicit_conversions_enable;
bool EXT_shader_implicit_conversions_warn;
bool EXT_shader_integer_mix_enable;