mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
glsl: Prohibit implicit conversion of mem parameter in atomicOP functions
Per OpenGL Shading Language, section 8.11. "Atomic Memory Functions" first argument "mem" of all atomicOP functions is inout. The same is true for ARB_shader_storage_buffer_object and GL_INTEL_shader_atomic_float_minmax For implicit conversion of inout parameters it is required for type to support bi-directional conversion, since there is no such types in glsl - implicit conversion is effectively prohibited. Alternatively we could have marked atomic_var parameter of built-in atomicOP functions as inout, however it opens another can of worms during NIR lowerings. Fixes:ea0a1f5bebCloses: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2837 Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4887> (cherry picked from commitc0f623e62f)
This commit is contained in:
parent
38b9255022
commit
0155c883a3
6 changed files with 15 additions and 7 deletions
|
|
@ -3721,7 +3721,7 @@
|
|||
"description": "glsl: Prohibit implicit conversion of mem parameter in atomicOP functions",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "ea0a1f5beb22982a886ba862ba95f92c9e35165a"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -7340,6 +7340,8 @@ builtin_builder::_atomic_op2(const char *intrinsic,
|
|||
ir_variable *data = in_var(type, "atomic_data");
|
||||
MAKE_SIG(type, avail, 2, atomic, data);
|
||||
|
||||
atomic->data.implicit_conversion_prohibited = true;
|
||||
|
||||
ir_variable *retval = body.make_temp(type, "atomic_retval");
|
||||
body.emit(call(shader->symbols->get_function(intrinsic), retval,
|
||||
sig->parameters));
|
||||
|
|
@ -7357,6 +7359,8 @@ builtin_builder::_atomic_op3(const char *intrinsic,
|
|||
ir_variable *data2 = in_var(type, "atomic_data2");
|
||||
MAKE_SIG(type, avail, 3, atomic, data1, data2);
|
||||
|
||||
atomic->data.implicit_conversion_prohibited = true;
|
||||
|
||||
ir_variable *retval = body.make_temp(type, "atomic_retval");
|
||||
body.emit(call(shader->symbols->get_function(intrinsic), retval,
|
||||
sig->parameters));
|
||||
|
|
|
|||
|
|
@ -2073,6 +2073,7 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
|
|||
this->data.stream = 0;
|
||||
this->data.xfb_buffer = -1;
|
||||
this->data.xfb_stride = -1;
|
||||
this->data.implicit_conversion_prohibited = false;
|
||||
|
||||
this->interface_type = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -892,6 +892,12 @@ public:
|
|||
*/
|
||||
unsigned bound:1;
|
||||
|
||||
/**
|
||||
* Non-zero if the variable shall not be implicitly converted during
|
||||
* functions matching.
|
||||
*/
|
||||
unsigned implicit_conversion_prohibited:1;
|
||||
|
||||
/**
|
||||
* Emit a warning if this variable is accessed.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -83,8 +83,9 @@ parameter_lists_match(_mesa_glsl_parse_state *state,
|
|||
|
||||
case ir_var_const_in:
|
||||
case ir_var_function_in:
|
||||
if (!actual->type->can_implicitly_convert_to(param->type, state))
|
||||
return PARAMETER_LIST_NO_MATCH;
|
||||
if (param->data.implicit_conversion_prohibited ||
|
||||
!actual->type->can_implicitly_convert_to(param->type, state))
|
||||
return PARAMETER_LIST_NO_MATCH;
|
||||
break;
|
||||
|
||||
case ir_var_function_out:
|
||||
|
|
|
|||
|
|
@ -704,10 +704,6 @@ spec/arb_shader_stencil_export/preprocessor/disabled-undefined-core.geom: skip
|
|||
spec/arb_shader_stencil_export/preprocessor/disabled-undefined-core.tesc: skip
|
||||
spec/arb_shader_stencil_export/preprocessor/disabled-undefined-core.tese: skip
|
||||
spec/arb_shader_stencil_export/preprocessor/disabled-undefined-core.vert: skip
|
||||
spec/arb_shader_storage_buffer_object/compiler/atomiccompswap-implicit-conversion.vert: crash
|
||||
spec/arb_shader_storage_buffer_object/compiler/atomicmin-array-element-implicit-conversion.vert: crash
|
||||
spec/arb_shader_storage_buffer_object/compiler/atomicmin-implicit-conversion.vert: crash
|
||||
spec/arb_shader_storage_buffer_object/compiler/atomicmin-swizzle-implicit-conversion.vert: crash
|
||||
spec/arb_shader_storage_buffer_object/preprocessor/disabled-defined-compat.frag: skip
|
||||
spec/arb_shader_storage_buffer_object/preprocessor/disabled-defined-compat.vert: skip
|
||||
spec/arb_shader_storage_buffer_object/preprocessor/disabled-defined-core.comp: skip
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue