summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/spirv
diff options
context:
space:
mode:
authorFengChen <vonchenplus@gmail.com>2022-11-10 17:25:03 +0100
committerFengChen <vonchenplus@gmail.com>2022-11-17 15:45:14 +0100
commit60e0d4a177803891720af4c5978bbf2604bed276 (patch)
treea020a61ec430e3f2c3aff69b267b979a43f9eb9b /src/shader_recompiler/backend/spirv
parentMerge pull request #9199 from liamwhite/service-oops (diff)
downloadyuzu-60e0d4a177803891720af4c5978bbf2604bed276.tar
yuzu-60e0d4a177803891720af4c5978bbf2604bed276.tar.gz
yuzu-60e0d4a177803891720af4c5978bbf2604bed276.tar.bz2
yuzu-60e0d4a177803891720af4c5978bbf2604bed276.tar.lz
yuzu-60e0d4a177803891720af4c5978bbf2604bed276.tar.xz
yuzu-60e0d4a177803891720af4c5978bbf2604bed276.tar.zst
yuzu-60e0d4a177803891720af4c5978bbf2604bed276.zip
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp2
-rw-r--r--src/shader_recompiler/backend/spirv/spirv_emit_context.cpp4
2 files changed, 6 insertions, 0 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 a4751b42d..ce33fabf5 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
@@ -315,6 +315,8 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, Id vertex) {
switch (attr) {
case IR::Attribute::PrimitiveId:
return ctx.OpBitcast(ctx.F32[1], ctx.OpLoad(ctx.U32[1], ctx.primitive_id));
+ case IR::Attribute::Layer:
+ return ctx.OpBitcast(ctx.F32[1], ctx.OpLoad(ctx.U32[1], ctx.layer));
case IR::Attribute::PositionX:
case IR::Attribute::PositionY:
case IR::Attribute::PositionZ:
diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
index c26ad8f93..e80662d23 100644
--- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
+++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
@@ -1355,6 +1355,10 @@ void EmitContext::DefineInputs(const IR::Program& program) {
if (loads[IR::Attribute::PrimitiveId]) {
primitive_id = DefineInput(*this, U32[1], false, spv::BuiltIn::PrimitiveId);
}
+ if (loads[IR::Attribute::Layer]) {
+ AddCapability(spv::Capability::Geometry);
+ layer = DefineInput(*this, U32[1], false, spv::BuiltIn::Layer);
+ }
if (loads.AnyComponent(IR::Attribute::PositionX)) {
const bool is_fragment{stage != Stage::Fragment};
const spv::BuiltIn built_in{is_fragment ? spv::BuiltIn::Position : spv::BuiltIn::FragCoord};