Skip to content

Commit 1ceb7d4

Browse files
committed
fix up variable naming
1 parent 94c999d commit 1ceb7d4

3 files changed

Lines changed: 90 additions & 90 deletions

File tree

tools/clang/unittests/HLSLExec/ExecutionTest.cpp

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -10623,25 +10623,25 @@ void ExecutionTest::WaveSizeRangeTest() {
1062310623
}
1062410624

1062510625
void ExecutionTest::GroupSharedLimitTest() {
10626-
WEX::TestExecution::SetVerifyOutput verifySettings(
10626+
WEX::TestExecution::SetVerifyOutput VerifySettings(
1062710627
WEX::TestExecution::VerifyOutputSettings::LogOnlyFailures);
1062810628

10629-
CComPtr<ID3D12Device> pDevice;
10629+
CComPtr<ID3D12Device> Device;
1063010630
// GroupSharedLimit requires SM 6.10 (DXIL 1.10).
10631-
if (!createDevice(&pDevice, D3D_SHADER_MODEL_6_10,
10631+
if (!createDevice(&Device, D3D_SHADER_MODEL_6_10,
1063210632
/*skipUnsupported*/ false)) {
1063310633
return;
1063410634
}
1063510635

10636-
UINT maxGSMCS = getMaxGroupSharedMemoryCS(pDevice);
10637-
LogCommentFmt(L"Device MaxGroupSharedMemoryPerGroupCS: %u bytes", maxGSMCS);
10636+
UINT MaxGSMCS = getMaxGroupSharedMemoryCS(Device);
10637+
LogCommentFmt(L"Device MaxGroupSharedMemoryPerGroupCS: %u bytes", MaxGSMCS);
1063810638

1063910639
// Read shader config
10640-
CComPtr<IStream> pStream;
10640+
CComPtr<IStream> Stream;
1064110641
std::shared_ptr<st::ShaderOpSet> ShaderOpSet =
1064210642
std::make_shared<st::ShaderOpSet>();
10643-
readHlslDataIntoNewStream(L"ShaderOpArith.xml", &pStream, m_support);
10644-
st::ParseShaderOpSetFromStream(pStream, ShaderOpSet.get());
10643+
readHlslDataIntoNewStream(L"ShaderOpArith.xml", &Stream, m_support);
10644+
st::ParseShaderOpSetFromStream(Stream, ShaderOpSet.get());
1064510645

1064610646
// Test 1: GroupSharedLimit that is >= usage should succeed.
1064710647
// Use 4096 DWORDs (16384 bytes) of TGSM with a limit of 16384 bytes.
@@ -10654,7 +10654,7 @@ void ExecutionTest::GroupSharedLimitTest() {
1065410654

1065510655
// All threads cooperatively fill g_shared, then thread 0 copies
1065610656
// the entire contents to the output buffer for verification.
10657-
static const char pShader[] =
10657+
static const char Shader[] =
1065810658
R"(
1065910659
#define GSM_DWORDS 4096
1066010660
#define NUM_THREADS 64
@@ -10675,33 +10675,33 @@ void ExecutionTest::GroupSharedLimitTest() {
1067510675
}
1067610676
})";
1067710677

10678-
std::shared_ptr<st::ShaderOpTestResult> test =
10678+
std::shared_ptr<st::ShaderOpTestResult> Test =
1067910679
st::RunShaderOpTestAfterParse(
10680-
pDevice, m_support, "GroupSharedLimitTest",
10681-
[&](LPCSTR Name, std::vector<BYTE> &Data, st::ShaderOp *pShaderOp) {
10680+
Device, m_support, "GroupSharedLimitTest",
10681+
[&](LPCSTR Name, std::vector<BYTE> &Data, st::ShaderOp *Op) {
1068210682
VERIFY_IS_TRUE((0 == strncmp(Name, "UAVBuffer0", 10)));
10683-
pShaderOp->Shaders.at(0).Text = pShader;
10683+
Op->Shaders.at(0).Text = Shader;
1068410684
Data.resize(sizeof(uint32_t) * GSM_DWORDS);
1068510685
memset(Data.data(), 0, Data.size());
1068610686
},
1068710687
ShaderOpSet);
1068810688

10689-
MappedData dataUav;
10690-
test->Test->GetReadBackData("UAVBuffer0", &dataUav);
10691-
uint32_t *pOutData = (uint32_t *)dataUav.data();
10689+
MappedData DataUav;
10690+
Test->Test->GetReadBackData("UAVBuffer0", &DataUav);
10691+
uint32_t *OutData = (uint32_t *)DataUav.data();
1069210692

10693-
for (UINT i = 0; i < GSM_DWORDS; i++) {
10694-
VERIFY_ARE_EQUAL(pOutData[i], i);
10693+
for (UINT I = 0; I < GSM_DWORDS; I++) {
10694+
VERIFY_ARE_EQUAL(OutData[I], I);
1069510695
}
1069610696
LogCommentFmt(L"Test 1 passed: GroupSharedLimit == usage succeeded.");
1069710697
}
1069810698

1069910699
// Test 2: GroupSharedLimit > usage (raising the ceiling above default).
1070010700
// Use 9216 DWORDs (36864 bytes) of TGSM, which exceeds the default 32768,
1070110701
// but set limit to 36864 so it should succeed.
10702-
if (maxGSMCS < 36864) {
10702+
if (MaxGSMCS < 36864) {
1070310703
LogCommentFmt(L"Test 2 skipped: device max GSM (%u) < 36864 bytes",
10704-
maxGSMCS);
10704+
MaxGSMCS);
1070510705
} else {
1070610706
static const UINT GSM_DWORDS = 9216;
1070710707
static const UINT NUM_THREADS = 64;
@@ -10710,7 +10710,7 @@ void ExecutionTest::GroupSharedLimitTest() {
1071010710
L"both above default (32768). "
1071110711
L"Shader should compile and execute successfully.");
1071210712

10713-
static const char pShader[] =
10713+
static const char Shader[] =
1071410714
R"(
1071510715
#define GSM_DWORDS 9216
1071610716
#define NUM_THREADS 64
@@ -10729,23 +10729,23 @@ void ExecutionTest::GroupSharedLimitTest() {
1072910729
}
1073010730
})";
1073110731

10732-
std::shared_ptr<st::ShaderOpTestResult> test =
10732+
std::shared_ptr<st::ShaderOpTestResult> Test =
1073310733
st::RunShaderOpTestAfterParse(
10734-
pDevice, m_support, "GroupSharedLimitTest",
10735-
[&](LPCSTR Name, std::vector<BYTE> &Data, st::ShaderOp *pShaderOp) {
10734+
Device, m_support, "GroupSharedLimitTest",
10735+
[&](LPCSTR Name, std::vector<BYTE> &Data, st::ShaderOp *Op) {
1073610736
VERIFY_IS_TRUE((0 == strncmp(Name, "UAVBuffer0", 10)));
10737-
pShaderOp->Shaders.at(0).Text = pShader;
10737+
Op->Shaders.at(0).Text = Shader;
1073810738
Data.resize(sizeof(uint32_t) * GSM_DWORDS);
1073910739
memset(Data.data(), 0, Data.size());
1074010740
},
1074110741
ShaderOpSet);
1074210742

10743-
MappedData dataUav;
10744-
test->Test->GetReadBackData("UAVBuffer0", &dataUav);
10745-
uint32_t *pOutData = (uint32_t *)dataUav.data();
10743+
MappedData DataUav;
10744+
Test->Test->GetReadBackData("UAVBuffer0", &DataUav);
10745+
uint32_t *OutData = (uint32_t *)DataUav.data();
1074610746

10747-
for (UINT i = 0; i < GSM_DWORDS; i++) {
10748-
VERIFY_ARE_EQUAL(pOutData[i], i);
10747+
for (UINT I = 0; I < GSM_DWORDS; I++) {
10748+
VERIFY_ARE_EQUAL(OutData[I], I);
1074910749
}
1075010750
LogCommentFmt(L"Test 2 passed: GroupSharedLimit > default succeeded.");
1075110751
}
@@ -10759,7 +10759,7 @@ void ExecutionTest::GroupSharedLimitTest() {
1075910759
LogCommentFmt(L"Test 3: No GroupSharedLimit, usage (32768 bytes) <= "
1076010760
L"default limit. Shader should succeed.");
1076110761

10762-
static const char pShader[] =
10762+
static const char Shader[] =
1076310763
R"(
1076410764
#define GSM_DWORDS 8192
1076510765
#define NUM_THREADS 64
@@ -10777,52 +10777,52 @@ void ExecutionTest::GroupSharedLimitTest() {
1077710777
}
1077810778
})";
1077910779

10780-
std::shared_ptr<st::ShaderOpTestResult> test =
10780+
std::shared_ptr<st::ShaderOpTestResult> Test =
1078110781
st::RunShaderOpTestAfterParse(
10782-
pDevice, m_support, "GroupSharedLimitTest",
10783-
[&](LPCSTR Name, std::vector<BYTE> &Data, st::ShaderOp *pShaderOp) {
10782+
Device, m_support, "GroupSharedLimitTest",
10783+
[&](LPCSTR Name, std::vector<BYTE> &Data, st::ShaderOp *Op) {
1078410784
VERIFY_IS_TRUE((0 == strncmp(Name, "UAVBuffer0", 10)));
10785-
pShaderOp->Shaders.at(0).Text = pShader;
10785+
Op->Shaders.at(0).Text = Shader;
1078610786
Data.resize(sizeof(uint32_t) * GSM_DWORDS);
1078710787
memset(Data.data(), 0, Data.size());
1078810788
},
1078910789
ShaderOpSet);
1079010790

10791-
MappedData dataUav;
10792-
test->Test->GetReadBackData("UAVBuffer0", &dataUav);
10793-
uint32_t *pOutData = (uint32_t *)dataUav.data();
10791+
MappedData DataUav;
10792+
Test->Test->GetReadBackData("UAVBuffer0", &DataUav);
10793+
uint32_t *OutData = (uint32_t *)DataUav.data();
1079410794

10795-
for (UINT i = 0; i < GSM_DWORDS; i++) {
10796-
VERIFY_ARE_EQUAL(pOutData[i], i);
10795+
for (UINT I = 0; I < GSM_DWORDS; I++) {
10796+
VERIFY_ARE_EQUAL(OutData[I], I);
1079710797
}
1079810798
LogCommentFmt(L"Test 3 passed: No attribute with default usage succeeded.");
1079910799
}
1080010800
}
1080110801

1080210802
void ExecutionTest::GroupSharedLimitASTest() {
10803-
WEX::TestExecution::SetVerifyOutput verifySettings(
10803+
WEX::TestExecution::SetVerifyOutput VerifySettings(
1080410804
WEX::TestExecution::VerifyOutputSettings::LogOnlyFailures);
1080510805

10806-
CComPtr<ID3D12Device> pDevice;
10807-
if (!createDevice(&pDevice, D3D_SHADER_MODEL_6_10,
10806+
CComPtr<ID3D12Device> Device;
10807+
if (!createDevice(&Device, D3D_SHADER_MODEL_6_10,
1080810808
/*skipUnsupported*/ false)) {
1080910809
return;
1081010810
}
1081110811

10812-
if (!doesDeviceSupportMeshShaders(pDevice)) {
10812+
if (!doesDeviceSupportMeshShaders(Device)) {
1081310813
LogCommentFmt(L"Device does not support mesh shaders, skipping.");
1081410814
WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped);
1081510815
return;
1081610816
}
1081710817

10818-
UINT maxGSMAS = getMaxGroupSharedMemoryAS(pDevice);
10819-
LogCommentFmt(L"Device MaxGroupSharedMemoryPerGroupAS: %u bytes", maxGSMAS);
10818+
UINT MaxGSMAS = getMaxGroupSharedMemoryAS(Device);
10819+
LogCommentFmt(L"Device MaxGroupSharedMemoryPerGroupAS: %u bytes", MaxGSMAS);
1082010820

10821-
CComPtr<IStream> pStream;
10821+
CComPtr<IStream> Stream;
1082210822
std::shared_ptr<st::ShaderOpSet> ShaderOpSet =
1082310823
std::make_shared<st::ShaderOpSet>();
10824-
readHlslDataIntoNewStream(L"ShaderOpArith.xml", &pStream, m_support);
10825-
st::ParseShaderOpSetFromStream(pStream, ShaderOpSet.get());
10824+
readHlslDataIntoNewStream(L"ShaderOpArith.xml", &Stream, m_support);
10825+
st::ParseShaderOpSetFromStream(Stream, ShaderOpSet.get());
1082610826

1082710827
// Test: AS shader fills groupshared memory and writes to UAV.
1082810828
{
@@ -10831,7 +10831,7 @@ void ExecutionTest::GroupSharedLimitASTest() {
1083110831
LogCommentFmt(L"AS Test: GroupSharedLimit == usage (16384 bytes). "
1083210832
L"Amplification shader should compile and execute.");
1083310833

10834-
static const char pShader[] =
10834+
static const char Shader[] =
1083510835
R"(
1083610836
struct Payload { uint dummy; };
1083710837
@@ -10869,53 +10869,53 @@ void ExecutionTest::GroupSharedLimitASTest() {
1086910869
float4 PSMain() : SV_Target { return float4(0,0,0,0); }
1087010870
)";
1087110871

10872-
std::shared_ptr<st::ShaderOpTestResult> test =
10872+
std::shared_ptr<st::ShaderOpTestResult> Test =
1087310873
st::RunShaderOpTestAfterParse(
10874-
pDevice, m_support, "GroupSharedLimitASTest",
10875-
[&](LPCSTR Name, std::vector<BYTE> &Data, st::ShaderOp *pShaderOp) {
10874+
Device, m_support, "GroupSharedLimitASTest",
10875+
[&](LPCSTR Name, std::vector<BYTE> &Data, st::ShaderOp *Op) {
1087610876
VERIFY_IS_TRUE((0 == strncmp(Name, "UAVBuffer0", 10)));
10877-
pShaderOp->Shaders.at(0).Text = pShader;
10877+
Op->Shaders.at(0).Text = Shader;
1087810878
Data.resize(sizeof(uint32_t) * GSM_DWORDS);
1087910879
memset(Data.data(), 0, Data.size());
1088010880
},
1088110881
ShaderOpSet);
1088210882

10883-
MappedData dataUav;
10884-
test->Test->GetReadBackData("UAVBuffer0", &dataUav);
10885-
uint32_t *pOutData = (uint32_t *)dataUav.data();
10883+
MappedData DataUav;
10884+
Test->Test->GetReadBackData("UAVBuffer0", &DataUav);
10885+
uint32_t *OutData = (uint32_t *)DataUav.data();
1088610886

10887-
for (UINT i = 0; i < GSM_DWORDS; i++) {
10888-
VERIFY_ARE_EQUAL(pOutData[i], i);
10887+
for (UINT I = 0; I < GSM_DWORDS; I++) {
10888+
VERIFY_ARE_EQUAL(OutData[I], I);
1088910889
}
1089010890
LogCommentFmt(
1089110891
L"AS Test passed: GroupSharedLimit in amplification shader succeeded.");
1089210892
}
1089310893
}
1089410894

1089510895
void ExecutionTest::GroupSharedLimitMSTest() {
10896-
WEX::TestExecution::SetVerifyOutput verifySettings(
10896+
WEX::TestExecution::SetVerifyOutput VerifySettings(
1089710897
WEX::TestExecution::VerifyOutputSettings::LogOnlyFailures);
1089810898

10899-
CComPtr<ID3D12Device> pDevice;
10900-
if (!createDevice(&pDevice, D3D_SHADER_MODEL_6_10,
10899+
CComPtr<ID3D12Device> Device;
10900+
if (!createDevice(&Device, D3D_SHADER_MODEL_6_10,
1090110901
/*skipUnsupported*/ false)) {
1090210902
return;
1090310903
}
1090410904

10905-
if (!doesDeviceSupportMeshShaders(pDevice)) {
10905+
if (!doesDeviceSupportMeshShaders(Device)) {
1090610906
LogCommentFmt(L"Device does not support mesh shaders, skipping.");
1090710907
WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped);
1090810908
return;
1090910909
}
1091010910

10911-
UINT maxGSMMS = getMaxGroupSharedMemoryMS(pDevice);
10912-
LogCommentFmt(L"Device MaxGroupSharedMemoryPerGroupMS: %u bytes", maxGSMMS);
10911+
UINT MaxGSMMS = getMaxGroupSharedMemoryMS(Device);
10912+
LogCommentFmt(L"Device MaxGroupSharedMemoryPerGroupMS: %u bytes", MaxGSMMS);
1091310913

10914-
CComPtr<IStream> pStream;
10914+
CComPtr<IStream> Stream;
1091510915
std::shared_ptr<st::ShaderOpSet> ShaderOpSet =
1091610916
std::make_shared<st::ShaderOpSet>();
10917-
readHlslDataIntoNewStream(L"ShaderOpArith.xml", &pStream, m_support);
10918-
st::ParseShaderOpSetFromStream(pStream, ShaderOpSet.get());
10917+
readHlslDataIntoNewStream(L"ShaderOpArith.xml", &Stream, m_support);
10918+
st::ParseShaderOpSetFromStream(Stream, ShaderOpSet.get());
1091910919

1092010920
// Test: MS shader fills groupshared memory and writes to UAV.
1092110921
{
@@ -10924,7 +10924,7 @@ void ExecutionTest::GroupSharedLimitMSTest() {
1092410924
LogCommentFmt(L"MS Test: GroupSharedLimit == usage (16384 bytes). "
1092510925
L"Mesh shader should compile and execute.");
1092610926

10927-
static const char pShader[] =
10927+
static const char Shader[] =
1092810928
R"(
1092910929
#define GSM_DWORDS 4096
1093010930
groupshared uint g_shared[GSM_DWORDS]; // 16384 bytes
@@ -10953,23 +10953,23 @@ void ExecutionTest::GroupSharedLimitMSTest() {
1095310953
float4 PSMain() : SV_Target { return float4(0,0,0,0); }
1095410954
)";
1095510955

10956-
std::shared_ptr<st::ShaderOpTestResult> test =
10956+
std::shared_ptr<st::ShaderOpTestResult> Test =
1095710957
st::RunShaderOpTestAfterParse(
10958-
pDevice, m_support, "GroupSharedLimitMSTest",
10959-
[&](LPCSTR Name, std::vector<BYTE> &Data, st::ShaderOp *pShaderOp) {
10958+
Device, m_support, "GroupSharedLimitMSTest",
10959+
[&](LPCSTR Name, std::vector<BYTE> &Data, st::ShaderOp *Op) {
1096010960
VERIFY_IS_TRUE((0 == strncmp(Name, "UAVBuffer0", 10)));
10961-
pShaderOp->Shaders.at(0).Text = pShader;
10961+
Op->Shaders.at(0).Text = Shader;
1096210962
Data.resize(sizeof(uint32_t) * GSM_DWORDS);
1096310963
memset(Data.data(), 0, Data.size());
1096410964
},
1096510965
ShaderOpSet);
1096610966

10967-
MappedData dataUav;
10968-
test->Test->GetReadBackData("UAVBuffer0", &dataUav);
10969-
uint32_t *pOutData = (uint32_t *)dataUav.data();
10967+
MappedData DataUav;
10968+
Test->Test->GetReadBackData("UAVBuffer0", &DataUav);
10969+
uint32_t *OutData = (uint32_t *)DataUav.data();
1097010970

10971-
for (UINT i = 0; i < GSM_DWORDS; i++) {
10972-
VERIFY_ARE_EQUAL(pOutData[i], i);
10971+
for (UINT I = 0; I < GSM_DWORDS; I++) {
10972+
VERIFY_ARE_EQUAL(OutData[I], I);
1097310973
}
1097410974
LogCommentFmt(
1097510975
L"MS Test passed: GroupSharedLimit in mesh shader succeeded.");

tools/clang/unittests/HLSLExec/HlslExecTestUtils.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -616,26 +616,26 @@ bool isFallbackPathEnabled() {
616616
return EnableFallbackValue != 0;
617617
}
618618

619-
UINT getMaxGroupSharedMemoryCS(ID3D12Device *pDevice) {
619+
UINT getMaxGroupSharedMemoryCS(ID3D12Device *Device) {
620620
D3D12_FEATURE_DATA_D3D12_OPTIONS_PREVIEW O = {};
621-
if (FAILED(pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS_PREVIEW,
622-
&O, sizeof(O))))
621+
if (FAILED(Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS_PREVIEW,
622+
&O, sizeof(O))))
623623
return 32768; // Default minimum per spec
624624
return O.MaxGroupSharedMemoryPerGroupCS;
625625
}
626626

627-
UINT getMaxGroupSharedMemoryAS(ID3D12Device *pDevice) {
627+
UINT getMaxGroupSharedMemoryAS(ID3D12Device *Device) {
628628
D3D12_FEATURE_DATA_D3D12_OPTIONS_PREVIEW O = {};
629-
if (FAILED(pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS_PREVIEW,
630-
&O, sizeof(O))))
629+
if (FAILED(Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS_PREVIEW,
630+
&O, sizeof(O))))
631631
return 32768; // Default minimum per spec
632632
return O.MaxGroupSharedMemoryPerGroupAS;
633633
}
634634

635-
UINT getMaxGroupSharedMemoryMS(ID3D12Device *pDevice) {
635+
UINT getMaxGroupSharedMemoryMS(ID3D12Device *Device) {
636636
D3D12_FEATURE_DATA_D3D12_OPTIONS_PREVIEW O = {};
637-
if (FAILED(pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS_PREVIEW,
638-
&O, sizeof(O))))
637+
if (FAILED(Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS_PREVIEW,
638+
&O, sizeof(O))))
639639
return 28672; // Default minimum per spec (28 KB for mesh)
640640
return O.MaxGroupSharedMemoryPerGroupMS;
641641
}

tools/clang/unittests/HLSLExec/HlslExecTestUtils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ bool doesDeviceSupportEnhancedBarriers(ID3D12Device *pDevice);
7070
bool doesDeviceSupportRelaxedFormatCasting(ID3D12Device *pDevice);
7171
bool isFallbackPathEnabled();
7272

73-
UINT getMaxGroupSharedMemoryCS(ID3D12Device *pDevice);
74-
UINT getMaxGroupSharedMemoryAS(ID3D12Device *pDevice);
75-
UINT getMaxGroupSharedMemoryMS(ID3D12Device *pDevice);
73+
UINT getMaxGroupSharedMemoryCS(ID3D12Device *Device);
74+
UINT getMaxGroupSharedMemoryAS(ID3D12Device *Device);
75+
UINT getMaxGroupSharedMemoryMS(ID3D12Device *Device);
7676

7777
#endif // HLSLEXECTESTUTILS_H

0 commit comments

Comments
 (0)