Skip to content

Commit 99cd065

Browse files
committed
Properly format this time
1 parent 08881e5 commit 99cd065

File tree

5 files changed

+30
-34
lines changed

5 files changed

+30
-34
lines changed

lib/DXIL/DxilMetadataHelper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,9 +1625,9 @@ MDTuple *DxilMDHelper::EmitDxilEntryProperties(uint64_t rawShaderFlag,
16251625
MDVals.emplace_back(MDNode::get(m_Ctx, WaveSizeVal));
16261626
}
16271627

1628-
MDVals.emplace_back(Uint32ToConstMD(DxilMDHelper::kDxilMaxGroupSharedMemTag));
16291628
MDVals.emplace_back(
1630-
Uint32ToConstMD(props.groupSharedLimitBytes));
1629+
Uint32ToConstMD(DxilMDHelper::kDxilMaxGroupSharedMemTag));
1630+
MDVals.emplace_back(Uint32ToConstMD(props.groupSharedLimitBytes));
16311631
} break;
16321632
// Geometry shader.
16331633
case DXIL::ShaderKind::Geometry: {

lib/DXIL/DxilModule.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,13 @@ unsigned DxilModule::GetNumThreads(unsigned idx) const {
413413
}
414414

415415
unsigned DxilModule::GetGroupSharedLimit() const {
416-
DXASSERT(m_DxilEntryPropsMap.size() == 1 &&
417-
(m_pSM->IsCS() || m_pSM->IsMS() || m_pSM->IsAS()),
416+
DXASSERT(m_DxilEntryPropsMap.size() == 1 &&
417+
(m_pSM->IsCS() || m_pSM->IsMS() || m_pSM->IsAS()),
418418
"only works for CS/MS/AS profiles");
419419
const DxilFunctionProps &props = m_DxilEntryPropsMap.begin()->second->props;
420420
DXASSERT_NOMSG(m_pSM->GetKind() == props.shaderKind);
421421
return props.groupSharedLimitBytes;
422-
}
423-
422+
}
424423

425424
DxilWaveSize &DxilModule::GetWaveSize() {
426425
return const_cast<DxilWaveSize &>(

lib/DxilContainer/DxilPipelineStateValidation.cpp

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -306,18 +306,17 @@ void hlsl::SetShaderProps(PSVRuntimeInfo2 *pInfo2, const DxilModule &DM) {
306306
}
307307

308308
void hlsl::SetShaderProps(PSVRuntimeInfo4 *pInfo4, const DxilModule &DM) {
309-
assert(pInfo4);
310-
const ShaderModel* SM = DM.GetShaderModel();
311-
switch (SM->GetKind())
312-
{
313-
case ShaderModel::Kind::Compute:
314-
case ShaderModel::Kind::Mesh:
315-
case ShaderModel::Kind::Amplification:
316-
pInfo4->GroupSharedLimit = DM.GetGroupSharedLimit();
317-
break;
318-
default:
319-
break;
320-
}
309+
assert(pInfo4);
310+
const ShaderModel *SM = DM.GetShaderModel();
311+
switch (SM->GetKind()) {
312+
case ShaderModel::Kind::Compute:
313+
case ShaderModel::Kind::Mesh:
314+
case ShaderModel::Kind::Amplification:
315+
pInfo4->GroupSharedLimit = DM.GetGroupSharedLimit();
316+
break;
317+
default:
318+
break;
319+
}
321320
}
322321

323322
void PSVResourceBindInfo0::Print(raw_ostream &OS) const {
@@ -825,8 +824,7 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0,
825824
<< pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n";
826825
}
827826
if (pInfo4) {
828-
OS << Comment << " GroupSharedLimit="
829-
<< pInfo4->GroupSharedLimit << "\n";
827+
OS << Comment << " GroupSharedLimit=" << pInfo4->GroupSharedLimit << "\n";
830828
}
831829
break;
832830
case PSVShaderKind::Amplification:
@@ -836,8 +834,7 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0,
836834
<< pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n";
837835
}
838836
if (pInfo4) {
839-
OS << Comment << " GroupSharedLimit="
840-
<< pInfo4->GroupSharedLimit << "\n";
837+
OS << Comment << " GroupSharedLimit=" << pInfo4->GroupSharedLimit << "\n";
841838
}
842839
break;
843840
case PSVShaderKind::Mesh:
@@ -866,8 +863,7 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0,
866863
<< pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n";
867864
}
868865
if (pInfo4) {
869-
OS << Comment << " GroupSharedLimit="
870-
<< pInfo4->GroupSharedLimit << "\n";
866+
OS << Comment << " GroupSharedLimit=" << pInfo4->GroupSharedLimit << "\n";
871867
}
872868
break;
873869
case PSVShaderKind::Library:

lib/DxilValidation/DxilValidation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3928,7 +3928,7 @@ static void ValidateGlobalVariables(ValidationContext &ValCtx) {
39283928
if (EntryProps.props.IsCS()) {
39293929
unsigned SpecifiedTGSMSize = EntryProps.props.groupSharedLimitBytes;
39303930
if (SpecifiedTGSMSize > 0) {
3931-
MaxSize = SpecifiedTGSMSize;
3931+
MaxSize = SpecifiedTGSMSize;
39323932
}
39333933
}
39343934
}

tools/clang/lib/CodeGen/CGHLSLMS.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,8 @@ void CGMSHLSLRuntime::AddHLSLFunctionInfo(Function *F, const FunctionDecl *FD) {
16461646
}
16471647
}
16481648

1649-
if (const HLSLGroupSharedLimitAttr *Attr = FD->getAttr<HLSLGroupSharedLimitAttr>()) {
1649+
if (const HLSLGroupSharedLimitAttr *Attr =
1650+
FD->getAttr<HLSLGroupSharedLimitAttr>()) {
16501651
if (isEntry && !SM->IsCS() && !SM->IsMS() && !SM->IsAS()) {
16511652
unsigned DiagID = Diags.getCustomDiagID(
16521653
DiagnosticsEngine::Error,
@@ -1658,21 +1659,21 @@ void CGMSHLSLRuntime::AddHLSLFunctionInfo(Function *F, const FunctionDecl *FD) {
16581659
// Only valid for SM6.10+
16591660
if (!SM->IsSM610Plus()) {
16601661
unsigned DiagID = Diags.getCustomDiagID(
1661-
DiagnosticsEngine::Error,
1662-
"attribute GroupSharedLimit only valid for Shader Model 6.10 and above.");
1662+
DiagnosticsEngine::Error, "attribute GroupSharedLimit only valid for "
1663+
"Shader Model 6.10 and above.");
16631664
Diags.Report(Attr->getLocation(), DiagID);
16641665
return;
16651666
}
16661667

16671668
funcProps->groupSharedLimitBytes = Attr->getLimit();
16681669
} else {
16691670
if (SM->IsMS()) { // Fallback to default limits
1670-
funcProps->groupSharedLimitBytes = DXIL::kMaxMSSMSize; // 28k For MS
1671-
} else if (SM->IsAS() || SM->IsCS()) {
1672-
funcProps->groupSharedLimitBytes = DXIL::kMaxTGSMSize; // 32k For AS/CS
1673-
} else {
1674-
funcProps->groupSharedLimitBytes = 0;
1675-
}
1671+
funcProps->groupSharedLimitBytes = DXIL::kMaxMSSMSize; // 28k For MS
1672+
} else if (SM->IsAS() || SM->IsCS()) {
1673+
funcProps->groupSharedLimitBytes = DXIL::kMaxTGSMSize; // 32k For AS/CS
1674+
} else {
1675+
funcProps->groupSharedLimitBytes = 0;
1676+
}
16761677
}
16771678

16781679
// Hull shader.

0 commit comments

Comments
 (0)