mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
zink: Fix up mismatches of memory model vs addressing model.
MemoryModelVulkan was left out for CSes using it.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
(cherry picked from commit 1e4deb3b89)
This commit is contained in:
parent
617fdb8818
commit
135425a3ae
2 changed files with 10 additions and 12 deletions
|
|
@ -796,7 +796,7 @@
|
|||
"description": "zink: Fix up mismatches of memory model vs addressing model.",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4451,26 +4451,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,
|
||||
SpvMemoryModelVulkan);
|
||||
} else {
|
||||
spirv_builder_emit_mem_model(&ctx.builder, model,
|
||||
SpvMemoryModelGLSL450);
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
||||
if (s->info.stage == MESA_SHADER_FRAGMENT &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue