1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 01:24:11 +01:00

[dxvk] Move dynamic descriptor offset array to stack

There's absolutely no reason to store it in the object.
This commit is contained in:
Philip Rebohle 2019-10-10 22:19:31 +02:00
parent a743ba6531
commit 7df3b409c3
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 5 additions and 4 deletions

View File

@ -3954,12 +3954,14 @@ namespace dxvk {
void DxvkContext::updateShaderDescriptorSetBinding(
VkDescriptorSet set,
const DxvkPipelineLayout* layout) {
if (set != VK_NULL_HANDLE) {
if (set) {
std::array<uint32_t, MaxNumActiveBindings> offsets;
for (uint32_t i = 0; i < layout->dynamicBindingCount(); i++) {
const auto& binding = layout->dynamicBinding(i);
const auto& res = m_rc[binding.slot];
m_descOffsets[i] = res.bufferSlice.defined()
offsets[i] = res.bufferSlice.defined()
? res.bufferSlice.getDynamicOffset()
: 0;
}
@ -3967,7 +3969,7 @@ namespace dxvk {
m_cmd->cmdBindDescriptorSet(BindPoint,
layout->pipelineLayout(), set,
layout->dynamicBindingCount(),
m_descOffsets.data());
offsets.data());
}
}

View File

@ -1029,7 +1029,6 @@ namespace dxvk {
std::array<DxvkShaderResourceSlot, MaxNumResourceSlots> m_rc;
std::array<DxvkDescriptorInfo, MaxNumActiveBindings> m_descInfos;
std::array<uint32_t, MaxNumActiveBindings> m_descOffsets;
std::array<DxvkGraphicsPipeline*, 4096> m_gpLookupCache = { };
std::array<DxvkComputePipeline*, 256> m_cpLookupCache = { };