diff options
| author | Stenzek <stenzek@gmail.com> | 2017-04-16 19:45:22 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2017-04-29 00:14:23 +1000 |
| commit | f4b848949c67ffe99db61e5f4d0b968154e6c5ba (patch) | |
| tree | 8a0a4709aa615f3f46117ff13712d21d3eda6103 /Source/Core/VideoBackends/Vulkan/TextureCache.cpp | |
| parent | bc8a96d713eb0a1fb565f121a5d939b99c2295fa (diff) | |
TextureCache: Support compressed textures and pass pitch/size to upload
This also removes an extra copy of the image for custom textures.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/TextureCache.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/TextureCache.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp index 08c370b48f..62c0228010 100644 --- a/Source/Core/VideoBackends/Vulkan/TextureCache.cpp +++ b/Source/Core/VideoBackends/Vulkan/TextureCache.cpp @@ -341,8 +341,8 @@ TextureCache::TCacheEntry::~TCacheEntry() g_command_buffer_mgr->DeferFramebufferDestruction(m_framebuffer); } -void TextureCache::TCacheEntry::Load(const u8* buffer, unsigned int width, unsigned int height, - unsigned int expanded_width, unsigned int level) +void TextureCache::TCacheEntry::Load(u32 level, u32 width, u32 height, u32 row_length, + const u8* buffer, size_t buffer_size) { // Can't copy data larger than the texture extents. width = std::max(1u, std::min(width, m_texture->GetWidth() >> level)); @@ -371,7 +371,7 @@ void TextureCache::TCacheEntry::Load(const u8* buffer, unsigned int width, unsig u32 upload_pitch = upload_width * sizeof(u32); u32 upload_size = upload_pitch * height; u32 upload_alignment = static_cast<u32>(g_vulkan_context->GetBufferImageGranularity()); - u32 source_pitch = expanded_width * 4; + u32 source_pitch = row_length * 4; if ((upload_size + upload_alignment) <= STAGING_TEXTURE_UPLOAD_THRESHOLD && (upload_size + upload_alignment) <= MAXIMUM_TEXTURE_UPLOAD_BUFFER_SIZE) { |
