NSL requires to generate the following build in variables and fill it in appropriately.
[x] VertexID
[x] PrimitiveID
[x] InstanceID
The InstanceID can be generated/set without the presence of hardware instancing. A new parameter could be added to thre render_detailstruct from the backend class.
Those ids could be introduced by binding points
int_t vid : vertex_id
A variable defined outside of shaders in configs will be global, so those are introduced into variable sets. The above example would require to introduce local variables that will not be settable through the variable set. Local variables are only available in the shader.
This is solved by introducing a new flow qualifier local. Those variables are not added to the variable sets but stay local to the shader. So constant values could be set to them.
NSL requires to generate the following build in variables and fill it in appropriately.
The InstanceID can be generated/set without the presence of hardware instancing. A new parameter could be added to thre
render_detail
struct from the backend class.Those ids could be introduced by binding points
A variable defined outside of shaders in configs will be global, so those are introduced into variable sets. The above example would require to introduce local variables that will not be settable through the variable set. Local variables are only available in the shader.