summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-11-19 17:27:12 +0100
committerLiam <byteslice@airmail.cc>2023-11-19 17:27:12 +0100
commit473caaff5b02dc75404943dee6b12234995136d4 (patch)
tree9ffcc37eaf92051541ae5e159461506d520f22c6 /src/shader_recompiler/backend
parentMerge pull request #12081 from FernandoS27/check-out-on-your-broke-crypto-friends (diff)
downloadyuzu-473caaff5b02dc75404943dee6b12234995136d4.tar
yuzu-473caaff5b02dc75404943dee6b12234995136d4.tar.gz
yuzu-473caaff5b02dc75404943dee6b12234995136d4.tar.bz2
yuzu-473caaff5b02dc75404943dee6b12234995136d4.tar.lz
yuzu-473caaff5b02dc75404943dee6b12234995136d4.tar.xz
yuzu-473caaff5b02dc75404943dee6b12234995136d4.tar.zst
yuzu-473caaff5b02dc75404943dee6b12234995136d4.zip
Diffstat (limited to 'src/shader_recompiler/backend')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv.cpp2
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
index 34592a01f..0031fa5fb 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
@@ -407,7 +407,7 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct
}
ctx.AddCapability(spv::Capability::DemoteToHelperInvocation);
}
- if (info.stores[IR::Attribute::ViewportIndex]) {
+ if (info.stores[IR::Attribute::ViewportIndex] && profile.support_multi_viewport) {
ctx.AddCapability(spv::Capability::MultiViewport);
}
if (info.stores[IR::Attribute::ViewportMask] && profile.support_viewport_mask) {
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
index 1d77426e0..e5a78a914 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
@@ -84,6 +84,10 @@ std::optional<OutAttr> OutputAttrPointer(EmitContext& ctx, IR::Attribute attr) {
}
return std::nullopt;
case IR::Attribute::ViewportIndex:
+ if (!ctx.profile.support_multi_viewport) {
+ LOG_WARNING(Shader, "Ignoring viewport index store on non-supporting driver");
+ return std::nullopt;
+ }
if (ctx.profile.support_viewport_index_layer_non_geometry ||
ctx.stage == Shader::Stage::Geometry) {
return OutAttr{ctx.viewport_index, ctx.U32[1]};