Skip to content

fix(dx12): Fix textureNum{Levels,Layers,Samples} functions#9542

Merged
teoxoy merged 2 commits into
gfx-rs:trunkfrom
andyleiserson:num-levels
May 13, 2026
Merged

fix(dx12): Fix textureNum{Levels,Layers,Samples} functions#9542
teoxoy merged 2 commits into
gfx-rs:trunkfrom
andyleiserson:num-levels

Conversation

@andyleiserson
Copy link
Copy Markdown
Contributor

@andyleiserson andyleiserson commented May 12, 2026

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=2012288.

Updates image queries in HLSL to use correct GetDimension overloads and result swizzles. (Note that not all GetDimensions overloads in the table need to be handled, some of them are for texture types that WebGPU doesn't offer.)

I've also added textureDimensions to the test lists, but this doesn't change anything about textureDimensions behavior, I just looked at the textureDimensions failures in case they needed a similar fix.

Testing
Enables CTS tests. Also tested manually that it resolves the linked Firefox bug.

Squash or Rebase? Squash

Checklist

  • I self-reviewed and fully understand this PR.
  • WebGPU implementations built with wgpu may be affected behaviorally.
  • Validation and feature gates are in place to confine behavioral changes.
  • Tests demonstrate the validation and altered logic works.
  • CHANGELOG.md entries for the user-facing effects of this change are present.
  • The PR is minimal, and doesn't make sense to land as multiple PRs.
  • Commits are logically scoped and individually reviewable.
  • The PR description has enough context to understand the motivation and solution implemented.

@teoxoy teoxoy self-assigned this May 13, 2026
}
}
// We want `Elements`
ImageQuery::NumLayers => ("z", 3 + extra_coords),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was wondering why + extra_coords and it seems to be for NumberOfLevels of sampled textures. Looks good.

@teoxoy teoxoy merged commit 4c1ea47 into gfx-rs:trunk May 13, 2026
94 of 95 checks passed
@andyleiserson andyleiserson deleted the num-levels branch May 13, 2026 16:03
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