I'm using a compute shader to speed up parallel processing of a 3D space computation. The shader gives me compile error Shader error in 'Polygonize': syntax error: unexpected token 'struct' at kernel Polygonize at Polygonize.compute(10) (on d3d11). Polygonize.compute is the shader file. The weirdest thing is that the first struct doesn't cause an error but the second one does. This is the code: (there's more later but the error occurs at the declaration of the second struct)
#pragma kernel Polygonize struct Points { float value; int material; float3 location; } struct vertex { float3 location; bool weld; int weldnumber; }
Afaik in shaders (HLSL) the definition of structs ends with ;
;
so it should be
struct Points { float value; int material; float3 location; }; struct vertex { float3 location; bool weld; int weldnumber; };
2.1m questions
2.1m answers
60 comments
57.0k users