-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow mat2/3/4 as attribute types #1652
Comments
Marking as Needs Action to get this investigated first. |
I investigated this briefly. I'm not 100% sure, but I think neither D3D12 nor Metal has this feature. I couldn't find documentation on them. Vulkan: https://www.khronos.org/registry/vulkan/specs/1.2/html/chap21.html#fxvertex-attrib-location Metal examples like this one promote the idea of indexing into a constant buffer with the vertexID. So for this case, I think the WebGPU equivalent would be to use a readonly storage buffer of SPIRV-Cross translates SPIR-V mat4 attributes into four float4 attributes when targeting both MSL and HLSL (and reconstructs them into a mat4 in the generated code). |
So it appears that the following are true:
Seems straightforward that we could just defer this until after MVP? In my previous discussions on the topic within |
Got a confirmation from magcius that HLSL doesn't support this. |
…#1652) If occlusionQuerySet is not null, the type should be occlusion. So, this PR adds a test to check if the type is invalid if the type is not occlusion. Issue: gpuweb#1618
That would be nice (and would help our WebGPU support in Babylon.js) to allow having attributes of types mat2/3/4 in the vertex shader.
According to @kainino0x, Vulkan does allow it, for Metal/D3D12 it has to be looked for.
Note that we can do it in WebGL by "binding" 4 vec4 in sequence with enableVertexAttribArray/vertexAttribPointer.
The text was updated successfully, but these errors were encountered: