mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[dxvk] Clean up remaining object creation code
This commit is contained in:
parent
9ebeb8e502
commit
a76b5693f3
@ -305,10 +305,7 @@ namespace dxvk {
|
|||||||
{ VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, maxSets / 64 },
|
{ VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, maxSets / 64 },
|
||||||
{ VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, maxSets * 1 } }};
|
{ VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, maxSets * 1 } }};
|
||||||
|
|
||||||
VkDescriptorPoolCreateInfo info;
|
VkDescriptorPoolCreateInfo info = { VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO };
|
||||||
info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
|
|
||||||
info.pNext = nullptr;
|
|
||||||
info.flags = 0;
|
|
||||||
info.maxSets = maxSets;
|
info.maxSets = maxSets;
|
||||||
info.poolSizeCount = pools.size();
|
info.poolSizeCount = pools.size();
|
||||||
info.pPoolSizes = pools.data();
|
info.pPoolSizes = pools.data();
|
||||||
|
@ -58,10 +58,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!event) {
|
if (!event) {
|
||||||
VkEventCreateInfo info;
|
VkEventCreateInfo info = { VK_STRUCTURE_TYPE_EVENT_CREATE_INFO };
|
||||||
info.sType = VK_STRUCTURE_TYPE_EVENT_CREATE_INFO;
|
|
||||||
info.pNext = nullptr;
|
|
||||||
info.flags = 0;
|
|
||||||
|
|
||||||
VkResult status = m_vkd->vkCreateEvent(
|
VkResult status = m_vkd->vkCreateEvent(
|
||||||
m_vkd->device(), &info, nullptr, &event);
|
m_vkd->device(), &info, nullptr, &event);
|
||||||
|
@ -183,13 +183,9 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void DxvkGpuQueryAllocator::createQueryPool() {
|
void DxvkGpuQueryAllocator::createQueryPool() {
|
||||||
VkQueryPoolCreateInfo info;
|
VkQueryPoolCreateInfo info = { VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO };
|
||||||
info.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO;
|
|
||||||
info.pNext = nullptr;
|
|
||||||
info.flags = 0;
|
|
||||||
info.queryType = m_queryType;
|
info.queryType = m_queryType;
|
||||||
info.queryCount = m_queryPoolSize;
|
info.queryCount = m_queryPoolSize;
|
||||||
info.pipelineStatistics = 0;
|
|
||||||
|
|
||||||
if (m_queryType == VK_QUERY_TYPE_PIPELINE_STATISTICS) {
|
if (m_queryType == VK_QUERY_TYPE_PIPELINE_STATISTICS) {
|
||||||
info.pipelineStatistics
|
info.pipelineStatistics
|
||||||
|
@ -407,17 +407,16 @@ namespace dxvk {
|
|||||||
result.memFlags = flags;
|
result.memFlags = flags;
|
||||||
result.priority = priority;
|
result.priority = priority;
|
||||||
|
|
||||||
VkMemoryPriorityAllocateInfoEXT prio;
|
VkMemoryPriorityAllocateInfoEXT prio = { VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT };
|
||||||
prio.sType = VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT;
|
|
||||||
prio.pNext = dedAllocInfo;
|
|
||||||
prio.priority = priority;
|
prio.priority = priority;
|
||||||
|
|
||||||
VkMemoryAllocateInfo info;
|
VkMemoryAllocateInfo info = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, dedAllocInfo };
|
||||||
info.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
|
|
||||||
info.pNext = useMemoryPriority ? &prio : prio.pNext;
|
|
||||||
info.allocationSize = size;
|
info.allocationSize = size;
|
||||||
info.memoryTypeIndex = type->memTypeId;
|
info.memoryTypeIndex = type->memTypeId;
|
||||||
|
|
||||||
|
if (useMemoryPriority)
|
||||||
|
prio.pNext = std::exchange(info.pNext, &prio);
|
||||||
|
|
||||||
if (m_vkd->vkAllocateMemory(m_vkd->device(), &info, nullptr, &result.memHandle) != VK_SUCCESS)
|
if (m_vkd->vkAllocateMemory(m_vkd->device(), &info, nullptr, &result.memHandle) != VK_SUCCESS)
|
||||||
return DxvkDeviceMemory();
|
return DxvkDeviceMemory();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user