diff options
author | bunnei <bunneidev@gmail.com> | 2021-05-16 06:32:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-16 06:32:37 +0200 |
commit | a1138028a82d61f2cad2305686bf720966fabef9 (patch) | |
tree | ccb610c430c6e99a8a87c088d54c46d032b4fe88 /src/video_core/renderer_vulkan/vk_texture_cache.cpp | |
parent | Merge pull request #6244 from german77/sdlmotion (diff) | |
parent | texture_cache: Handle out of bound texture blits (diff) | |
download | yuzu-a1138028a82d61f2cad2305686bf720966fabef9.tar yuzu-a1138028a82d61f2cad2305686bf720966fabef9.tar.gz yuzu-a1138028a82d61f2cad2305686bf720966fabef9.tar.bz2 yuzu-a1138028a82d61f2cad2305686bf720966fabef9.tar.lz yuzu-a1138028a82d61f2cad2305686bf720966fabef9.tar.xz yuzu-a1138028a82d61f2cad2305686bf720966fabef9.tar.zst yuzu-a1138028a82d61f2cad2305686bf720966fabef9.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_texture_cache.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 017348e05..bdd0ce8bc 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -490,8 +490,7 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im write_barrier); } -[[nodiscard]] VkImageBlit MakeImageBlit(const std::array<Offset2D, 2>& dst_region, - const std::array<Offset2D, 2>& src_region, +[[nodiscard]] VkImageBlit MakeImageBlit(const Region2D& dst_region, const Region2D& src_region, const VkImageSubresourceLayers& dst_layers, const VkImageSubresourceLayers& src_layers) { return VkImageBlit{ @@ -499,13 +498,13 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im .srcOffsets = { { - .x = src_region[0].x, - .y = src_region[0].y, + .x = src_region.start.x, + .y = src_region.start.y, .z = 0, }, { - .x = src_region[1].x, - .y = src_region[1].y, + .x = src_region.end.x, + .y = src_region.end.y, .z = 1, }, }, @@ -513,42 +512,42 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im .dstOffsets = { { - .x = dst_region[0].x, - .y = dst_region[0].y, + .x = dst_region.start.x, + .y = dst_region.start.y, .z = 0, }, { - .x = dst_region[1].x, - .y = dst_region[1].y, + .x = dst_region.end.x, + .y = dst_region.end.y, .z = 1, }, }, }; } -[[nodiscard]] VkImageResolve MakeImageResolve(const std::array<Offset2D, 2>& dst_region, - const std::array<Offset2D, 2>& src_region, +[[nodiscard]] VkImageResolve MakeImageResolve(const Region2D& dst_region, + const Region2D& src_region, const VkImageSubresourceLayers& dst_layers, const VkImageSubresourceLayers& src_layers) { return VkImageResolve{ .srcSubresource = src_layers, .srcOffset = { - .x = src_region[0].x, - .y = src_region[0].y, + .x = src_region.start.x, + .y = src_region.start.y, .z = 0, }, .dstSubresource = dst_layers, .dstOffset = { - .x = dst_region[0].x, - .y = dst_region[0].y, + .x = dst_region.start.x, + .y = dst_region.start.y, .z = 0, }, .extent = { - .width = static_cast<u32>(dst_region[1].x - dst_region[0].x), - .height = static_cast<u32>(dst_region[1].y - dst_region[0].y), + .width = static_cast<u32>(dst_region.end.x - dst_region.start.x), + .height = static_cast<u32>(dst_region.end.y - dst_region.start.y), .depth = 1, }, }; @@ -602,8 +601,7 @@ StagingBufferRef TextureCacheRuntime::DownloadStagingBuffer(size_t size) { } void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst, ImageView& src, - const std::array<Offset2D, 2>& dst_region, - const std::array<Offset2D, 2>& src_region, + const Region2D& dst_region, const Region2D& src_region, Tegra::Engines::Fermi2D::Filter filter, Tegra::Engines::Fermi2D::Operation operation) { const VkImageAspectFlags aspect_mask = ImageAspectMask(src.format); |