Skip to content
Snippets Groups Projects
Commit 1e4deb3b authored by Emma Anholt's avatar Emma Anholt Committed by Marge Bot
Browse files

zink: Fix up mismatches of memory model vs addressing model.

MemoryModelVulkan was left out for CSes using it.

Cc: mesa-stable
Part-of: <mesa/mesa!20756>
parent adf81044
No related branches found
No related tags found
No related merge requests found
......@@ -4455,26 +4455,24 @@ nir_to_spirv(struct nir_shader *s, const struct zink_shader_info *sinfo, uint32_
ctx.explicit_lod = true;
spirv_builder_emit_source(&ctx.builder, SpvSourceLanguageUnknown, 0);
SpvAddressingModel model = SpvAddressingModelLogical;
if (gl_shader_stage_is_compute(s->info.stage)) {
SpvAddressingModel model;
if (s->info.cs.ptr_size == 32)
model = SpvAddressingModelPhysical32;
else if (s->info.cs.ptr_size == 64)
model = SpvAddressingModelPhysicalStorageBuffer64;
else
model = SpvAddressingModelLogical;
}
if (ctx.sinfo->have_vulkan_memory_model) {
spirv_builder_emit_cap(&ctx.builder, SpvCapabilityVulkanMemoryModel);
spirv_builder_emit_cap(&ctx.builder, SpvCapabilityVulkanMemoryModelDeviceScope);
spirv_builder_emit_mem_model(&ctx.builder, model,
SpvMemoryModelGLSL450);
SpvMemoryModelVulkan);
} else {
if (ctx.sinfo->have_vulkan_memory_model) {
spirv_builder_emit_cap(&ctx.builder, SpvCapabilityVulkanMemoryModel);
spirv_builder_emit_cap(&ctx.builder, SpvCapabilityVulkanMemoryModelDeviceScope);
spirv_builder_emit_mem_model(&ctx.builder, SpvAddressingModelLogical,
SpvMemoryModelVulkan);
} else {
spirv_builder_emit_mem_model(&ctx.builder, SpvAddressingModelLogical,
SpvMemoryModelGLSL450);
}
spirv_builder_emit_mem_model(&ctx.builder, model,
SpvMemoryModelGLSL450);
}
if (s->info.stage == MESA_SHADER_FRAGMENT &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment