From 7c6b71bcbd7821e251541f5dd723428d7bd5a2ed Mon Sep 17 00:00:00 2001 From: Dynamitos Date: Wed, 28 Aug 2024 21:07:49 +0200 Subject: Metal: Mesh Shaders (#4280) * Metal: mesh shading skeleton * Metal: fixing mesh payload * Metal: improving mesh shader indices output * Metal: Implementing conditional mesh output set * Metal: Trying to not break other backends * Metal: trying to fix mesh output set * Metal: Fixing MeshOutputSet usages * Metal: Fixing vertex and primitive semantics * Metal: Fixing code style * Metal: Fixed hlsl indices set * Fixed HLSL mesh output set disappearing and GLSL mesh output crashing * Metal: Adjusting task test matching --------- Co-authored-by: Yong He --- source/slang/slang-ir.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 6a76ccce3..acc6abd57 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -5380,6 +5380,32 @@ namespace Slang return emitSwizzle(type, base, elementCount, irElementIndices); } + IRMetalSetVertex* IRBuilder::emitMetalSetVertex( + IRInst* index, + IRInst* vertex) + { + auto inst = createInst(this, kIROp_MetalSetVertex, getVoidType(), index, vertex); + addInst(inst); + return inst; + } + + IRMetalSetPrimitive* IRBuilder::emitMetalSetPrimitive( + IRInst* index, + IRInst* primitive) + { + auto inst = createInst(this, kIROp_MetalSetVertex, getVoidType(), index, primitive); + addInst(inst); + return inst; + } + + IRMetalSetIndices* IRBuilder::emitMetalSetIndices( + IRInst* index, + IRInst* indices) + { + auto inst = createInst(this, kIROp_MetalSetVertex, getVoidType(), index, indices); + addInst(inst); + return inst; + } IRInst* IRBuilder::emitSwizzleSet( IRType* type, -- cgit v1.2.3