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] Let constant evaluation of As preserve Splat expressions. #4719

Merged
merged 1 commit into from
Nov 18, 2023

Conversation

jimblandy
Copy link
Member

When asked to evaluate an Expression::As cast applied to a Splat expression, change ConstantEvaluator::cast to preserve the Splat, rather than expanding it out to a Compose expression.

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
  • Run cargo xtask test to run tests.
  • (not appropriate) Add change to CHANGELOG.md. See simple instructions inside file.

When asked to evaluate an `Expression::As` cast applied to a `Splat`
expression, change `ConstantEvaluator::cast` to preserve the `Splat`,
rather than expanding it out to a `Compose` expression.
@jimblandy jimblandy requested a review from a team as a code owner November 17, 2023 22:39
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.

Looks good, left a suggestion. Feel free to push it to this PR/start another or ignore it :)

naga/src/proc/constant_evaluator.rs Show resolved Hide resolved
@jimblandy jimblandy merged commit fd53ea9 into gfx-rs:trunk Nov 18, 2023
27 checks passed
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 21, 2023
…6978ae2d251. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler,teoxoy

Note: This revision contains the arcanization work

# Changelog

 * #4702 Add `WasmNotSendSync`
   By daxpedda in gfx-rs/wgpu#4702
 * #4707 Add more metal keywords
   By fornwall in gfx-rs/wgpu#4707
 * #4706 [naga] remove `span` and `validate` features
   By teoxoy in gfx-rs/wgpu#4706
 * #4709 [dx12] filter out haswell iGPUs
   By teoxoy in gfx-rs/wgpu#4709
 * #4712 Fix typo in pull request template.
   By jimblandy in gfx-rs/wgpu#4712
 * #4598 Add more lints
   By daxpedda in gfx-rs/wgpu#4598
 * #4713 [naga wgsl-in] Include base when printing pointer and array types.
   By jimblandy in gfx-rs/wgpu#4713
 * #4718 [vk] check that adapters are Vulkan compliant
   By teoxoy in gfx-rs/wgpu#4718
 * #4719 [naga] Let constant evaluation of `As` preserve `Splat` expressions.
   By jimblandy in gfx-rs/wgpu#4719
 * #4725 Corrects typo in examples FrameCounter
   By cantudo in gfx-rs/wgpu#4725
 * #3626 Arcanization of wgpu core resources
   By gents83 in gfx-rs/wgpu#3626

Differential Revision: https://phabricator.services.mozilla.com/D194048
vinnydiehl pushed a commit to vinnydiehl/mozilla-unified that referenced this pull request Nov 21, 2023
…6978ae2d251. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler,teoxoy

Note: This revision contains the arcanization work

# Changelog

 * #4702 Add `WasmNotSendSync`
   By daxpedda in gfx-rs/wgpu#4702
 * #4707 Add more metal keywords
   By fornwall in gfx-rs/wgpu#4707
 * #4706 [naga] remove `span` and `validate` features
   By teoxoy in gfx-rs/wgpu#4706
 * #4709 [dx12] filter out haswell iGPUs
   By teoxoy in gfx-rs/wgpu#4709
 * #4712 Fix typo in pull request template.
   By jimblandy in gfx-rs/wgpu#4712
 * #4598 Add more lints
   By daxpedda in gfx-rs/wgpu#4598
 * #4713 [naga wgsl-in] Include base when printing pointer and array types.
   By jimblandy in gfx-rs/wgpu#4713
 * #4718 [vk] check that adapters are Vulkan compliant
   By teoxoy in gfx-rs/wgpu#4718
 * #4719 [naga] Let constant evaluation of `As` preserve `Splat` expressions.
   By jimblandy in gfx-rs/wgpu#4719
 * #4725 Corrects typo in examples FrameCounter
   By cantudo in gfx-rs/wgpu#4725
 * #3626 Arcanization of wgpu core resources
   By gents83 in gfx-rs/wgpu#3626

Differential Revision: https://phabricator.services.mozilla.com/D194048
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Nov 21, 2023
…6978ae2d251. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler,teoxoy

Note: This revision contains the arcanization work

# Changelog

 * #4702 Add `WasmNotSendSync`
   By daxpedda in gfx-rs/wgpu#4702
 * #4707 Add more metal keywords
   By fornwall in gfx-rs/wgpu#4707
 * #4706 [naga] remove `span` and `validate` features
   By teoxoy in gfx-rs/wgpu#4706
 * #4709 [dx12] filter out haswell iGPUs
   By teoxoy in gfx-rs/wgpu#4709
 * #4712 Fix typo in pull request template.
   By jimblandy in gfx-rs/wgpu#4712
 * #4598 Add more lints
   By daxpedda in gfx-rs/wgpu#4598
 * #4713 [naga wgsl-in] Include base when printing pointer and array types.
   By jimblandy in gfx-rs/wgpu#4713
 * #4718 [vk] check that adapters are Vulkan compliant
   By teoxoy in gfx-rs/wgpu#4718
 * #4719 [naga] Let constant evaluation of `As` preserve `Splat` expressions.
   By jimblandy in gfx-rs/wgpu#4719
 * #4725 Corrects typo in examples FrameCounter
   By cantudo in gfx-rs/wgpu#4725
 * #3626 Arcanization of wgpu core resources
   By gents83 in gfx-rs/wgpu#3626

Differential Revision: https://phabricator.services.mozilla.com/D194048

UltraBlame original commit: eb839abb42abde594497e419517260997fa1fc4d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Nov 21, 2023
…6978ae2d251. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler,teoxoy

Note: This revision contains the arcanization work

# Changelog

 * #4702 Add `WasmNotSendSync`
   By daxpedda in gfx-rs/wgpu#4702
 * #4707 Add more metal keywords
   By fornwall in gfx-rs/wgpu#4707
 * #4706 [naga] remove `span` and `validate` features
   By teoxoy in gfx-rs/wgpu#4706
 * #4709 [dx12] filter out haswell iGPUs
   By teoxoy in gfx-rs/wgpu#4709
 * #4712 Fix typo in pull request template.
   By jimblandy in gfx-rs/wgpu#4712
 * #4598 Add more lints
   By daxpedda in gfx-rs/wgpu#4598
 * #4713 [naga wgsl-in] Include base when printing pointer and array types.
   By jimblandy in gfx-rs/wgpu#4713
 * #4718 [vk] check that adapters are Vulkan compliant
   By teoxoy in gfx-rs/wgpu#4718
 * #4719 [naga] Let constant evaluation of `As` preserve `Splat` expressions.
   By jimblandy in gfx-rs/wgpu#4719
 * #4725 Corrects typo in examples FrameCounter
   By cantudo in gfx-rs/wgpu#4725
 * #3626 Arcanization of wgpu core resources
   By gents83 in gfx-rs/wgpu#3626

Differential Revision: https://phabricator.services.mozilla.com/D194048

UltraBlame original commit: eb839abb42abde594497e419517260997fa1fc4d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Nov 21, 2023
…6978ae2d251. r=webgpu-reviewers,supply-chain-reviewers,ErichDonGubler,teoxoy

Note: This revision contains the arcanization work

# Changelog

 * #4702 Add `WasmNotSendSync`
   By daxpedda in gfx-rs/wgpu#4702
 * #4707 Add more metal keywords
   By fornwall in gfx-rs/wgpu#4707
 * #4706 [naga] remove `span` and `validate` features
   By teoxoy in gfx-rs/wgpu#4706
 * #4709 [dx12] filter out haswell iGPUs
   By teoxoy in gfx-rs/wgpu#4709
 * #4712 Fix typo in pull request template.
   By jimblandy in gfx-rs/wgpu#4712
 * #4598 Add more lints
   By daxpedda in gfx-rs/wgpu#4598
 * #4713 [naga wgsl-in] Include base when printing pointer and array types.
   By jimblandy in gfx-rs/wgpu#4713
 * #4718 [vk] check that adapters are Vulkan compliant
   By teoxoy in gfx-rs/wgpu#4718
 * #4719 [naga] Let constant evaluation of `As` preserve `Splat` expressions.
   By jimblandy in gfx-rs/wgpu#4719
 * #4725 Corrects typo in examples FrameCounter
   By cantudo in gfx-rs/wgpu#4725
 * #3626 Arcanization of wgpu core resources
   By gents83 in gfx-rs/wgpu#3626

Differential Revision: https://phabricator.services.mozilla.com/D194048

UltraBlame original commit: eb839abb42abde594497e419517260997fa1fc4d
@jimblandy jimblandy deleted the naga-const-eval-cast-splat branch December 13, 2023 16:31
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.

2 participants