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

MSL: Work around broken cube texture gradients on Apple Silicon. #2233

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

cdavis5e
Copy link
Contributor

@cdavis5e cdavis5e commented Nov 27, 2023

To date, all released Apple Silicon GPUs incorrectly interpret the gradient vectors when sampling a cube texture. Specifically, they ignore one of the three partial derivatives in each gradient depending on the selected major axis, and they expect the remaining derivatives to be partially transformed.

h/t @lexaknyazev for the code used in the spvGradientCube() function.

Fixes 8 tests under dEQP-VK.glsl.texture_functions.texturegrad.*.

Also, (unrelated) add missing new MSL options to the C API and the CLI.

Copy link
Contributor

@HansKristian-Work HansKristian-Work left a comment

Choose a reason for hiding this comment

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

Mostly nits in terms of unrelated features being added in the PR (at least split into separate commits).

main.cpp Show resolved Hide resolved
main.cpp Show resolved Hide resolved
main.cpp Outdated Show resolved Hide resolved
spirv_cross_c.h Show resolved Hide resolved
main.cpp Show resolved Hide resolved
spirv_cross_c.cpp Show resolved Hide resolved
Copy link
Contributor

@billhollings billhollings left a comment

Choose a reason for hiding this comment

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

LGTM.

spirv_cross_c.cpp Show resolved Hide resolved
To date, all released Apple Silicon GPUs incorrectly interpret the
gradient vectors when sampling a cube texture. Specifically, they ignore
one of the three partial derivatives in each gradient depending on the
selected major axis, and they expect the remaining derivatives to be
partially transformed.

h/t @lexaknyazev for the code used in the `spvGradientCube()` function.

Fixes 8 tests under `dEQP-VK.glsl.texture_functions.texturegrad.*`.
Copy link
Contributor

@HansKristian-Work HansKristian-Work left a comment

Choose a reason for hiding this comment

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

LGTM, assuming math is conformant.

@HansKristian-Work HansKristian-Work merged commit 50e90dd into KhronosGroup:main Nov 28, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants