summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/spirv
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2021-04-02 23:05:47 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:26 +0200
commit45d547af11a18434ea17e4427db7286856a19537 (patch)
treea12a3d283abb99d52c3084b9ded7d1aa9b0bd03f /src/shader_recompiler/backend/spirv
parentshader: Fix shared memory on cool drivers (diff)
downloadyuzu-45d547af11a18434ea17e4427db7286856a19537.tar
yuzu-45d547af11a18434ea17e4427db7286856a19537.tar.gz
yuzu-45d547af11a18434ea17e4427db7286856a19537.tar.bz2
yuzu-45d547af11a18434ea17e4427db7286856a19537.tar.lz
yuzu-45d547af11a18434ea17e4427db7286856a19537.tar.xz
yuzu-45d547af11a18434ea17e4427db7286856a19537.tar.zst
yuzu-45d547af11a18434ea17e4427db7286856a19537.zip
Diffstat (limited to 'src/shader_recompiler/backend/spirv')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv.h1
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.h b/src/shader_recompiler/backend/spirv/emit_spirv.h
index 749ad1240..17a452e0e 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv.h
+++ b/src/shader_recompiler/backend/spirv/emit_spirv.h
@@ -71,6 +71,7 @@ void EmitSetMXFlag(EmitContext& ctx);
Id EmitWorkgroupId(EmitContext& ctx);
Id EmitLocalInvocationId(EmitContext& ctx);
Id EmitLoadLocal(EmitContext& ctx, Id word_offset);
+Id EmitLaneId(EmitContext& ctx);
void EmitWriteLocal(EmitContext& ctx, Id word_offset, Id value);
Id EmitUndefU1(EmitContext& ctx);
Id EmitUndefU8(EmitContext& ctx);
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 a96ee6f0d..f13c0ee72 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
@@ -303,6 +303,10 @@ Id EmitLocalInvocationId(EmitContext& ctx) {
return ctx.OpLoad(ctx.U32[3], ctx.local_invocation_id);
}
+Id EmitLaneId(EmitContext& ctx) {
+ return ctx.OpLoad(ctx.U32[1], ctx.subgroup_local_invocation_id);
+}
+
Id EmitLoadLocal(EmitContext& ctx, Id word_offset) {
const Id pointer{ctx.OpAccessChain(ctx.private_u32, ctx.local_memory, word_offset)};
return ctx.OpLoad(ctx.U32[1], pointer);