mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
zink: use vulkan memory model shader semantics for tcs barriers
Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15959>
This commit is contained in:
parent
6f04f4c8ea
commit
306b5f3724
3 changed files with 17 additions and 3 deletions
|
|
@ -2945,6 +2945,10 @@ emit_intrinsic(struct ntv_context *ctx, nir_intrinsic_instr *intr)
|
|||
spirv_builder_emit_control_barrier(&ctx->builder, SpvScopeWorkgroup,
|
||||
SpvScopeWorkgroup,
|
||||
SpvMemorySemanticsWorkgroupMemoryMask | SpvMemorySemanticsAcquireReleaseMask);
|
||||
else if (ctx->sinfo->have_vulkan_memory_model)
|
||||
spirv_builder_emit_control_barrier(&ctx->builder, SpvScopeWorkgroup,
|
||||
SpvScopeWorkgroup,
|
||||
SpvMemorySemanticsOutputMemoryMask | SpvMemorySemanticsAcquireReleaseMask);
|
||||
else
|
||||
spirv_builder_emit_control_barrier(&ctx->builder, SpvScopeWorkgroup, SpvScopeInvocation, 0);
|
||||
break;
|
||||
|
|
@ -3989,9 +3993,16 @@ nir_to_spirv(struct nir_shader *s, const struct zink_shader_info *sinfo, uint32_
|
|||
model = SpvAddressingModelLogical;
|
||||
spirv_builder_emit_mem_model(&ctx.builder, model,
|
||||
SpvMemoryModelGLSL450);
|
||||
} else
|
||||
spirv_builder_emit_mem_model(&ctx.builder, SpvAddressingModelLogical,
|
||||
SpvMemoryModelGLSL450);
|
||||
} else {
|
||||
if (ctx.stage == MESA_SHADER_TESS_CTRL && ctx.sinfo->have_vulkan_memory_model) {
|
||||
spirv_builder_emit_cap(&ctx.builder, SpvCapabilityVulkanMemoryModel);
|
||||
spirv_builder_emit_mem_model(&ctx.builder, SpvAddressingModelLogical,
|
||||
SpvMemoryModelVulkan);
|
||||
} else {
|
||||
spirv_builder_emit_mem_model(&ctx.builder, SpvAddressingModelLogical,
|
||||
SpvMemoryModelGLSL450);
|
||||
}
|
||||
}
|
||||
|
||||
if (s->info.stage == MESA_SHADER_FRAGMENT &&
|
||||
s->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_STENCIL)) {
|
||||
|
|
|
|||
|
|
@ -2006,6 +2006,8 @@ zink_shader_create(struct zink_screen *screen, struct nir_shader *nir,
|
|||
struct zink_shader *ret = CALLOC_STRUCT(zink_shader);
|
||||
bool have_psiz = false;
|
||||
|
||||
ret->sinfo.have_vulkan_memory_model = screen->info.have_KHR_vulkan_memory_model;
|
||||
|
||||
ret->hash = _mesa_hash_pointer(ret);
|
||||
ret->reduced_prim = get_shader_base_prim_type(nir);
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ struct zink_shader_info {
|
|||
bool last_vertex;
|
||||
bool have_xfb;
|
||||
bool have_sparse;
|
||||
bool have_vulkan_memory_model;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue