Skip to content

Commit

Permalink
fix dyn descriptors for single textures
Browse files Browse the repository at this point in the history
  • Loading branch information
Try committed Mar 28, 2023
1 parent 550d272 commit e0c5052
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Engine/gapi/directx12/dxdescriptorarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Engine/gapi/directx12/dxpipelinelay.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e0c5052

Please sign in to comment.