-
Notifications
You must be signed in to change notification settings - Fork 195
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
[glsl] Inject default gl_PointSize = 1.0
in vertex shaders if FORCE_POINT_SIZE
option was set
#2223
Conversation
2118afb
to
4df4161
Compare
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 this needs to be implemented in the same way it is for the spv backend.
Lines 524 to 526 in c7d0215
if self.flags.contains(WriterFlags::FORCE_POINT_SIZE) | |
&& iface.stage == crate::ShaderStage::Vertex | |
&& !has_point_size |
- rename
allow_point_size
toforce_point_size
- check if we already have (and wrote/will write) the
BuiltIn::PointSize
It would also help to include a comment in the code explaining this for future reference with a mention of the section of where it happens in the specification (for glsl ES 3.1 this is in section 7.1.1) |
4df4161
to
c3e5073
Compare
c3e5073
to
f8aff4d
Compare
… `FORCE_POINT_SIZE` According to https://registry.khronos.org/OpenGL/specs/es/3.2/GLSL_ES_Specification_3.20.html#built-in-language-variables ``` The variable gl_PointSize is intended for a shader to write the size of the point to be rasterized. It is measured in pixels. If gl_PointSize is not written to, its value is undefined in subsequent pipe stages. ```
- Write warn message if `ClipDistance` and `CullDistance` are used on unsupported version
f8aff4d
to
cf30dd6
Compare
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.
LGTM, thanks!
gl_PointSize = 1.0;
in case of vertex shader and allow_point_size
== truegl_PointSize = 1.0
in vertex shaders if FORCE_POINT_SIZE
option was set
Write
gl_PointSize = 1.0;
in case of vertex shader and set writer flagFORCE_POINT_SIZE
According to https://registry.khronos.org/OpenGL/specs/es/3.2/GLSL_ES_Specification_3.20.html#built-in-language-variables
This is the first part of the changes to address gfx-rs/wgpu#3179