* ``PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE``: Whether mapping a buffer as unsynchronized from any thread is safe.
* ``PIPE_CAP_GLSL_ZERO_INIT``: Choose a default zero initialization some glsl variables. If `1`, then all glsl shader variables and gl_FragColor are initialized to zero. If `2`, then shader out variables are not initialized but function out variables are.
* ``PIPE_CAP_BLEND_EQUATION_ADVANCED``: Driver supports blend equation advanced without necessarily supporting FBFETCH.
+* ``PIPE_CAP_NIR_ATOMICS_AS_DEREF``: Whether NIR atomics instructions should reference atomics as NIR derefs instead of by indices.
.. _pipe_capf:
struct gl_shader_program *shader_program)
{
nir_shader *nir = prog->nir;
+ struct pipe_screen *screen = st->pipe->screen;
/* Make a pass over the IR to add state references for any built-in
* uniforms that are used. This has to be done now (during linking).
!st->ctx->Const.PackedDriverUniformStorage)
NIR_PASS_V(nir, st_nir_lower_builtin);
- NIR_PASS_V(nir, gl_nir_lower_atomics, shader_program, true);
+ if (!screen->get_param(screen, PIPE_CAP_NIR_ATOMICS_AS_DEREF))
+ NIR_PASS_V(nir, gl_nir_lower_atomics, shader_program, true);
+
NIR_PASS_V(nir, nir_opt_intrinsics);
/* Lower 64-bit ops. */
(nir_var_shader_in | nir_var_shader_out | nir_var_function_temp );
nir_remove_dead_variables(nir, mask, NULL);
- if (!st->has_hw_atomics)
+ if (!st->has_hw_atomics && !screen->get_param(screen, PIPE_CAP_NIR_ATOMICS_AS_DEREF))
NIR_PASS_V(nir, nir_lower_atomics_to_ssbo);
st_finalize_nir_before_variants(nir);