From 4bad415bcab581c55770a16ef2e8fe1e6d105ff1 Mon Sep 17 00:00:00 2001
From: ReinUsesLisp <reinuseslisp@airmail.cc>
Date: Mon, 17 May 2021 19:25:19 -0300
Subject: [PATCH] glasm: Implement InstanceId and VertexId

---
 .../backend/glasm/emit_glasm_context_get_set.cpp            | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp
index 9ce6c9214..ceadb3333 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp
@@ -65,6 +65,12 @@ void EmitGetAttribute(EmitContext& ctx, IR::Inst& inst, IR::Attribute attr,
     case IR::Attribute::PositionW:
         ctx.Add("MOV.F {}.x,{}.position.{};", inst, ctx.stage_name, swizzle);
         break;
+    case IR::Attribute::InstanceId:
+        ctx.Add("MOV.S {}.x,{}.instance;", inst, ctx.stage_name);
+        break;
+    case IR::Attribute::VertexId:
+        ctx.Add("MOV.S {}.x,{}.id;", inst, ctx.stage_name);
+        break;
     default:
         throw NotImplementedException("Get attribute {}", attr);
     }