-
Notifications
You must be signed in to change notification settings - Fork 552
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
[Metal] Metal backend doesn't know about gl_PointSize #169
Comments
There's an |
If you know that gl_PointSize is used by the shader, is there a reason why [[point_size]] cannot be used automatically? Ping @billhollings. |
I'm starting to look into this now. |
The reason that
For example, see the GLSL input and MSL output for the The problem is that during the compilation of the MSL shader into a render pipeline, Metal will throw an exception (on OSX, not always on iOS) if the shader defines a As a result..there needs to be some way of turning off the There are a couple of ways we could modify behaviour to resolve the issue being discussed...
@HansKristian-ARM Can you comment on the viability of (2) please? What would it take to determine whether the |
I've added PR #177 to implement (1) above. We can add (2) later if it looks feasible based on further discussion and review. |
There is a mechanism to determine now if a builtin variable is used statically by the shader now. It is still possible for a shader to write to gl_PointSize, but point rendering is not used, so some option to forcefully disable PointSize as a builtin should be possible (I don't think writing to gl_PointSize with non-point topology is an error in GL/Vulkan), but by default, I think static use of PointSize can be made into a proper semantic automatically. |
@billhollings The extra check here was fairly trivial so made a PR, please review when you have time: #178. |
FYI, as per merge commit e876cdf this is now working for me. Each Metal vertex shader currently has a Thanks and looking forward to the remaining PRs :) |
Merged on master. |
It seems that the Metal backend currently doesn't add the
[[point_size]]
attribute to vertex shader outputs for the special GL variable gl_PointSize.As example: the GLSL input to glsangValidator looks like this:
And here's the resulting Metal shader (note the missing
[[point_size]]
on the gl_PointSize output:The text was updated successfully, but these errors were encountered: