diff --git a/src/util/opengl_texture.cpp b/src/util/opengl_texture.cpp index 285466b16..45e837352 100644 --- a/src/util/opengl_texture.cpp +++ b/src/util/opengl_texture.cpp @@ -855,10 +855,8 @@ std::unique_ptr OpenGLDevice::CreateTextureBuffer(GPUTextureBu } OpenGLDownloadTexture::OpenGLDownloadTexture(u32 width, u32 height, GPUTexture::Format format, bool imported, - GLuint buffer_id, u8* cpu_buffer, u32 buffer_size, const u8* map_ptr, - u32 map_pitch) - : GPUDownloadTexture(width, height, format, imported), m_buffer_id(buffer_id), m_buffer_size(buffer_size), - m_cpu_buffer(cpu_buffer) + GLuint buffer_id, u8* cpu_buffer, const u8* map_ptr, u32 map_pitch) + : GPUDownloadTexture(width, height, format, imported), m_buffer_id(buffer_id), m_cpu_buffer(cpu_buffer) { m_map_pointer = map_ptr; m_current_pitch = map_pitch; @@ -922,8 +920,8 @@ std::unique_ptr OpenGLDownloadTexture::Create(u32 width, return {}; } - return std::unique_ptr(new OpenGLDownloadTexture( - width, height, format, false, buffer_id, nullptr, buffer_size, buffer_map, buffer_pitch)); + return std::unique_ptr( + new OpenGLDownloadTexture(width, height, format, false, buffer_id, nullptr, buffer_map, buffer_pitch)); } // Fallback to glReadPixels() + CPU buffer. @@ -937,7 +935,7 @@ std::unique_ptr OpenGLDownloadTexture::Create(u32 width, } return std::unique_ptr( - new OpenGLDownloadTexture(width, height, format, imported, 0, cpu_buffer, buffer_size, cpu_buffer, buffer_pitch)); + new OpenGLDownloadTexture(width, height, format, imported, 0, cpu_buffer, cpu_buffer, buffer_pitch)); } void OpenGLDownloadTexture::CopyFromTexture(u32 dst_x, u32 dst_y, GPUTexture* src, u32 src_x, u32 src_y, u32 width, diff --git a/src/util/opengl_texture.h b/src/util/opengl_texture.h index 7b213b89d..bbda8a17f 100644 --- a/src/util/opengl_texture.h +++ b/src/util/opengl_texture.h @@ -133,10 +133,9 @@ public: private: OpenGLDownloadTexture(u32 width, u32 height, GPUTexture::Format format, bool imported, GLuint buffer_id, - u8* cpu_buffer, u32 buffer_size, const u8* map_ptr, u32 map_pitch); + u8* cpu_buffer, const u8* map_ptr, u32 map_pitch); GLuint m_buffer_id = 0; - u32 m_buffer_size = 0; GLsync m_sync = {}; diff --git a/src/util/vulkan_texture.cpp b/src/util/vulkan_texture.cpp index 61ae293ae..87316a11b 100644 --- a/src/util/vulkan_texture.cpp +++ b/src/util/vulkan_texture.cpp @@ -986,9 +986,9 @@ std::unique_ptr VulkanDevice::CreateTextureBuffer(GPUTextureBu VulkanDownloadTexture::VulkanDownloadTexture(u32 width, u32 height, GPUTexture::Format format, VmaAllocation allocation, VkDeviceMemory memory, VkBuffer buffer, VkDeviceSize memory_offset, - VkDeviceSize buffer_size, const u8* map_ptr, u32 map_pitch) + const u8* map_ptr, u32 map_pitch) : GPUDownloadTexture(width, height, format, (memory != VK_NULL_HANDLE)), m_allocation(allocation), m_memory(memory), - m_buffer(buffer), m_memory_offset(memory_offset), m_buffer_size(buffer_size) + m_buffer(buffer), m_memory_offset(memory_offset) { m_map_pointer = map_ptr; m_current_pitch = map_pitch; @@ -1068,8 +1068,8 @@ std::unique_ptr VulkanDownloadTexture::Create(u32 width, map_ptr = static_cast(memory); } - return std::unique_ptr(new VulkanDownloadTexture( - width, height, format, allocation, dev_memory, buffer, memory_offset, buffer_size, map_ptr, map_pitch)); + return std::unique_ptr(new VulkanDownloadTexture(width, height, format, allocation, dev_memory, + buffer, memory_offset, map_ptr, map_pitch)); } void VulkanDownloadTexture::CopyFromTexture(u32 dst_x, u32 dst_y, GPUTexture* src, u32 src_x, u32 src_y, u32 width, diff --git a/src/util/vulkan_texture.h b/src/util/vulkan_texture.h index f1c83ccec..1b612fd0e 100644 --- a/src/util/vulkan_texture.h +++ b/src/util/vulkan_texture.h @@ -182,7 +182,7 @@ public: private: VulkanDownloadTexture(u32 width, u32 height, GPUTexture::Format format, VmaAllocation allocation, - VkDeviceMemory memory, VkBuffer buffer, VkDeviceSize memory_offset, VkDeviceSize buffer_size, + VkDeviceMemory memory, VkBuffer buffer, VkDeviceSize memory_offset, const u8* map_ptr, u32 map_pitch); VmaAllocation m_allocation = VK_NULL_HANDLE; @@ -191,7 +191,6 @@ private: u64 m_copy_fence_counter = 0; VkDeviceSize m_memory_offset = 0; - VkDeviceSize m_buffer_size = 0; bool m_needs_cache_invalidate = false; };