Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Supporting gl_PointCoord #2180

Merged
merged 5 commits into from
Dec 21, 2022
Merged

Supporting gl_PointCoord #2180

merged 5 commits into from
Dec 21, 2022

Conversation

PixelDust22
Copy link
Contributor

Support gl_PointCoord in the glsl frontend.

Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!
Have a small request for the HLSL backend.

@@ -162,6 +162,7 @@ impl crate::BuiltIn {
Self::VertexIndex => "SV_VertexID",
// fragment
Self::FragDepth => "SV_Depth",
Self::PointCoord => "VPOS",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only available in dx9 / sm2 which we don't support. Let's error with "Unsupported builtin" instead (as we do for ViewIndex). And if we are here already, please also do the same for PointSize.

See also gpuweb/gpuweb#332 for more context.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you can remove gl_PointSize that easily. In the quad-vert The hlsl backend emits PSIZE in the gl_PerVertex struct despite it not being used. I've only made it so that it errors with Unsupported builtin on gl_PointCoord.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks for trying though! I opened #2182 to do it later.

@PixelDust22 PixelDust22 requested a review from teoxoy December 20, 2022 19:24
@teoxoy teoxoy merged commit 8e1b052 into gfx-rs:master Dec 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants