Skip to content
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

Feature/wgsl intrinsic texture gather #5141

Conversation

jkwak-work
Copy link
Collaborator

This PR implements the texture gather functions for WGSL.

The pattern was very similar to how Metal was implemented.
Before copy and paste from the Metal implementation, I had to
clean up the Metal implementation to make it more readable
and maintainable.

Gather functions are available only for 2D and 3D textures.
Their `array` and `depth` variants may or may not be supported depending on the target.
`static_assert` ensures that Gather functions are available only for 2D and 3D textures.

Removed incorrect use of "$p" argument for targeting GLSL.

@jkwak-work jkwak-work added the pr: non-breaking PRs without breaking changes label Sep 23, 2024
@jkwak-work jkwak-work self-assigned this Sep 23, 2024
@jkwak-work jkwak-work force-pushed the feature/wgsl_intrinsic_texture_gather branch from fb50647 to f72f130 Compare September 23, 2024 22:25
@jkwak-work jkwak-work marked this pull request as draft September 23, 2024 22:52
@jkwak-work
Copy link
Collaborator Author

It seems like my clean up caused a problem for GatherCmp when the texture is non-depth texture.
GatherCmp in HLSL requires the texture to be a depth texture.
But it seems like GLSL doesn't require it.
I will fix it.

@jkwak-work jkwak-work marked this pull request as ready for review September 23, 2024 23:36
This commit implements the texture gather functions for WGSL.

The pattern was very similar to how Metal was implemented.
Before copy and paste from the Metal implementation, I had to
clean up the Metal implementation to make it more readable
and maintainable.

Gather functions are available only for 2D and 3D textures.
Their `array` and `depth` variants may or may not be supported depending on the target.
`static_assert` ensures that Gather functions are available only for 2D and 3D textures.

Removed incorrect use of "$p" argument for targeting GLSL.
csyonghe
csyonghe previously approved these changes Sep 23, 2024
@jkwak-work jkwak-work merged commit ef3552d into shader-slang:master Sep 24, 2024
12 checks passed
@jkwak-work jkwak-work deleted the feature/wgsl_intrinsic_texture_gather branch September 24, 2024 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants