Skip to content

Commit

Permalink
Fix samplers for root sig 1.1 in EZ
Browse files Browse the repository at this point in the history
1. Fix error interpretation for D3DX12SerializeVersionedRootSignature
2. Fix samplers for root signature 1.1 in EZ
  • Loading branch information
StarsX committed May 7, 2023
1 parent 1117675 commit a5c01e5
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions XUSG-EZ/XUSG-EZ_DX12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ bool EZ::CommandList_DX12::createGraphicsPipelineLayouts(

if (stageMaxSamplers > 0)
{
pipelineLayout->SetRange(paramIndex, DescriptorType::SAMPLER, stageMaxSamplers, 0, 0, DescriptorFlag::DATA_STATIC);
pipelineLayout->SetRange(paramIndex, DescriptorType::SAMPLER, stageMaxSamplers, 0);
pipelineLayout->SetShaderStage(paramIndex++, stage);
}
}
Expand Down Expand Up @@ -846,7 +846,7 @@ bool EZ::CommandList_DX12::createComputePipelineLayouts(uint32_t maxSamplers,
m_computeSpaceToParamIndexMap[static_cast<uint32_t>(DescriptorType::SRV)].resize(maxSrvSpaces);
m_computeSpaceToParamIndexMap[static_cast<uint32_t>(DescriptorType::UAV)].resize(maxUavSpaces);

pipelineLayout->SetRange(paramIndex++, DescriptorType::SAMPLER, maxSamplers, 0, 0, DescriptorFlag::DATA_STATIC);
pipelineLayout->SetRange(paramIndex++, DescriptorType::SAMPLER, maxSamplers, 0);

for (auto s = 0u; s < maxSpaces; ++s)
{
Expand Down
2 changes: 1 addition & 1 deletion XUSG-EZ/XUSGUltimate-EZ_DX12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ bool EZ::CommandList_DX12::createMeshShaderPipelineLayouts(

if (stageMaxSamplers > 0)
{
pipelineLayout->SetRange(paramIndex, DescriptorType::SAMPLER, stageMaxSamplers, 0, 0, DescriptorFlag::DATA_STATIC);
pipelineLayout->SetRange(paramIndex, DescriptorType::SAMPLER, stageMaxSamplers, 0);
pipelineLayout->SetShaderStage(paramIndex++, stage);
}
}
Expand Down
5 changes: 0 additions & 5 deletions XUSG/Core/XUSG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,3 @@ uint8_t XUSG::CalculateMipLevels(uint64_t width, uint32_t height, uint32_t depth
{
return CalculateMipLevels(static_cast<uint32_t>(width), height, depth);
}

uint32_t XUSG::CalculateSubresource(uint8_t mipSlice, uint8_t numMips, uint32_t arraySlice, uint32_t arraySize, uint8_t planeSlice)
{
return mipSlice + arraySlice * numMips + planeSlice * numMips * arraySize;
}
1 change: 0 additions & 1 deletion XUSG/Core/XUSG.h
Original file line number Diff line number Diff line change
Expand Up @@ -2317,5 +2317,4 @@ namespace XUSG
XUSG_INTERFACE uint8_t Log2(uint32_t value);
XUSG_INTERFACE uint8_t CalculateMipLevels(uint32_t width, uint32_t height, uint32_t depth = 1);
XUSG_INTERFACE uint8_t CalculateMipLevels(uint64_t width, uint32_t height, uint32_t depth = 1);
XUSG_INTERFACE uint32_t CalculateSubresource(uint8_t mipSlice, uint8_t numMips, uint32_t arraySlice, uint32_t arraySize, uint8_t planeSlice);
}
2 changes: 1 addition & 1 deletion XUSG/Core/XUSGPipelineLayout_DX12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ PipelineLayout PipelineLayoutLib_DX12::createPipelineLayout(const string& key, c

com_ptr<ID3DBlob> signature, error;
H_RETURN(D3DX12SerializeVersionedRootSignature(&rootSignatureDesc, highestVersion, signature.put(), error.put()),
cerr, reinterpret_cast<wchar_t*>(error->GetBufferPointer()), nullptr);
cerr, reinterpret_cast<char*>(error->GetBufferPointer()), nullptr);

return createRootSignature(key, signature->GetBufferPointer(), signature->GetBufferSize(), name, nodeMask);
}
Expand Down
2 changes: 1 addition & 1 deletion XUSGRayTracing-EZ/XUSGRayTracing-EZ_DX12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ bool EZ::CommandList_DXR::createComputePipelineLayouts(uint32_t maxSamplers, con
m_computeSpaceToParamIndexMap[static_cast<uint32_t>(DescriptorType::UAV)].resize(maxUavSpaces);
m_tlasBindingToParamIndexMap.resize(maxTLASSrvs);

pipelineLayout->SetRange(paramIndex++, DescriptorType::SAMPLER, maxSamplers, 0, 0, DescriptorFlag::DATA_STATIC);
pipelineLayout->SetRange(paramIndex++, DescriptorType::SAMPLER, maxSamplers, 0);

for (auto s = 0u; s < maxSpaces; ++s)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ XUSG::PipelineLayout RayTracing::PipelineLayout_DX12::CreatePipelineLayout(const
com_ptr<ID3DBlob> signature, error;
const auto pDxDevice = static_cast<ID3D12RaytracingFallbackDevice*>(pDevice->GetRTHandle());
H_RETURN(pDxDevice->D3D12SerializeVersionedRootSignature(&rootSignatureDesc, &signature, &error,
AccelerationStructure::GetUAVCount()), cerr, reinterpret_cast<wchar_t*>(error->GetBufferPointer()), nullptr);
AccelerationStructure::GetUAVCount()), cerr, reinterpret_cast<char*>(error->GetBufferPointer()), nullptr);

V_RETURN(pDxDevice->CreateRootSignature(1, signature->GetBufferPointer(), signature->GetBufferSize(),
IID_PPV_ARGS(&rootSignature)), cerr, nullptr);
Expand Down

0 comments on commit a5c01e5

Please sign in to comment.