microsoft / hlsl-specs

HLSL Specifications
MIT License
125 stars 34 forks source link

Fix some inconsistencies in the language #332

Open godlikepanos opened 1 month ago

godlikepanos commented 1 month ago

Some of the newer additions to HLSL do not follow the existing conventions of the language and this creates some inconsistencies. It would have been great if some of these inconsistencies are fixed in some of the future HLSL versions.

The 1st is the DispatchRaysIndex(). Someone would expect a sematic like SV_DispatchRaysIndex. Same for PrimitiveIndex(), InstanceID() and probably more that I have forgotten.

I haven't found exactly why that is but it seems that SV_RayPayload and SV_IntersectionAttributes can be omitted. Maybe they shouldn't since this creates confusion.

Mesh shaders output is defined by vertices, primitives and indices keywords. Eg out vertices MeshPerVertOut verts[N], out primitives MeshPerPrimitiveOut primitives[M], out indices uint3 indices[M]. This is inconsistent with how ray payload is defined for example. Maybe these should be semantics.

These are only a few examples. There are possibly more.

damyanp commented 1 month ago

Thank you for the useful feedback!

Setting this to HLSL backlog - this is something that is worthy of addressing at some point in the future but isn't an immediate priority for us.