mesa/st: glsl_to_nir: don't lower atomics to SSBOs if driver supports HW atomics
At least on r600 HW atomic operations are way less expensive than SSBO atomic operations. v2: use st->has_hw_atomics (Erik Anholt) v3: remove second invocation of atomic to ssbo lowering (Erik Anholt) Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Eric Anholt <eric@anholt.net> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3286> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3286>
This commit is contained in:
parent
b119f8b4a0
commit
9162e2f03f
|
@ -504,8 +504,9 @@ st_glsl_to_nir_post_opts(struct st_context *st, struct gl_program *prog,
|
||||||
(nir_var_shader_in | nir_var_shader_out | nir_var_function_temp );
|
(nir_var_shader_in | nir_var_shader_out | nir_var_function_temp );
|
||||||
nir_remove_dead_variables(nir, mask);
|
nir_remove_dead_variables(nir, mask);
|
||||||
|
|
||||||
NIR_PASS_V(nir, nir_lower_atomics_to_ssbo,
|
if (!st->has_hw_atomics)
|
||||||
st->ctx->Const.Program[nir->info.stage].MaxAtomicBuffers);
|
NIR_PASS_V(nir, nir_lower_atomics_to_ssbo,
|
||||||
|
st->ctx->Const.Program[nir->info.stage].MaxAtomicBuffers);
|
||||||
|
|
||||||
st_finalize_nir_before_variants(nir);
|
st_finalize_nir_before_variants(nir);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue