summaryrefslogtreecommitdiff
path: root/src/shader_recompiler
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-04-11 21:02:44 -0300
committerGravatar ameerj2021-07-22 21:51:27 -0400
commit23b87147321d02abf47868f231f00f29b0d3b87d (patch)
treeeb5e8850d0fcf34a1cb301d431e6b591ecb9295d /src/shader_recompiler
parentpipeline_helper: Simplify descriptor objects initialization (diff)
downloadyuzu-23b87147321d02abf47868f231f00f29b0d3b87d.tar.gz
yuzu-23b87147321d02abf47868f231f00f29b0d3b87d.tar.xz
yuzu-23b87147321d02abf47868f231f00f29b0d3b87d.zip
spirv: Define StorageImageWriteWithoutFormat capability when used
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv.cpp3
-rw-r--r--src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp5
-rw-r--r--src/shader_recompiler/shader_info.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
index 9248bd78b..3258b0cf8 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
@@ -244,6 +244,9 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct
244 if (info.uses_typeless_image_reads && profile.support_typeless_image_loads) { 244 if (info.uses_typeless_image_reads && profile.support_typeless_image_loads) {
245 ctx.AddCapability(spv::Capability::StorageImageReadWithoutFormat); 245 ctx.AddCapability(spv::Capability::StorageImageReadWithoutFormat);
246 } 246 }
247 if (info.uses_typeless_image_writes) {
248 ctx.AddCapability(spv::Capability::StorageImageWriteWithoutFormat);
249 }
247 // TODO: Track this usage 250 // TODO: Track this usage
248 ctx.AddCapability(spv::Capability::ImageGatherExtended); 251 ctx.AddCapability(spv::Capability::ImageGatherExtended);
249 ctx.AddCapability(spv::Capability::ImageQuery); 252 ctx.AddCapability(spv::Capability::ImageQuery);
diff --git a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
index c80d2d29c..ab529e86d 100644
--- a/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
+++ b/src/shader_recompiler/ir_opt/collect_shader_info_pass.cpp
@@ -436,6 +436,11 @@ void VisitUsages(Info& info, IR::Inst& inst) {
436 inst.GetAssociatedPseudoOperation(IR::Opcode::GetSparseFromOp) != nullptr; 436 inst.GetAssociatedPseudoOperation(IR::Opcode::GetSparseFromOp) != nullptr;
437 break; 437 break;
438 } 438 }
439 case IR::Opcode::ImageWrite: {
440 const auto flags{inst.Flags<IR::TextureInstInfo>()};
441 info.uses_typeless_image_writes |= flags.image_format == ImageFormat::Typeless;
442 break;
443 }
439 case IR::Opcode::SubgroupEqMask: 444 case IR::Opcode::SubgroupEqMask:
440 case IR::Opcode::SubgroupLtMask: 445 case IR::Opcode::SubgroupLtMask:
441 case IR::Opcode::SubgroupLeMask: 446 case IR::Opcode::SubgroupLeMask:
diff --git a/src/shader_recompiler/shader_info.h b/src/shader_recompiler/shader_info.h
index aa204ae37..6a51aabb5 100644
--- a/src/shader_recompiler/shader_info.h
+++ b/src/shader_recompiler/shader_info.h
@@ -129,6 +129,7 @@ struct Info {
129 bool uses_subgroup_mask{}; 129 bool uses_subgroup_mask{};
130 bool uses_fswzadd{}; 130 bool uses_fswzadd{};
131 bool uses_typeless_image_reads{}; 131 bool uses_typeless_image_reads{};
132 bool uses_typeless_image_writes{};
132 bool uses_shared_increment{}; 133 bool uses_shared_increment{};
133 bool uses_shared_decrement{}; 134 bool uses_shared_decrement{};
134 bool uses_global_increment{}; 135 bool uses_global_increment{};