Revert out-of-scope DxilGenerationPass changes from #8274#8321
Merged
alsepkow merged 1 commit intomicrosoft:mainfrom Apr 1, 2026
Merged
Conversation
Reverts the DxilGenerationPass ByteAddressBuffer scalar store fix from PR microsoft#8274 — it was out of scope and incomplete (sext fallback is wrong for min16uint). Scalar ByteAddressBuffer template store widening should be handled during CodeGen where signedness info is still available. Removes scalar load/store tests from min_precision_raw_load_store.hlsl since scalar ByteAddressBuffer::Store<min16int>() hits a pre-existing crash in TranslateMinPrecisionRawBuffer (cast<StructType> on non-struct resource type). Test now covers vector loads/stores only, which is the scope of the original fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tex3d
approved these changes
Apr 1, 2026
alsepkow
added a commit
to alsepkow/DirectXShaderCompiler
that referenced
this pull request
Apr 14, 2026
…icrosoft#8321) ## Summary Reverts the `DxilGenerationPass` ByteAddressBuffer scalar store changes and removes scalar store tests that were included in PR microsoft#8274. These changes were out of scope for the vector load/store fix and, on further discussion, were concluded to be incomplete. Follow-up issue for the proper fix: microsoft#8322 ## What changed - **DxilGenerationPass.cpp**: Reverted the ByteAddressBuffer fallback path added in `ReplaceMinPrecisionRawBufferStoreByType`. The `sext` fallback was wrong for `min16uint` (loses signedness), and the fix belongs in CodeGen where signedness info is still available. - **min_precision_raw_load_store.hlsl**: Removed scalar load/store tests. Scalar `ByteAddressBuffer::Store<min16int>()` hits a pre-existing crash in `TranslateMinPrecisionRawBuffer` (`cast<StructType>` on ByteAddressBuffer's `i32` inner element). Test now covers vector loads/stores only, which is the scope of the original fix. ## Context The original PR microsoft#8274 correctly fixed `RawBufferVectorLoad/Store` to widen min precision types to 32-bit. However, it also added a ByteAddressBuffer scalar store fix in `DxilGenerationPass` that: 1. Crept outside the scope of the vector load/store fix 2. Was incomplete — the `sext` fallback is wrong for unsigned types (`min16uint`) 3. Should instead be handled during Clang CodeGen, where signedness information is available Scalar ByteAddressBuffer template store widening for min precision types is a separate pre-existing issue that needs a proper fix in CodeGen. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reverts the
DxilGenerationPassByteAddressBuffer scalar store changes and removes scalar store tests that were included in PR #8274. These changes were out of scope for the vector load/store fix and, on further discussion, were concluded to be incomplete.Follow-up issue for the proper fix: #8322
What changed
ReplaceMinPrecisionRawBufferStoreByType. Thesextfallback was wrong formin16uint(loses signedness), and the fix belongs in CodeGen where signedness info is still available.ByteAddressBuffer::Store<min16int>()hits a pre-existing crash inTranslateMinPrecisionRawBuffer(cast<StructType>on ByteAddressBuffer'si32inner element). Test now covers vector loads/stores only, which is the scope of the original fix.Context
The original PR #8274 correctly fixed
RawBufferVectorLoad/Storeto widen min precision types to 32-bit. However, it also added a ByteAddressBuffer scalar store fix inDxilGenerationPassthat:sextfallback is wrong for unsigned types (min16uint)Scalar ByteAddressBuffer template store widening for min precision types is a separate pre-existing issue that needs a proper fix in CodeGen.