NewUser69420
NewUser69420

Reputation: 63

How can I declare an enum in wgsl?

I am trying to raymarch through a voxel octree on the gpu so I'm tyring to use an enum:

enum Node {
    Empty,
    Filled(ShaderVoxel),
    Group(array<Node>),
}

But this is telling me this:

error: expected global item ('struct', 'const', 'var', 'alias', ';', 'fn') or the end of the file, found 'enum'
   ┌─ wgsl:10:1
   │
10 │ enum Node {
   │ ^^^^ expected global item ('struct', 'const', 'var', 'alias', ';', 'fn') or the end of the file

Is there a different way of declaring it? Or is it simply not supported?

If not is there another way to have an octree on the gpu in wgsl? I am using bevy 0.12 on the cpu side of things

Upvotes: 1

Views: 433

Answers (0)

Related Questions