diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-11-09 17:58:10 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2023-01-01 22:43:57 +0100 |
commit | aad0cbf024fb8077a9b375a093c60a7e2ab1db3d (patch) | |
tree | 8c6a86c92ed8cedbafb5f34dd9f72283eaaf4342 /src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | |
parent | MacroHLE: Add Index Buffer size estimation. (diff) | |
download | yuzu-aad0cbf024fb8077a9b375a093c60a7e2ab1db3d.tar yuzu-aad0cbf024fb8077a9b375a093c60a7e2ab1db3d.tar.gz yuzu-aad0cbf024fb8077a9b375a093c60a7e2ab1db3d.tar.bz2 yuzu-aad0cbf024fb8077a9b375a093c60a7e2ab1db3d.tar.lz yuzu-aad0cbf024fb8077a9b375a093c60a7e2ab1db3d.tar.xz yuzu-aad0cbf024fb8077a9b375a093c60a7e2ab1db3d.tar.zst yuzu-aad0cbf024fb8077a9b375a093c60a7e2ab1db3d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | 8 |
1 files changed, 8 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 73b67f0af..e4802bf9e 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 @@ -339,6 +339,10 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, Id vertex) { const Id base{ctx.OpLoad(ctx.U32[1], ctx.base_vertex)}; return ctx.OpBitcast(ctx.F32[1], ctx.OpISub(ctx.U32[1], index, base)); } + case IR::Attribute::BaseInstance: + return ctx.OpBitcast(ctx.F32[1], ctx.OpLoad(ctx.U32[1], ctx.base_instance)); + case IR::Attribute::BaseVertex: + return ctx.OpBitcast(ctx.F32[1], ctx.OpLoad(ctx.U32[1], ctx.base_vertex)); case IR::Attribute::FrontFace: return ctx.OpSelect(ctx.F32[1], ctx.OpLoad(ctx.U1, ctx.front_face), ctx.OpBitcast(ctx.F32[1], ctx.Const(std::numeric_limits<u32>::max())), @@ -380,6 +384,10 @@ Id EmitGetAttributeU32(EmitContext& ctx, IR::Attribute attr, Id) { const Id base{ctx.OpLoad(ctx.U32[1], ctx.base_vertex)}; return ctx.OpISub(ctx.U32[1], index, base); } + case IR::Attribute::BaseInstance: + return ctx.OpLoad(ctx.U32[1], ctx.base_instance); + case IR::Attribute::BaseVertex: + return ctx.OpLoad(ctx.U32[1], ctx.base_vertex); default: throw NotImplementedException("Read U32 attribute {}", attr); } |