From e0c5052ea7f3e59ef166e08a921f95cd264f52e3 Mon Sep 17 00:00:00 2001 From: Try Date: Tue, 28 Mar 2023 21:18:10 +0200 Subject: [PATCH] fix dyn descriptors for single textures #36 --- Engine/gapi/directx12/dxdescriptorarray.cpp | 7 ++++++- Engine/gapi/directx12/dxpipelinelay.h | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Engine/gapi/directx12/dxdescriptorarray.cpp b/Engine/gapi/directx12/dxdescriptorarray.cpp index 0629c916..f7f7f8cc 100644 --- a/Engine/gapi/directx12/dxdescriptorarray.cpp +++ b/Engine/gapi/directx12/dxdescriptorarray.cpp @@ -169,7 +169,7 @@ void DxDescriptorArray::set(size_t id, AbstractGraphicsApi::Texture** tex, size_ auto& l = lay.handler->lay[id]; if(l.runtimeSized) { - constexpr uint32_t granularity = 1; //DxPipelineLay::MAX_BINDLESS; + constexpr uint32_t granularity = DxPipelineLay::BINDLESS_GRANULARITY; uint32_t rSz = ((cnt+granularity-1u) & (~(granularity-1u))); if(rSz!=runtimeArrays[id].size) { auto prev = std::move(runtimeArrays[id].data); @@ -188,6 +188,11 @@ void DxDescriptorArray::set(size_t id, AbstractGraphicsApi::Texture** tex, size_ return; } } + else if(lay.handler->isRuntimeSized()) { + runtimeArrays[id].data = {tex[0]}; + runtimeArrays[id].smp = smp; + runtimeArrays[id].mipLevel = mipLevel; + } uint32_t descSize = 0; uint32_t smpSize = 0; diff --git a/Engine/gapi/directx12/dxpipelinelay.h b/Engine/gapi/directx12/dxpipelinelay.h index f8c15250..ede3b916 100644 --- a/Engine/gapi/directx12/dxpipelinelay.h +++ b/Engine/gapi/directx12/dxpipelinelay.h @@ -35,8 +35,8 @@ class DxPipelineLay : public AbstractGraphicsApi::PipelineLay { HEAP_SMP = 1, HEAP_MAX = 2, - POOL_SIZE = 128, - MAX_BINDLESS = 2048, + POOL_SIZE = 128, + BINDLESS_GRANULARITY = 256, }; struct Param {