Commit 71aa195
## Summary
Reverts the `DxilGenerationPass` ByteAddressBuffer 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
- **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 #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 <[email protected]>
1 parent a529a31 commit 71aa195
2 files changed
Lines changed: 31 additions & 70 deletions
File tree
- lib/HLSL
- tools/clang/test/HLSLFileCheck/hlsl/objects/ByteAddressBuffer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
1000 | 1001 | | |
1001 | 1002 | | |
1002 | 1003 | | |
| |||
1006 | 1007 | | |
1007 | 1008 | | |
1008 | 1009 | | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
1040 | 1026 | | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
1041 | 1036 | | |
1042 | 1037 | | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | 1038 | | |
1054 | 1039 | | |
1055 | 1040 | | |
| |||
Lines changed: 1 addition & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 33 | + | |
54 | 34 | | |
55 | 35 | | |
56 | 36 | | |
57 | 37 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 38 | | |
0 commit comments