-
Notifications
You must be signed in to change notification settings - Fork 812
Implementation of GroupSharedLimit to allow increased GroupSharedMemory #7871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
795cf94
214553d
9b2e89d
1084671
87f85b4
08881e5
99cd065
4da0fb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -305,6 +305,21 @@ void hlsl::SetShaderProps(PSVRuntimeInfo2 *pInfo2, const DxilModule &DM) { | |
| } | ||
| } | ||
|
|
||
| void hlsl::SetShaderProps(PSVRuntimeInfo4 *pInfo4, const DxilModule &DM) { | ||
| assert(pInfo4); | ||
| const ShaderModel* SM = DM.GetShaderModel(); | ||
| switch (SM->GetKind()) | ||
| { | ||
| case ShaderModel::Kind::Compute: | ||
| case ShaderModel::Kind::Mesh: | ||
| case ShaderModel::Kind::Amplification: | ||
| pInfo4->GroupSharedMemoryLimit = DM.GetGroupSharedLimit(); | ||
| break; | ||
| default: | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| void PSVResourceBindInfo0::Print(raw_ostream &OS) const { | ||
| OS << "PSVResourceBindInfo:\n"; | ||
| OS << " Space: " << Space << "\n"; | ||
|
|
@@ -584,8 +599,9 @@ void PSVDependencyTable::Print(raw_ostream &OS, const char *InputSetName, | |
|
|
||
| void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, | ||
| PSVRuntimeInfo1 *pInfo1, PSVRuntimeInfo2 *pInfo2, | ||
| PSVRuntimeInfo3 *pInfo3, uint8_t ShaderKind, | ||
| const char *EntryName, const char *Comment) { | ||
| PSVRuntimeInfo3 *pInfo3, PSVRuntimeInfo4 *pInfo4, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO in this case following the |
||
| uint8_t ShaderKind, const char *EntryName, | ||
| const char *Comment) { | ||
| if (pInfo1 && pInfo1->ShaderStage != ShaderKind) | ||
| ShaderKind = pInfo1->ShaderStage; | ||
| OS << Comment << "PSVRuntimeInfo:\n"; | ||
|
|
@@ -808,13 +824,21 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, | |
| OS << Comment << " NumThreads=(" << pInfo2->NumThreadsX << "," | ||
| << pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n"; | ||
| } | ||
| if (pInfo4) { | ||
| OS << Comment << " GroupSharedMemoryLimit=" | ||
| << pInfo4->GroupSharedMemoryLimit << "\n"; | ||
| } | ||
| break; | ||
| case PSVShaderKind::Amplification: | ||
| OS << Comment << " Amplification Shader\n"; | ||
| if (pInfo2) { | ||
| OS << Comment << " NumThreads=(" << pInfo2->NumThreadsX << "," | ||
| << pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n"; | ||
| } | ||
| if (pInfo4) { | ||
| OS << Comment << " GroupSharedMemoryLimit=" | ||
| << pInfo4->GroupSharedMemoryLimit << "\n"; | ||
| } | ||
| break; | ||
| case PSVShaderKind::Mesh: | ||
| OS << Comment << " Mesh Shader\n"; | ||
|
|
@@ -841,6 +865,10 @@ void hlsl::PrintPSVRuntimeInfo(llvm::raw_ostream &OS, PSVRuntimeInfo0 *pInfo0, | |
| OS << Comment << " NumThreads=(" << pInfo2->NumThreadsX << "," | ||
| << pInfo2->NumThreadsY << "," << pInfo2->NumThreadsZ << ")\n"; | ||
| } | ||
| if (pInfo4) { | ||
| OS << Comment << " GroupSharedMemoryLimit=" | ||
| << pInfo4->GroupSharedMemoryLimit << "\n"; | ||
| } | ||
| break; | ||
| case PSVShaderKind::Library: | ||
| case PSVShaderKind::Invalid: | ||
|
|
@@ -887,9 +915,10 @@ void DxilPipelineStateValidation::PrintPSVRuntimeInfo( | |
| PSVRuntimeInfo1 *pInfo1 = m_pPSVRuntimeInfo1; | ||
| PSVRuntimeInfo2 *pInfo2 = m_pPSVRuntimeInfo2; | ||
| PSVRuntimeInfo3 *pInfo3 = m_pPSVRuntimeInfo3; | ||
| PSVRuntimeInfo4 *pInfo4 = m_pPSVRuntimeInfo4; | ||
|
|
||
| hlsl::PrintPSVRuntimeInfo( | ||
| OS, pInfo0, pInfo1, pInfo2, pInfo3, ShaderKind, | ||
| OS, pInfo0, pInfo1, pInfo2, pInfo3, pInfo4, ShaderKind, | ||
| m_pPSVRuntimeInfo3 ? m_StringTable.Get(pInfo3->EntryFunctionName) : "", | ||
| Comment); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3921,6 +3921,18 @@ static void ValidateGlobalVariables(ValidationContext &ValCtx) { | |||||||||||
| Rule = ValidationRule::SmMaxMSSMSize; | ||||||||||||
| MaxSize = DXIL::kMaxMSSMSize; | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| // Check if the entry function has attribute to override TGSM size. | ||||||||||||
| if (M.HasDxilEntryProps(M.GetEntryFunction())) { | ||||||||||||
| DxilEntryProps &EntryProps = M.GetDxilEntryProps(M.GetEntryFunction()); | ||||||||||||
| if (EntryProps.props.IsCS()) { | ||||||||||||
| unsigned SpecifiedTGSMSize = EntryProps.props.groupSharedLimitBytes; | ||||||||||||
| if (SpecifiedTGSMSize > 0) { | ||||||||||||
| MaxSize = SpecifiedTGSMSize; | ||||||||||||
| } | ||||||||||||
|
Comment on lines
3930
to
3932
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
LLVM coding standards say to omit braces here. Something's also up with the formatting. Did the format-checker spot it? Anyway, clang-format should fix this for you. |
||||||||||||
| } | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| if (TGSMSize > MaxSize) { | ||||||||||||
| Module::global_iterator GI = M.GetModule()->global_end(); | ||||||||||||
| GlobalVariable *GV = &*GI; | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For new code we generally follow the LLVM Coding Standards. This includes no-p-prefix.