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

[dxvk] Optimized descriptor updates

This commit is contained in:
Philip Rebohle 2017-12-19 19:36:44 +01:00
parent 5415b685de
commit 342e99a11c
5 changed files with 7 additions and 8 deletions

View File

@ -105,9 +105,7 @@ namespace dxvk {
VkDescriptorSet dset = m_descAlloc.alloc(descriptorLayout);
// Write data to the descriptor set
// TODO recycle vector as a class member
std::vector<VkWriteDescriptorSet> descriptorWrites;
descriptorWrites.resize(descriptorCount);
std::array<VkWriteDescriptorSet, MaxNumResourceSlots> descriptorWrites;
for (uint32_t i = 0; i < descriptorCount; i++) {
auto& curr = descriptorWrites.at(i);
@ -127,7 +125,7 @@ namespace dxvk {
m_vkd->vkUpdateDescriptorSets(
m_vkd->device(),
descriptorWrites.size(),
descriptorCount,
descriptorWrites.data(),
0, nullptr);

View File

@ -4,6 +4,7 @@
#include "dxvk_descriptor.h"
#include "dxvk_lifetime.h"
#include "dxvk_limits.h"
#include "dxvk_pipelayout.h"
#include "dxvk_staging.h"

View File

@ -866,8 +866,6 @@ namespace dxvk {
// resource was marked as dirty after invalidation
// TODO move this into a separate method so that
// compute can use this code as well
std::vector<DxvkDescriptorInfo> descriptors;
for (uint32_t i = 0; i < layout->bindingCount(); i++) {
const uint32_t slot = layout->binding(i).slot;
const auto& res = m_gResources.getShaderResource(slot);
@ -897,7 +895,7 @@ namespace dxvk {
descriptor.buffer = res.bufferSlice.descriptorInfo();
}
descriptors.push_back(descriptor);
descriptors.at(i) = descriptor;
}
m_cmd->bindResourceDescriptors(

View File

@ -418,6 +418,8 @@ namespace dxvk {
DxvkShaderResourceSlots m_cResources = { 256 };
DxvkShaderResourceSlots m_gResources = { 1024 };
std::array<DxvkDescriptorInfo, MaxNumResourceSlots> descriptors;
void renderPassBegin();
void renderPassEnd();

View File

@ -10,7 +10,7 @@ namespace dxvk {
MaxNumVertexBindings = 32,
MaxNumOutputStreams = 4,
MaxNumViewports = 16,
MaxNumResourceSlots = 4096,
MaxNumResourceSlots = 1024,
};
}