summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2021-04-03 01:48:39 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:26 +0200
commitbaec84247fe815199595d9e8077b71f3b5c8317e (patch)
tree84195625ffb43922ba87b25296057bdeb9f22a2c /src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
parentshader: Implement SR_LaneId (diff)
downloadyuzu-baec84247fe815199595d9e8077b71f3b5c8317e.tar
yuzu-baec84247fe815199595d9e8077b71f3b5c8317e.tar.gz
yuzu-baec84247fe815199595d9e8077b71f3b5c8317e.tar.bz2
yuzu-baec84247fe815199595d9e8077b71f3b5c8317e.tar.lz
yuzu-baec84247fe815199595d9e8077b71f3b5c8317e.tar.xz
yuzu-baec84247fe815199595d9e8077b71f3b5c8317e.tar.zst
yuzu-baec84247fe815199595d9e8077b71f3b5c8317e.zip
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp39
1 files changed, 5 insertions, 34 deletions
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 f13c0ee72..caab9aa12 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
@@ -58,7 +58,10 @@ std::optional<Id> OutputAttrPointer(EmitContext& ctx, IR::Attribute attr) {
return ctx.OpAccessChain(ctx.output_f32, ctx.clip_distances, clip_num);
}
case IR::Attribute::ViewportIndex:
- return ctx.ignore_viewport_layer ? std::nullopt : std::optional<Id>{ctx.viewport_index};
+ return (ctx.profile.support_viewport_index_layer_non_geometry ||
+ ctx.stage == Shader::Stage::Geometry)
+ ? std::optional<Id>{ctx.viewport_index}
+ : std::nullopt;
default:
throw NotImplementedException("Read attribute {}", attr);
}
@@ -206,7 +209,7 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr) {
}
void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, Id value) {
- auto output = OutputAttrPointer(ctx, attr);
+ const std::optional<Id> output{OutputAttrPointer(ctx, attr)};
if (!output) {
return;
}
@@ -263,38 +266,6 @@ void EmitSetOFlag(EmitContext&) {
throw NotImplementedException("SPIR-V Instruction");
}
-void EmitGetFCSMFlag(EmitContext&) {
- throw NotImplementedException("SPIR-V Instruction");
-}
-
-void EmitGetTAFlag(EmitContext&) {
- throw NotImplementedException("SPIR-V Instruction");
-}
-
-void EmitGetTRFlag(EmitContext&) {
- throw NotImplementedException("SPIR-V Instruction");
-}
-
-void EmitGetMXFlag(EmitContext&) {
- throw NotImplementedException("SPIR-V Instruction");
-}
-
-void EmitSetFCSMFlag(EmitContext&) {
- throw NotImplementedException("SPIR-V Instruction");
-}
-
-void EmitSetTAFlag(EmitContext&) {
- throw NotImplementedException("SPIR-V Instruction");
-}
-
-void EmitSetTRFlag(EmitContext&) {
- throw NotImplementedException("SPIR-V Instruction");
-}
-
-void EmitSetMXFlag(EmitContext&) {
- throw NotImplementedException("SPIR-V Instruction");
-}
-
Id EmitWorkgroupId(EmitContext& ctx) {
return ctx.OpLoad(ctx.U32[3], ctx.workgroup_id);
}