mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 05:52:11 +01:00
[dxvk] Clean up misc. code
This commit is contained in:
parent
37f31ae1e7
commit
a1ace8ef21
@ -104,9 +104,7 @@ namespace dxvk {
|
||||
if (access.test(DxvkAccess::Write))
|
||||
m_dstAccess |= dstAccess;
|
||||
} else {
|
||||
VkImageMemoryBarrier barrier;
|
||||
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
|
||||
barrier.pNext = nullptr;
|
||||
VkImageMemoryBarrier barrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
|
||||
barrier.srcAccessMask = srcAccess & AccessWriteMask;
|
||||
barrier.dstAccessMask = dstAccess;
|
||||
barrier.oldLayout = srcLayout;
|
||||
@ -138,9 +136,7 @@ namespace dxvk {
|
||||
release.m_srcStages |= srcStages;
|
||||
acquire.m_dstStages |= dstStages;
|
||||
|
||||
VkBufferMemoryBarrier barrier;
|
||||
barrier.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER;
|
||||
barrier.pNext = nullptr;
|
||||
VkBufferMemoryBarrier barrier = { VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER };
|
||||
barrier.srcAccessMask = srcAccess & AccessWriteMask;
|
||||
barrier.dstAccessMask = 0;
|
||||
barrier.srcQueueFamilyIndex = srcQueue;
|
||||
@ -248,9 +244,7 @@ namespace dxvk {
|
||||
if (!srcFlags) srcFlags = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
|
||||
if (!dstFlags) dstFlags = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
|
||||
|
||||
VkMemoryBarrier memBarrier;
|
||||
memBarrier.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER;
|
||||
memBarrier.pNext = nullptr;
|
||||
VkMemoryBarrier memBarrier = { VK_STRUCTURE_TYPE_MEMORY_BARRIER };
|
||||
memBarrier.srcAccessMask = m_srcAccess;
|
||||
memBarrier.dstAccessMask = m_dstAccess;
|
||||
|
||||
|
@ -23,11 +23,7 @@ namespace dxvk {
|
||||
m_state.om.framebufferInfo = makeFramebufferInfo(m_state.om.renderTargets);
|
||||
|
||||
for (uint32_t i = 0; i < MaxNumActiveBindings; i++) {
|
||||
m_descriptorWrites[i].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
||||
m_descriptorWrites[i].pNext = nullptr;
|
||||
m_descriptorWrites[i].dstSet = VK_NULL_HANDLE;
|
||||
m_descriptorWrites[i].dstBinding = 0;
|
||||
m_descriptorWrites[i].dstArrayElement = 0;
|
||||
m_descriptorWrites[i] = { VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET };
|
||||
m_descriptorWrites[i].descriptorCount = 1;
|
||||
m_descriptorWrites[i].descriptorType = VK_DESCRIPTOR_TYPE_MAX_ENUM;
|
||||
m_descriptorWrites[i].pImageInfo = &m_descriptors[i].image;
|
||||
@ -326,16 +322,12 @@ namespace dxvk {
|
||||
|
||||
VkDescriptorSet descriptorSet = m_descriptorPool->alloc(pipeInfo.dsetLayout);
|
||||
|
||||
VkWriteDescriptorSet descriptorWrite;
|
||||
descriptorWrite.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
||||
descriptorWrite.pNext = nullptr;
|
||||
VkWriteDescriptorSet descriptorWrite = { VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET };
|
||||
descriptorWrite.dstSet = descriptorSet;
|
||||
descriptorWrite.dstBinding = 0;
|
||||
descriptorWrite.dstArrayElement = 0;
|
||||
descriptorWrite.descriptorCount = 1;
|
||||
descriptorWrite.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER;
|
||||
descriptorWrite.pImageInfo = nullptr;
|
||||
descriptorWrite.pBufferInfo = nullptr;
|
||||
descriptorWrite.pTexelBufferView = &viewObject;
|
||||
m_cmd->updateDescriptorSets(1, &descriptorWrite);
|
||||
|
||||
@ -3163,17 +3155,13 @@ namespace dxvk {
|
||||
viewInfo.imageView = imageView->handle();
|
||||
viewInfo.imageLayout = imageView->imageInfo().layout;
|
||||
|
||||
VkWriteDescriptorSet descriptorWrite;
|
||||
descriptorWrite.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
||||
descriptorWrite.pNext = nullptr;
|
||||
VkWriteDescriptorSet descriptorWrite = { VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET };
|
||||
descriptorWrite.dstSet = descriptorSet;
|
||||
descriptorWrite.dstBinding = 0;
|
||||
descriptorWrite.dstArrayElement = 0;
|
||||
descriptorWrite.descriptorCount = 1;
|
||||
descriptorWrite.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
|
||||
descriptorWrite.pImageInfo = &viewInfo;
|
||||
descriptorWrite.pBufferInfo = nullptr;
|
||||
descriptorWrite.pTexelBufferView = nullptr;
|
||||
m_cmd->updateDescriptorSets(1, &descriptorWrite);
|
||||
|
||||
// Prepare shader arguments
|
||||
@ -5681,9 +5669,7 @@ namespace dxvk {
|
||||
VkAccessFlags srcAccess,
|
||||
VkPipelineStageFlags dstStages,
|
||||
VkAccessFlags dstAccess) {
|
||||
VkMemoryBarrier barrier;
|
||||
barrier.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER;
|
||||
barrier.pNext = nullptr;
|
||||
VkMemoryBarrier barrier = { VK_STRUCTURE_TYPE_MEMORY_BARRIER };
|
||||
barrier.srcAccessMask = srcAccess;
|
||||
barrier.dstAccessMask = dstAccess;
|
||||
|
||||
|
@ -41,13 +41,11 @@ namespace dxvk {
|
||||
|
||||
m_shared = canShareImage(info, createInfo.sharing);
|
||||
|
||||
VkExternalMemoryImageCreateInfo externalInfo;
|
||||
if (m_shared) {
|
||||
externalInfo.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO;
|
||||
externalInfo.pNext = nullptr;
|
||||
externalInfo.handleTypes = createInfo.sharing.type;
|
||||
VkExternalMemoryImageCreateInfo externalInfo = { VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO };
|
||||
|
||||
formatList.pNext = &externalInfo;
|
||||
if (m_shared) {
|
||||
externalInfo.pNext = std::exchange(info.pNext, &externalInfo);
|
||||
externalInfo.handleTypes = createInfo.sharing.type;
|
||||
}
|
||||
|
||||
if (m_vkd->vkCreateImage(m_vkd->device(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user