diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2021-03-30 21:52:06 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:25 +0200 |
commit | 0c4cf3b9eb7de6624a844ae9ac9d2ba6b2ef3ac2 (patch) | |
tree | 2ee6b4fb859d23e304b80d91a3472d8a504d01e3 /src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | |
parent | shader: Fix TXD (diff) | |
download | yuzu-0c4cf3b9eb7de6624a844ae9ac9d2ba6b2ef3ac2.tar yuzu-0c4cf3b9eb7de6624a844ae9ac9d2ba6b2ef3ac2.tar.gz yuzu-0c4cf3b9eb7de6624a844ae9ac9d2ba6b2ef3ac2.tar.bz2 yuzu-0c4cf3b9eb7de6624a844ae9ac9d2ba6b2ef3ac2.tar.lz yuzu-0c4cf3b9eb7de6624a844ae9ac9d2ba6b2ef3ac2.tar.xz yuzu-0c4cf3b9eb7de6624a844ae9ac9d2ba6b2ef3ac2.tar.zst yuzu-0c4cf3b9eb7de6624a844ae9ac9d2ba6b2ef3ac2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | 13 |
1 files changed, 13 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 d02761f32..2eaeb29de 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 @@ -44,6 +44,19 @@ Id OutputAttrPointer(EmitContext& ctx, IR::Attribute attr) { case IR::Attribute::PositionZ: case IR::Attribute::PositionW: return ctx.OpAccessChain(ctx.output_f32, ctx.output_position, element_id()); + case IR::Attribute::ClipDistance0: + case IR::Attribute::ClipDistance1: + case IR::Attribute::ClipDistance2: + case IR::Attribute::ClipDistance3: + case IR::Attribute::ClipDistance4: + case IR::Attribute::ClipDistance5: + case IR::Attribute::ClipDistance6: + case IR::Attribute::ClipDistance7: { + const u32 base{static_cast<u32>(IR::Attribute::ClipDistance0)}; + const u32 index{static_cast<u32>(attr) - base}; + const Id clip_num{ctx.Constant(ctx.U32[1], index)}; + return ctx.OpAccessChain(ctx.output_f32, ctx.clip_distances, clip_num); + } default: throw NotImplementedException("Read attribute {}", attr); } |