From d40931cc8bde13520ea45769cf94e7cc6cc9065f Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Fri, 15 Mar 2024 08:48:41 +0800 Subject: Mesh shader refactoring and bugfixes (#3702) --- source/slang/core.meta.slang | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'source/slang/core.meta.slang') diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang index 237daac56..e55206ca9 100644 --- a/source/slang/core.meta.slang +++ b/source/slang/core.meta.slang @@ -1255,12 +1255,15 @@ struct ParameterBlock {} __generic __magic_type(VerticesType) __intrinsic_type($(kIROp_VerticesType)) -struct Vertices +[__NonCopyableType] +struct OutputVertices { __subscript(uint index) -> T { - // TODO: Ellie make sure these remains write only - __intrinsic_op($(kIROp_GetElementPtr)) + // TODO: Make sure this remains write only, we can't do this with just + // a 'set' operation as it's legal to only write to part of the output + // buffer, or part of the output buffer at a time. + __intrinsic_op($(kIROp_MeshOutputRef)) ref; } }; @@ -1268,24 +1271,28 @@ struct Vertices __generic __magic_type(IndicesType) __intrinsic_type($(kIROp_IndicesType)) -struct Indices +[__NonCopyableType] +struct OutputIndices { __subscript(uint index) -> T { - // TODO: Ellie: It's illegal to not write out the whole primitive at once, should we use set over ref? - __intrinsic_op($(kIROp_GetElementPtr)) - ref; + // It's illegal to not write out the entire primitive at once, so limit + // this to set + [mutating] + __intrinsic_op($(kIROp_MeshOutputSet)) + set; } }; __generic __magic_type(PrimitivesType) __intrinsic_type($(kIROp_PrimitivesType)) -struct Primitives +[__NonCopyableType] +struct OutputPrimitives { __subscript(uint index) -> T { - __intrinsic_op($(kIROp_GetElementPtr)) + __intrinsic_op($(kIROp_MeshOutputRef)) ref; } }; -- cgit v1.2.3