mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 14:52:10 +01:00
[dxvk] Rename DxvkCopyBufferImage* stuff
Slightly misleadning name when we're going to introduce copies between buffers and images.
This commit is contained in:
parent
c92ee8ee07
commit
3c50ac1f12
@ -938,7 +938,7 @@ namespace dxvk {
|
|||||||
srcView = srcBuffer->createView(viewInfo);
|
srcView = srcBuffer->createView(viewInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pipeInfo = m_common->metaCopy().getCopyBufferImagePipeline();
|
auto pipeInfo = m_common->metaCopy().getCopyFormattedBufferPipeline();
|
||||||
VkDescriptorSet descriptorSet = m_descriptorPool->alloc(pipeInfo.dsetLayout);
|
VkDescriptorSet descriptorSet = m_descriptorPool->alloc(pipeInfo.dsetLayout);
|
||||||
|
|
||||||
std::array<VkWriteDescriptorSet, 2> descriptorWrites;
|
std::array<VkWriteDescriptorSet, 2> descriptorWrites;
|
||||||
@ -966,7 +966,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
m_cmd->updateDescriptorSets(descriptorWrites.size(), descriptorWrites.data());
|
m_cmd->updateDescriptorSets(descriptorWrites.size(), descriptorWrites.data());
|
||||||
|
|
||||||
DxvkCopyBufferImageArgs args = { };
|
DxvkFormattedBufferCopyArgs args = { };
|
||||||
args.dstOffset = dstOffset;
|
args.dstOffset = dstOffset;
|
||||||
args.srcOffset = srcOffset;
|
args.srcOffset = srcOffset;
|
||||||
args.extent = extent;
|
args.extent = extent;
|
||||||
@ -3801,7 +3801,7 @@ namespace dxvk {
|
|||||||
VkImageSubresourceLayers srcSubresource,
|
VkImageSubresourceLayers srcSubresource,
|
||||||
VkOffset3D srcOffset,
|
VkOffset3D srcOffset,
|
||||||
VkExtent3D extent) {
|
VkExtent3D extent) {
|
||||||
DxvkMetaCopyFormats viewFormats = m_common->metaCopy().getFormats(
|
DxvkMetaCopyFormats viewFormats = m_common->metaCopy().getCopyImageFormats(
|
||||||
dstImage->info().format, dstSubresource.aspectMask,
|
dstImage->info().format, dstSubresource.aspectMask,
|
||||||
srcImage->info().format, srcSubresource.aspectMask);
|
srcImage->info().format, srcSubresource.aspectMask);
|
||||||
|
|
||||||
@ -3894,7 +3894,7 @@ namespace dxvk {
|
|||||||
srcImage, srcSubresource, viewFormats.srcFormat);
|
srcImage, srcSubresource, viewFormats.srcFormat);
|
||||||
|
|
||||||
// Create pipeline for the copy operation
|
// 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);
|
views.srcImageView->info().viewType, viewFormats.dstFormat, dstImage->info().sampleCount);
|
||||||
|
|
||||||
// Create and initialize descriptor set
|
// Create and initialize descriptor set
|
||||||
|
@ -114,7 +114,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxvkMetaCopyFormats DxvkMetaCopyObjects::getFormats(
|
DxvkMetaCopyFormats DxvkMetaCopyObjects::getCopyImageFormats(
|
||||||
VkFormat dstFormat,
|
VkFormat dstFormat,
|
||||||
VkImageAspectFlags dstAspect,
|
VkImageAspectFlags dstAspect,
|
||||||
VkFormat srcFormat,
|
VkFormat srcFormat,
|
||||||
@ -140,7 +140,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxvkMetaCopyPipeline DxvkMetaCopyObjects::getPipeline(
|
DxvkMetaCopyPipeline DxvkMetaCopyObjects::getCopyImagePipeline(
|
||||||
VkImageViewType viewType,
|
VkImageViewType viewType,
|
||||||
VkFormat dstFormat,
|
VkFormat dstFormat,
|
||||||
VkSampleCountFlagBits dstSamples) {
|
VkSampleCountFlagBits dstSamples) {
|
||||||
@ -161,11 +161,11 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxvkMetaCopyPipeline DxvkMetaCopyObjects::getCopyBufferImagePipeline() {
|
DxvkMetaCopyPipeline DxvkMetaCopyObjects::getCopyFormattedBufferPipeline() {
|
||||||
std::lock_guard<dxvk::mutex> lock(m_mutex);
|
std::lock_guard<dxvk::mutex> lock(m_mutex);
|
||||||
|
|
||||||
if (!m_copyBufferImagePipeline.pipeHandle)
|
if (!m_copyBufferImagePipeline.pipeHandle)
|
||||||
m_copyBufferImagePipeline = createCopyBufferImagePipeline();
|
m_copyBufferImagePipeline = createCopyFormattedBufferPipeline();
|
||||||
|
|
||||||
return m_copyBufferImagePipeline;
|
return m_copyBufferImagePipeline;
|
||||||
}
|
}
|
||||||
@ -184,7 +184,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxvkMetaCopyPipeline DxvkMetaCopyObjects::createCopyBufferImagePipeline() {
|
DxvkMetaCopyPipeline DxvkMetaCopyObjects::createCopyFormattedBufferPipeline() {
|
||||||
DxvkMetaCopyPipeline pipeline;
|
DxvkMetaCopyPipeline pipeline;
|
||||||
|
|
||||||
std::array<VkDescriptorSetLayoutBinding, 2> bindings = {{
|
std::array<VkDescriptorSetLayoutBinding, 2> bindings = {{
|
||||||
@ -199,7 +199,7 @@ namespace dxvk {
|
|||||||
if (m_vkd->vkCreateDescriptorSetLayout(m_vkd->device(), &setLayoutInfo, nullptr, &pipeline.dsetLayout) != VK_SUCCESS)
|
if (m_vkd->vkCreateDescriptorSetLayout(m_vkd->device(), &setLayoutInfo, nullptr, &pipeline.dsetLayout) != VK_SUCCESS)
|
||||||
throw DxvkError("DxvkMetaCopyObjects: Failed to create descriptor set layout");
|
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 };
|
VkPipelineLayoutCreateInfo pipelineLayoutInfo = { VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO };
|
||||||
pipelineLayoutInfo.setLayoutCount = 1;
|
pipelineLayoutInfo.setLayoutCount = 1;
|
||||||
|
@ -17,7 +17,7 @@ namespace dxvk {
|
|||||||
/**
|
/**
|
||||||
* \brief Push constants for buffer image copies
|
* \brief Push constants for buffer image copies
|
||||||
*/
|
*/
|
||||||
struct DxvkCopyBufferImageArgs {
|
struct DxvkFormattedBufferCopyArgs {
|
||||||
VkOffset3D dstOffset; uint32_t pad0;
|
VkOffset3D dstOffset; uint32_t pad0;
|
||||||
VkOffset3D srcOffset; uint32_t pad1;
|
VkOffset3D srcOffset; uint32_t pad1;
|
||||||
VkExtent3D extent; uint32_t pad2;
|
VkExtent3D extent; uint32_t pad2;
|
||||||
@ -29,8 +29,8 @@ namespace dxvk {
|
|||||||
* \brief Pair of view formats for copy operation
|
* \brief Pair of view formats for copy operation
|
||||||
*/
|
*/
|
||||||
struct DxvkMetaCopyFormats {
|
struct DxvkMetaCopyFormats {
|
||||||
VkFormat dstFormat;
|
VkFormat dstFormat = VK_FORMAT_UNDEFINED;
|
||||||
VkFormat srcFormat;
|
VkFormat srcFormat = VK_FORMAT_UNDEFINED;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,9 +40,9 @@ namespace dxvk {
|
|||||||
* that is used for fragment shader copies.
|
* that is used for fragment shader copies.
|
||||||
*/
|
*/
|
||||||
struct DxvkMetaCopyPipeline {
|
struct DxvkMetaCopyPipeline {
|
||||||
VkDescriptorSetLayout dsetLayout;
|
VkDescriptorSetLayout dsetLayout = VK_NULL_HANDLE;
|
||||||
VkPipelineLayout pipeLayout;
|
VkPipelineLayout pipeLayout = VK_NULL_HANDLE;
|
||||||
VkPipeline pipeHandle;
|
VkPipeline pipeHandle = VK_NULL_HANDLE;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -120,7 +120,7 @@ namespace dxvk {
|
|||||||
* \param [in] srcAspect Source aspect mask
|
* \param [in] srcAspect Source aspect mask
|
||||||
* \returns Corresponding color format
|
* \returns Corresponding color format
|
||||||
*/
|
*/
|
||||||
DxvkMetaCopyFormats getFormats(
|
DxvkMetaCopyFormats getCopyImageFormats(
|
||||||
VkFormat dstFormat,
|
VkFormat dstFormat,
|
||||||
VkImageAspectFlags dstAspect,
|
VkImageAspectFlags dstAspect,
|
||||||
VkFormat srcFormat,
|
VkFormat srcFormat,
|
||||||
@ -134,7 +134,7 @@ namespace dxvk {
|
|||||||
* \param [in] dstSamples Destination sample count
|
* \param [in] dstSamples Destination sample count
|
||||||
* \returns Compatible pipeline for the operation
|
* \returns Compatible pipeline for the operation
|
||||||
*/
|
*/
|
||||||
DxvkMetaCopyPipeline getPipeline(
|
DxvkMetaCopyPipeline getCopyImagePipeline(
|
||||||
VkImageViewType viewType,
|
VkImageViewType viewType,
|
||||||
VkFormat dstFormat,
|
VkFormat dstFormat,
|
||||||
VkSampleCountFlagBits dstSamples);
|
VkSampleCountFlagBits dstSamples);
|
||||||
@ -143,7 +143,7 @@ namespace dxvk {
|
|||||||
* \brief Creates pipeline for buffer image copy
|
* \brief Creates pipeline for buffer image copy
|
||||||
* \returns Compute pipeline for buffer image copies
|
* \returns Compute pipeline for buffer image copies
|
||||||
*/
|
*/
|
||||||
DxvkMetaCopyPipeline getCopyBufferImagePipeline();
|
DxvkMetaCopyPipeline getCopyFormattedBufferPipeline();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ namespace dxvk {
|
|||||||
VkShaderModule createShaderModule(
|
VkShaderModule createShaderModule(
|
||||||
const SpirvCodeBuffer& code) const;
|
const SpirvCodeBuffer& code) const;
|
||||||
|
|
||||||
DxvkMetaCopyPipeline createCopyBufferImagePipeline();
|
DxvkMetaCopyPipeline createCopyFormattedBufferPipeline();
|
||||||
|
|
||||||
DxvkMetaCopyPipeline createPipeline(
|
DxvkMetaCopyPipeline createPipeline(
|
||||||
const DxvkMetaCopyPipelineKey& key);
|
const DxvkMetaCopyPipelineKey& key);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user