Add D3D12 helper to set descriptor table parameter offset

This commit is contained in:
baldurk
2019-05-13 19:07:23 +01:00
parent 37d3320847
commit 5a18717b6e
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -170,7 +170,7 @@ D3D12_ROOT_PARAMETER1 constParam(D3D12_SHADER_VISIBILITY vis, UINT space, UINT r
}
D3D12_ROOT_PARAMETER1 tableParam(D3D12_SHADER_VISIBILITY vis, D3D12_DESCRIPTOR_RANGE_TYPE type,
UINT space, UINT basereg, UINT numreg)
UINT space, UINT basereg, UINT numreg, UINT descOffset)
{
// this is a super hack but avoids the need to be clumsy with allocation of these structs
static D3D12_DESCRIPTOR_RANGE1 ranges[32] = {};
@@ -192,7 +192,7 @@ D3D12_ROOT_PARAMETER1 tableParam(D3D12_SHADER_VISIBILITY vis, D3D12_DESCRIPTOR_R
range.RegisterSpace = space;
range.BaseShaderRegister = basereg;
range.NumDescriptors = numreg;
range.OffsetInDescriptorsFromTableStart = 0;
range.OffsetInDescriptorsFromTableStart = descOffset;
range.Flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE;
return ret;
+1 -1
View File
@@ -257,7 +257,7 @@ D3D12_ROOT_PARAMETER1 cbvParam(D3D12_SHADER_VISIBILITY vis, UINT space, UINT reg
D3D12_ROOT_PARAMETER1 constParam(D3D12_SHADER_VISIBILITY vis, UINT space, UINT reg, UINT num);
D3D12_ROOT_PARAMETER1 tableParam(D3D12_SHADER_VISIBILITY vis, D3D12_DESCRIPTOR_RANGE_TYPE type,
UINT space, UINT basereg, UINT numreg);
UINT space, UINT basereg, UINT numreg, UINT descOffset = 0);
#define GET_REFCOUNT(val, obj) \
do \