From bf46461dd6cdf2fb2a98845ec788e151250492f6 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 21 Oct 2020 23:13:34 +1000 Subject: [PATCH] Common/Vulkan: Remove unused methods in staging texture --- src/common/vulkan/staging_buffer.h | 1 + src/common/vulkan/staging_texture.cpp | 10 ---------- src/common/vulkan/staging_texture.h | 10 ---------- src/common/vulkan/util.cpp | 5 +++++ 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/common/vulkan/staging_buffer.h b/src/common/vulkan/staging_buffer.h index 2d263acd7..421272e52 100644 --- a/src/common/vulkan/staging_buffer.h +++ b/src/common/vulkan/staging_buffer.h @@ -37,6 +37,7 @@ public: ALWAYS_INLINE VkDeviceSize GetMapOffset() const { return m_map_offset; } ALWAYS_INLINE VkDeviceSize GetMapSize() const { return m_map_size; } ALWAYS_INLINE bool IsValid() const { return (m_buffer != VK_NULL_HANDLE); } + ALWAYS_INLINE bool IsCoherent() const { return m_coherent; } bool Map(VkDeviceSize offset = 0, VkDeviceSize size = VK_WHOLE_SIZE); void Unmap(); diff --git a/src/common/vulkan/staging_texture.cpp b/src/common/vulkan/staging_texture.cpp index e9b62d598..43c7b9032 100644 --- a/src/common/vulkan/staging_texture.cpp +++ b/src/common/vulkan/staging_texture.cpp @@ -169,16 +169,6 @@ void StagingTexture::CopyToTexture(u32 src_x, u32 src_y, Texture& dst_texture, u m_flush_fence_counter = g_vulkan_context->GetCurrentFenceCounter(); } -bool StagingTexture::Map() -{ - return m_staging_buffer.Map(); -} - -void StagingTexture::Unmap() -{ - return m_staging_buffer.Unmap(); -} - void StagingTexture::Flush() { if (!m_needs_flush) diff --git a/src/common/vulkan/staging_texture.h b/src/common/vulkan/staging_texture.h index f8d24836f..f2a7b6943 100644 --- a/src/common/vulkan/staging_texture.h +++ b/src/common/vulkan/staging_texture.h @@ -45,16 +45,6 @@ public: void CopyToTexture(u32 src_x, u32 src_y, Texture& dst_texture, u32 dst_x, u32 dst_y, u32 dst_layer, u32 dst_level, u32 width, u32 height); - // Maps the texture into the CPU address space, enabling it to read the contents. - // The Map call may not perform synchronization. If the contents of the staging texture - // has been updated by a CopyFromTexture call, you must call Flush() first. - // If persistent mapping is supported in the backend, this may be a no-op. - bool Map(); - - // Unmaps the CPU-readable copy of the texture. May be a no-op on backends which - // support persistent-mapped buffers. - void Unmap(); - // Flushes pending writes from the CPU to the GPU, and reads from the GPU to the CPU. // This may cause a command buffer flush depending on if one has occurred between the last // call to CopyFromTexture()/CopyToTexture() and the Flush() call. diff --git a/src/common/vulkan/util.cpp b/src/common/vulkan/util.cpp index 222e9ef4f..f7ee2d88d 100644 --- a/src/common/vulkan/util.cpp +++ b/src/common/vulkan/util.cpp @@ -9,6 +9,7 @@ #include "../string_util.h" #include "context.h" #include "shader_compiler.h" +Log_SetChannel(Vulkan::Util); namespace Vulkan { namespace Util { @@ -80,6 +81,10 @@ u32 GetTexelSize(VkFormat format) case VK_FORMAT_B8G8R8A8_UNORM: return 4; + case VK_FORMAT_R5G5B5A1_UNORM_PACK16: + case VK_FORMAT_A1R5G5B5_UNORM_PACK16: + return 2; + case VK_FORMAT_BC1_RGBA_UNORM_BLOCK: return 8;