Skip to content

Commit 0e729b6

Browse files
github-actions[bot]alsepkow
authored andcommitted
chore: autopublish 2025-10-29T01:34:29Z
1 parent 81da591 commit 0e729b6

1 file changed

Lines changed: 23 additions & 25 deletions

File tree

tools/clang/unittests/HLSLExec/LongVectors.cpp

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,16 @@ static const std::unordered_set<OpType> LoadAndStoreOpTypes = {
118118
};
119119

120120
static bool IsStructuredBufferLoadAndStoreOp(OpType Op) {
121-
switch(Op) {
122-
case OpType::LoadAndStore_RDH_SB_UAV:
123-
case OpType::LoadAndStore_RDH_SB_SRV:
124-
case OpType::LoadAndStore_DT_SB_UAV:
125-
case OpType::LoadAndStore_DT_SB_SRV:
126-
case OpType::LoadAndStore_RD_SB_UAV:
127-
case OpType::LoadAndStore_RD_SB_SRV:
128-
return true;
129-
default:
130-
return false;
121+
switch (Op) {
122+
case OpType::LoadAndStore_RDH_SB_UAV:
123+
case OpType::LoadAndStore_RDH_SB_SRV:
124+
case OpType::LoadAndStore_DT_SB_UAV:
125+
case OpType::LoadAndStore_DT_SB_SRV:
126+
case OpType::LoadAndStore_RD_SB_UAV:
127+
case OpType::LoadAndStore_RD_SB_SRV:
128+
return true;
129+
default:
130+
return false;
131131
}
132132
}
133133

@@ -491,29 +491,28 @@ void configureLoadAndStoreShaderOp(const Operation &Operation,
491491
StructureByteStride = (StructureByteStride + 3) & ~3; // Must align to 4 bytes
492492

493493
if (!ShaderOp->DescriptorHeaps.empty()) {
494-
DXASSERT(ShaderOp->DescriptorHeaps.size() == 1, ""
495-
"Programmer error: Expecting a single descriptor heap for LoadAndStore tests");
494+
DXASSERT(ShaderOp->DescriptorHeaps.size() == 1,
495+
""
496+
"Programmer error: Expecting a single descriptor heap for "
497+
"LoadAndStore tests");
496498

497499
for (auto &D : ShaderOp->DescriptorHeaps[0].Descriptors) {
498-
if (_stricmp(D.Kind, "UAV") == 0){
499-
if(IsSB) {
500+
if (_stricmp(D.Kind, "UAV") == 0) {
501+
if (IsSB) {
500502
D.UavDesc.Format = DXGI_FORMAT_UNKNOWN;
501503
D.UavDesc.Buffer.NumElements = 1; // One StructuredBuffer
502504
D.UavDesc.Buffer.StructureByteStride = StructureByteStride;
503-
}
504-
else {
505+
} else {
505506
D.UavDesc.Format = DXGI_FORMAT_R32_TYPELESS;
506507
D.UavDesc.Buffer.NumElements = Num32BitElements;
507508
D.UavDesc.Buffer.Flags = D3D12_BUFFER_UAV_FLAG_RAW;
508509
}
509-
}
510-
else if (_stricmp(D.Kind, "SRV") == 0) {
511-
if(IsSB) {
510+
} else if (_stricmp(D.Kind, "SRV") == 0) {
511+
if (IsSB) {
512512
D.SrvDesc.Format = DXGI_FORMAT_UNKNOWN;
513513
D.SrvDesc.Buffer.NumElements = 1; // One StructuredBuffer
514514
D.SrvDesc.Buffer.StructureByteStride = StructureByteStride;
515-
}
516-
else {
515+
} else {
517516
D.SrvDesc.Format = DXGI_FORMAT_R32_TYPELESS;
518517
D.SrvDesc.Buffer.NumElements = Num32BitElements;
519518
D.SrvDesc.Buffer.Flags = D3D12_BUFFER_SRV_FLAG_RAW;
@@ -1206,15 +1205,14 @@ void dispatchTest(ID3D12Device *D3DDevice, bool VerboseLogging,
12061205
std::vector<size_t> InputVectorSizes;
12071206
if (OverrideInputSize)
12081207
InputVectorSizes.push_back(OverrideInputSize);
1209-
else
1210-
{
1208+
else {
12111209
InputVectorSizes = {3, 5, 16, 17, 35, 100, 256};
12121210
size_t MaxInputSize = 1024;
1213-
if(IsStructuredBufferLoadAndStoreOp(OP))
1211+
if (IsStructuredBufferLoadAndStoreOp(OP))
12141212
// StructuredBuffers are capped at 2048 bytes.
12151213
MaxInputSize = 2048 / sizeof(T);
12161214

1217-
if(InputVectorSizes.back() < MaxInputSize)
1215+
if (InputVectorSizes.back() < MaxInputSize)
12181216
InputVectorSizes.push_back(MaxInputSize);
12191217
}
12201218

0 commit comments

Comments
 (0)