mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-12 13:08:50 +01:00
[dxvk] Use DxvkBindingLayoutObjects for set lookup directly
Avoids pointer dereferencing on a really hot code path. This is also safe since there's a 1:1 mapping between the VkPipelineLayout and the given ovbject type.
This commit is contained in:
parent
9f9324c421
commit
e0af668f6c
@ -161,14 +161,13 @@ namespace dxvk {
|
|||||||
|
|
||||||
DxvkDescriptorSetMap* DxvkDescriptorPool::getSetMap(
|
DxvkDescriptorSetMap* DxvkDescriptorPool::getSetMap(
|
||||||
const DxvkBindingLayoutObjects* layout) {
|
const DxvkBindingLayoutObjects* layout) {
|
||||||
auto pair = m_setMaps.find(layout->getPipelineLayout(false));
|
auto pair = m_setMaps.find(layout);
|
||||||
if (likely(pair != m_setMaps.end())) {
|
if (likely(pair != m_setMaps.end()))
|
||||||
return &pair->second;
|
return &pair->second;
|
||||||
}
|
|
||||||
|
|
||||||
auto iter = m_setMaps.emplace(
|
auto iter = m_setMaps.emplace(
|
||||||
std::piecewise_construct,
|
std::piecewise_construct,
|
||||||
std::tuple(layout->getPipelineLayout(false)),
|
std::tuple(layout),
|
||||||
std::tuple());
|
std::tuple());
|
||||||
|
|
||||||
for (uint32_t i = 0; i < DxvkDescriptorSets::SetCount; i++) {
|
for (uint32_t i = 0; i < DxvkDescriptorSets::SetCount; i++) {
|
||||||
|
@ -136,10 +136,19 @@ namespace dxvk {
|
|||||||
DxvkDescriptorManager* m_manager;
|
DxvkDescriptorManager* m_manager;
|
||||||
DxvkContextType m_contextType;
|
DxvkContextType m_contextType;
|
||||||
|
|
||||||
std::vector<VkDescriptorPool> m_descriptorPools;
|
std::vector<VkDescriptorPool> m_descriptorPools;
|
||||||
std::unordered_map<VkDescriptorSetLayout, DxvkDescriptorSetList> m_setLists;
|
|
||||||
std::unordered_map<VkPipelineLayout, DxvkDescriptorSetMap> m_setMaps;
|
std::unordered_map<
|
||||||
std::pair<const DxvkBindingLayoutObjects*, DxvkDescriptorSetMap*> m_cachedEntry;
|
VkDescriptorSetLayout,
|
||||||
|
DxvkDescriptorSetList> m_setLists;
|
||||||
|
|
||||||
|
std::unordered_map<
|
||||||
|
const DxvkBindingLayoutObjects*,
|
||||||
|
DxvkDescriptorSetMap> m_setMaps;
|
||||||
|
|
||||||
|
std::pair<
|
||||||
|
const DxvkBindingLayoutObjects*,
|
||||||
|
DxvkDescriptorSetMap*> m_cachedEntry;
|
||||||
|
|
||||||
uint32_t m_setsAllocated = 0;
|
uint32_t m_setsAllocated = 0;
|
||||||
uint32_t m_setsUsed = 0;
|
uint32_t m_setsUsed = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user