From 3c50ac1f1254f24be8d473bd654153c50b89e6df Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 5 Oct 2024 12:24:54 +0200 Subject: [PATCH] [dxvk] Rename DxvkCopyBufferImage* stuff Slightly misleadning name when we're going to introduce copies between buffers and images. --- src/dxvk/dxvk_context.cpp | 8 ++++---- src/dxvk/dxvk_meta_copy.cpp | 12 ++++++------ src/dxvk/dxvk_meta_copy.h | 20 ++++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 706979fcd..05bcae2cb 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -938,7 +938,7 @@ namespace dxvk { srcView = srcBuffer->createView(viewInfo); } - auto pipeInfo = m_common->metaCopy().getCopyBufferImagePipeline(); + auto pipeInfo = m_common->metaCopy().getCopyFormattedBufferPipeline(); VkDescriptorSet descriptorSet = m_descriptorPool->alloc(pipeInfo.dsetLayout); std::array descriptorWrites; @@ -966,7 +966,7 @@ namespace dxvk { m_cmd->updateDescriptorSets(descriptorWrites.size(), descriptorWrites.data()); - DxvkCopyBufferImageArgs args = { }; + DxvkFormattedBufferCopyArgs args = { }; args.dstOffset = dstOffset; args.srcOffset = srcOffset; args.extent = extent; @@ -3801,7 +3801,7 @@ namespace dxvk { VkImageSubresourceLayers srcSubresource, VkOffset3D srcOffset, VkExtent3D extent) { - DxvkMetaCopyFormats viewFormats = m_common->metaCopy().getFormats( + DxvkMetaCopyFormats viewFormats = m_common->metaCopy().getCopyImageFormats( dstImage->info().format, dstSubresource.aspectMask, srcImage->info().format, srcSubresource.aspectMask); @@ -3894,7 +3894,7 @@ namespace dxvk { srcImage, srcSubresource, viewFormats.srcFormat); // Create pipeline for the copy operation - DxvkMetaCopyPipeline pipeInfo = m_common->metaCopy().getPipeline( + DxvkMetaCopyPipeline pipeInfo = m_common->metaCopy().getCopyImagePipeline( views.srcImageView->info().viewType, viewFormats.dstFormat, dstImage->info().sampleCount); // Create and initialize descriptor set diff --git a/src/dxvk/dxvk_meta_copy.cpp b/src/dxvk/dxvk_meta_copy.cpp index 0e1cc5e44..f11019f27 100644 --- a/src/dxvk/dxvk_meta_copy.cpp +++ b/src/dxvk/dxvk_meta_copy.cpp @@ -114,7 +114,7 @@ namespace dxvk { } - DxvkMetaCopyFormats DxvkMetaCopyObjects::getFormats( + DxvkMetaCopyFormats DxvkMetaCopyObjects::getCopyImageFormats( VkFormat dstFormat, VkImageAspectFlags dstAspect, VkFormat srcFormat, @@ -140,7 +140,7 @@ namespace dxvk { } - DxvkMetaCopyPipeline DxvkMetaCopyObjects::getPipeline( + DxvkMetaCopyPipeline DxvkMetaCopyObjects::getCopyImagePipeline( VkImageViewType viewType, VkFormat dstFormat, VkSampleCountFlagBits dstSamples) { @@ -161,11 +161,11 @@ namespace dxvk { } - DxvkMetaCopyPipeline DxvkMetaCopyObjects::getCopyBufferImagePipeline() { + DxvkMetaCopyPipeline DxvkMetaCopyObjects::getCopyFormattedBufferPipeline() { std::lock_guard lock(m_mutex); if (!m_copyBufferImagePipeline.pipeHandle) - m_copyBufferImagePipeline = createCopyBufferImagePipeline(); + m_copyBufferImagePipeline = createCopyFormattedBufferPipeline(); return m_copyBufferImagePipeline; } @@ -184,7 +184,7 @@ namespace dxvk { } - DxvkMetaCopyPipeline DxvkMetaCopyObjects::createCopyBufferImagePipeline() { + DxvkMetaCopyPipeline DxvkMetaCopyObjects::createCopyFormattedBufferPipeline() { DxvkMetaCopyPipeline pipeline; std::array bindings = {{ @@ -199,7 +199,7 @@ namespace dxvk { if (m_vkd->vkCreateDescriptorSetLayout(m_vkd->device(), &setLayoutInfo, nullptr, &pipeline.dsetLayout) != VK_SUCCESS) throw DxvkError("DxvkMetaCopyObjects: Failed to create descriptor set layout"); - VkPushConstantRange pushRange = { VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(DxvkCopyBufferImageArgs) }; + VkPushConstantRange pushRange = { VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(DxvkFormattedBufferCopyArgs) }; VkPipelineLayoutCreateInfo pipelineLayoutInfo = { VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO }; pipelineLayoutInfo.setLayoutCount = 1; diff --git a/src/dxvk/dxvk_meta_copy.h b/src/dxvk/dxvk_meta_copy.h index a47f0b1eb..d73e26bcf 100644 --- a/src/dxvk/dxvk_meta_copy.h +++ b/src/dxvk/dxvk_meta_copy.h @@ -17,7 +17,7 @@ namespace dxvk { /** * \brief Push constants for buffer image copies */ - struct DxvkCopyBufferImageArgs { + struct DxvkFormattedBufferCopyArgs { VkOffset3D dstOffset; uint32_t pad0; VkOffset3D srcOffset; uint32_t pad1; VkExtent3D extent; uint32_t pad2; @@ -29,8 +29,8 @@ namespace dxvk { * \brief Pair of view formats for copy operation */ struct DxvkMetaCopyFormats { - VkFormat dstFormat; - VkFormat srcFormat; + VkFormat dstFormat = VK_FORMAT_UNDEFINED; + VkFormat srcFormat = VK_FORMAT_UNDEFINED; }; /** @@ -40,9 +40,9 @@ namespace dxvk { * that is used for fragment shader copies. */ struct DxvkMetaCopyPipeline { - VkDescriptorSetLayout dsetLayout; - VkPipelineLayout pipeLayout; - VkPipeline pipeHandle; + VkDescriptorSetLayout dsetLayout = VK_NULL_HANDLE; + VkPipelineLayout pipeLayout = VK_NULL_HANDLE; + VkPipeline pipeHandle = VK_NULL_HANDLE; }; /** @@ -120,7 +120,7 @@ namespace dxvk { * \param [in] srcAspect Source aspect mask * \returns Corresponding color format */ - DxvkMetaCopyFormats getFormats( + DxvkMetaCopyFormats getCopyImageFormats( VkFormat dstFormat, VkImageAspectFlags dstAspect, VkFormat srcFormat, @@ -134,7 +134,7 @@ namespace dxvk { * \param [in] dstSamples Destination sample count * \returns Compatible pipeline for the operation */ - DxvkMetaCopyPipeline getPipeline( + DxvkMetaCopyPipeline getCopyImagePipeline( VkImageViewType viewType, VkFormat dstFormat, VkSampleCountFlagBits dstSamples); @@ -143,7 +143,7 @@ namespace dxvk { * \brief Creates pipeline for buffer image copy * \returns Compute pipeline for buffer image copies */ - DxvkMetaCopyPipeline getCopyBufferImagePipeline(); + DxvkMetaCopyPipeline getCopyFormattedBufferPipeline(); private: @@ -174,7 +174,7 @@ namespace dxvk { VkShaderModule createShaderModule( const SpirvCodeBuffer& code) const; - DxvkMetaCopyPipeline createCopyBufferImagePipeline(); + DxvkMetaCopyPipeline createCopyFormattedBufferPipeline(); DxvkMetaCopyPipeline createPipeline( const DxvkMetaCopyPipelineKey& key);