-
Notifications
You must be signed in to change notification settings - Fork 628
MSL: Add option to provide a default point size. #2474
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
MSL: Add option to provide a default point size. #2474
Conversation
adc494c to
ada5877
Compare
| return; | ||
|
|
||
| auto &type = this->get<SPIRType>(var.basetype); | ||
| if (need_point_size && has_decoration(type.self, DecorationBlock)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this handle case where point size is a standalone variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slipped my mind there could be multiple ways to define, I added the built-in check below as well which should handle this.
main.cpp
Outdated
| cbs.add("--msl-auto-disable-rasterization", [&args](CLIParser &) { args.msl_auto_disable_rasterization = true; }); | ||
| cbs.add("--msl-default-point-size", | ||
| [&args](CLIParser &parser) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like applying the style nit in web viewer didn't work <_< I'll do it locally before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I got what you wanted assuming it's like some of the other lines, fixed in commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close enough (don't use static_cast for plain arithmetic types).
bcf3764 to
8b91a44
Compare
VK_KHR_maintenance5requires thatPointSizedefault to1.0when not written in a shader. In order to support this requirement, this PR adds an option for MSL to emit a defaultPointSizevalue when it was not written, as according to Metal documentation the point size must be specified within the vertex shader.I considered using the existing
enable_point_size_builtinflag for this but it currently defaults to true. Changing this could negatively impact users relying on the default conversion behavior respectingPointSize, and leaving it means every shader emits a default value unless explicitly disabled. Thus I added a new flag to control emitting the default, and a new float option to set what that default is.Have also added tests with this option where the point size is provided by the shader, meaning it should not be defaulted, and where the point size is not provided by the shader, meaning it should be.