-
Notifications
You must be signed in to change notification settings - Fork 10
Fixed descriptor arrays are not properly mapped. #154
Copy link
Copy link
Closed
Labels
Bug 🐞Something isn't working.Something isn't working.DX12 ❎The issue involves the DX12 backend.The issue involves the DX12 backend.Priority: LowA low priority issue.A low priority issue.
Milestone
Description
Describe the Bug
When using a fixed-length descriptor array, the descriptors for the subsequent array elements are not correctly mapped. When calling updateGlobalBuffers in DescriptorSet::update, the descriptor field needs to be added to the offset.
Steps to reproduce
m_images.resize(3u);
std::ranges::generate(m_images, [&]() { return device.factory().createTexture(Format::R8G8B8A8_UNORM, Size3d(width, height, 1u)); });
DirectX12DescriptorLayout descriptorLayout(DescriptorType::Texture, 0u, 0u, m_images.size());
auto descriptorSetLayout = DirectX12DescriptorSetLayout::create(device, std::array{ descriptorLayout }, 0u, ShaderStage::Any);
auto bindings = m_images | std::views::transform([i = 0](auto& image) mutable -> DescriptorBinding { return { .binding = 0, .resource = *image, .firstDescriptor = static_cast<UInt32>(i++) }; }) | std::ranges::to<std::vector>();
m_descriptorSet = descriptorSetLayout->allocate(bindings); // Only works for descriptor 0Additional context
As a temporary workaround, the descriptors can be manually patched in a single subsequent call as follows:
device.updateBufferDescriptors(*m_descriptorSet, 0, m_images.size());Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug 🐞Something isn't working.Something isn't working.DX12 ❎The issue involves the DX12 backend.The issue involves the DX12 backend.Priority: LowA low priority issue.A low priority issue.
Projects
Status
v0.5.1