Repository navigation
Description
Description
The PSV0 mesh-shader runtime information defines both GroupSharedBytesUsed and GroupSharedBytesDependentOnViewID, but DXC does not populate the dependent-byte count.
AI-assisted bug report:
At commit 74df1e093c4282282890f5ff2e4886d5f8dca13a:
- MSInfo declares both fields.
- [The PSV producer calculates total TGSM usage](), but does not populate
DirectXShaderCompiler/lib/DxilContainer/DxilPipelineStateValidation.cpp
Lines 254 to 270 in 74df1e0
case ShaderModel::Kind::Mesh: { pInfo->MS.MaxOutputVertices = (uint16_t)DM.GetMaxOutputVertices(); pInfo->MS.MaxOutputPrimitives = (uint16_t)DM.GetMaxOutputPrimitives(); Module *mod = DM.GetModule(); const DataLayout &DL = mod->getDataLayout(); unsigned totalByteSize = 0; for (GlobalVariable &GV : mod->globals()) { PointerType *gvPtrType = cast<PointerType>(GV.getType()); if (gvPtrType->getAddressSpace() == hlsl::DXIL::kTGSMAddrSpace) { Type *gvType = gvPtrType->getPointerElementType(); unsigned byteSize = DL.getTypeAllocSize(gvType); totalByteSize += byteSize; } } pInfo->MS.GroupSharedBytesUsed = totalByteSize; pInfo->MS.PayloadSizeInBytes = DM.GetPayloadSizeInBytes(); break; GroupSharedBytesDependentOnViewID. - [The experimental RDAT writer explicitly notes this PSV omission]().
DirectXShaderCompiler/lib/DxilContainer/DxilContainerAssembler.cpp
Lines 1953 to 1962 in 74df1e0
(uint16_t)DxilShaderFlags::OutputPositionPresent); info.SigPrimOutputElements = AddSigElements(sig.PatchConstOrPrimSignature, shaderFlags); // TODO: Fill in ViewID related masks info.NumThreads = Builder.InsertArray(&props.numThreads[0], &props.numThreads[0] + 3); info.GroupSharedBytesUsed = tgsmSizeInBytes; info.GroupSharedBytesDependentOnViewID = (uint32_t)0; // TODO: same thing (note: this isn't filled in for PSV!) info.PayloadSizeInBytes =
The [mesh-shader ViewID rules](https://microsoft.github.io/DirectX-Specs/d3d/MeshShader.html#sv_viewid) require ViewID-dependent groupshared storage to be expanded while remaining within the storage limit. The missing byte count leaves a gap in the compiler metadata available for that validation.
Expected behavior: Track groupshared storage requiring per-view expansion and emit its byte count in PSV0. Regression coverage should include view-independent storage, ViewID-dependent storage, mixed storage, and dependencies involving memory accesses and dynamic indexing.
Discovered during authoring of microsoft/DirectX-Specs#272, diffing mesh shader proposal language which says the compiler "will" do this, against what was actually implemented.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity