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

[naga spv-out] Expand LocalType to permit pointers to matrices. #6387

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

jimblandy
Copy link
Member

In back::spv:

  • Factor out the numeric variants of LocalType into a new enum, NumericType.

  • Split the Value variant into Numeric and LocalPointer variants, and let LocalPointer point to any numeric type, including matrices.

    In subsequent PRs, we'll need to spill matrices out into temporary local variables. This means we'll need to generate SPIR-V pointer-to-matrix types, so LocalType needs to be able to represent that.

  • Rename make_local to LocalType::from_inner.

    Change the free function back::spv::make_local into an associated function LocalType::from_inner.

Change the free function `back::spv::make_local` into an associated
function `LocalType::from_inner`.
In `back::spv`:

- Factor out the numeric variants of `LocalType` into a
  new enum, `NumericType`.

- Split the `Value` variant into `Numeric` and `LocalPointer`
  variants, and let `LocalPointer` point to any numeric type,
  including matrices.

In subsequent commits, we'll need to spill matrices out into temporary
local variables. This means we'll need to generate SPIR-V
pointer-to-matrix types, so `LocalType` needs to be able to represent
that.
@jimblandy jimblandy added area: naga back-end Outputs of naga shader conversion naga Shader Translator kind: refactor Making existing function faster or nicer lang: SPIR-V Vulkan's Shading Language labels Oct 9, 2024
@jimblandy jimblandy requested a review from a team as a code owner October 9, 2024 17:05
@jimblandy
Copy link
Member Author

This PR is big, but boring. All it's doing is rearranging some enums... that happen to be widely used 😭

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.

This is great! I like how it simplifies things as well.

@jimblandy jimblandy merged commit 908e835 into gfx-rs:trunk Oct 10, 2024
27 checks passed
@jimblandy jimblandy deleted the naga-spv-out-generalize-LocalType branch October 10, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga back-end Outputs of naga shader conversion kind: refactor Making existing function faster or nicer lang: SPIR-V Vulkan's Shading Language naga Shader Translator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants