summaryrefslogtreecommitdiff
path: root/source/slang/core.meta.slang
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-03-15 08:48:41 +0800
committerGitHub <noreply@github.com>2024-03-14 17:48:41 -0700
commitd40931cc8bde13520ea45769cf94e7cc6cc9065f (patch)
treeecde6ebbfbc1445c587b0339332814837ff43229 /source/slang/core.meta.slang
parentc7d7a965c14318c07bd5b8ec60b960c2e95dfebd (diff)
Mesh shader refactoring and bugfixes (#3702)
Diffstat (limited to 'source/slang/core.meta.slang')
-rw-r--r--source/slang/core.meta.slang25
1 files changed, 16 insertions, 9 deletions
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<T, let MAX_VERTS : uint>
__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<T, let MAX_PRIMITIVES : uint>
__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<T, let MAX_PRIMITIVES : uint>
__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;
}
};