From 6e4b82741893be55f6216c31e19650029c667078 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 30 Jul 2024 20:28:34 -0700 Subject: Fixes for Metal ParameterBlock support. (#4752) --- tools/gfx/d3d12/d3d12-shader-object-layout.cpp | 9 +++++---- tools/gfx/d3d12/d3d12-shader-object-layout.h | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'tools') diff --git a/tools/gfx/d3d12/d3d12-shader-object-layout.cpp b/tools/gfx/d3d12/d3d12-shader-object-layout.cpp index ef59c3672..c93ddf2cd 100644 --- a/tools/gfx/d3d12/d3d12-shader-object-layout.cpp +++ b/tools/gfx/d3d12/d3d12-shader-object-layout.cpp @@ -691,8 +691,8 @@ void RootShaderObjectLayoutImpl::RootSignatureDescBuilder::addAsValue( void RootShaderObjectLayoutImpl::RootSignatureDescBuilder::addAsConstantBuffer( slang::TypeLayoutReflection* typeLayout, Index physicalDescriptorSetIndex, - BindingRegisterOffsetPair const& offsetForChildrenThatNeedNewSpace, - BindingRegisterOffsetPair const& offsetForOrdinaryChildren) + BindingRegisterOffsetPair offsetForChildrenThatNeedNewSpace, + BindingRegisterOffsetPair offsetForOrdinaryChildren) { if (typeLayout->getSize(SLANG_PARAMETER_CATEGORY_UNIFORM) != 0) { @@ -705,6 +705,7 @@ void RootShaderObjectLayoutImpl::RootSignatureDescBuilder::addAsConstantBuffer( offsetForOrdinaryChildren.primary.spaceOffset, 1, false); + offsetForRangeType++; } addAsValue(typeLayout, physicalDescriptorSetIndex, offsetForChildrenThatNeedNewSpace, offsetForOrdinaryChildren); @@ -713,8 +714,8 @@ void RootShaderObjectLayoutImpl::RootSignatureDescBuilder::addAsConstantBuffer( void RootShaderObjectLayoutImpl::RootSignatureDescBuilder::addAsValue( slang::TypeLayoutReflection* typeLayout, Index physicalDescriptorSetIndex, - BindingRegisterOffsetPair const& containerOffset, - BindingRegisterOffsetPair const& elementOffset) + BindingRegisterOffsetPair containerOffset, + BindingRegisterOffsetPair elementOffset) { // Our first task is to add the binding ranges for stuff that is // directly contained in `typeLayout` rather than via sub-objects. diff --git a/tools/gfx/d3d12/d3d12-shader-object-layout.h b/tools/gfx/d3d12/d3d12-shader-object-layout.h index b8b3082f6..2b27a1d98 100644 --- a/tools/gfx/d3d12/d3d12-shader-object-layout.h +++ b/tools/gfx/d3d12/d3d12-shader-object-layout.h @@ -450,14 +450,14 @@ public: void addAsConstantBuffer( slang::TypeLayoutReflection* typeLayout, Index physicalDescriptorSetIndex, - BindingRegisterOffsetPair const& containerOffset, - BindingRegisterOffsetPair const& elementOffset); + BindingRegisterOffsetPair containerOffset, + BindingRegisterOffsetPair elementOffset); void addAsValue( slang::TypeLayoutReflection* typeLayout, Index physicalDescriptorSetIndex, - BindingRegisterOffsetPair const& containerOffset, - BindingRegisterOffsetPair const& elementOffset); + BindingRegisterOffsetPair containerOffset, + BindingRegisterOffsetPair elementOffset); D3D12_ROOT_SIGNATURE_DESC1& build(); }; -- cgit v1.2.3