mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Optimized descriptor updates
This commit is contained in:
parent
5415b685de
commit
342e99a11c
@ -105,9 +105,7 @@ namespace dxvk {
|
|||||||
VkDescriptorSet dset = m_descAlloc.alloc(descriptorLayout);
|
VkDescriptorSet dset = m_descAlloc.alloc(descriptorLayout);
|
||||||
|
|
||||||
// Write data to the descriptor set
|
// Write data to the descriptor set
|
||||||
// TODO recycle vector as a class member
|
std::array<VkWriteDescriptorSet, MaxNumResourceSlots> descriptorWrites;
|
||||||
std::vector<VkWriteDescriptorSet> descriptorWrites;
|
|
||||||
descriptorWrites.resize(descriptorCount);
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < descriptorCount; i++) {
|
for (uint32_t i = 0; i < descriptorCount; i++) {
|
||||||
auto& curr = descriptorWrites.at(i);
|
auto& curr = descriptorWrites.at(i);
|
||||||
@ -127,7 +125,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
m_vkd->vkUpdateDescriptorSets(
|
m_vkd->vkUpdateDescriptorSets(
|
||||||
m_vkd->device(),
|
m_vkd->device(),
|
||||||
descriptorWrites.size(),
|
descriptorCount,
|
||||||
descriptorWrites.data(),
|
descriptorWrites.data(),
|
||||||
0, nullptr);
|
0, nullptr);
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "dxvk_descriptor.h"
|
#include "dxvk_descriptor.h"
|
||||||
#include "dxvk_lifetime.h"
|
#include "dxvk_lifetime.h"
|
||||||
|
#include "dxvk_limits.h"
|
||||||
#include "dxvk_pipelayout.h"
|
#include "dxvk_pipelayout.h"
|
||||||
#include "dxvk_staging.h"
|
#include "dxvk_staging.h"
|
||||||
|
|
||||||
|
@ -866,8 +866,6 @@ namespace dxvk {
|
|||||||
// resource was marked as dirty after invalidation
|
// resource was marked as dirty after invalidation
|
||||||
// TODO move this into a separate method so that
|
// TODO move this into a separate method so that
|
||||||
// compute can use this code as well
|
// compute can use this code as well
|
||||||
std::vector<DxvkDescriptorInfo> descriptors;
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < layout->bindingCount(); i++) {
|
for (uint32_t i = 0; i < layout->bindingCount(); i++) {
|
||||||
const uint32_t slot = layout->binding(i).slot;
|
const uint32_t slot = layout->binding(i).slot;
|
||||||
const auto& res = m_gResources.getShaderResource(slot);
|
const auto& res = m_gResources.getShaderResource(slot);
|
||||||
@ -897,7 +895,7 @@ namespace dxvk {
|
|||||||
descriptor.buffer = res.bufferSlice.descriptorInfo();
|
descriptor.buffer = res.bufferSlice.descriptorInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
descriptors.push_back(descriptor);
|
descriptors.at(i) = descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_cmd->bindResourceDescriptors(
|
m_cmd->bindResourceDescriptors(
|
||||||
|
@ -418,6 +418,8 @@ namespace dxvk {
|
|||||||
DxvkShaderResourceSlots m_cResources = { 256 };
|
DxvkShaderResourceSlots m_cResources = { 256 };
|
||||||
DxvkShaderResourceSlots m_gResources = { 1024 };
|
DxvkShaderResourceSlots m_gResources = { 1024 };
|
||||||
|
|
||||||
|
std::array<DxvkDescriptorInfo, MaxNumResourceSlots> descriptors;
|
||||||
|
|
||||||
void renderPassBegin();
|
void renderPassBegin();
|
||||||
void renderPassEnd();
|
void renderPassEnd();
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ namespace dxvk {
|
|||||||
MaxNumVertexBindings = 32,
|
MaxNumVertexBindings = 32,
|
||||||
MaxNumOutputStreams = 4,
|
MaxNumOutputStreams = 4,
|
||||||
MaxNumViewports = 16,
|
MaxNumViewports = 16,
|
||||||
MaxNumResourceSlots = 4096,
|
MaxNumResourceSlots = 1024,
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user