summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_rasterizer.cpp
diff options
context:
space:
mode:
authorFeng Chen <vonchenplus@gmail.com>2023-01-05 05:28:48 +0100
committerFeng Chen <vonchenplus@gmail.com>2023-01-05 05:41:33 +0100
commit013b6891531b37e0f882b8b88d404feb63370617 (patch)
treecbfeebc7a015f15004028056c8932c000201e1fc /src/video_core/renderer_vulkan/vk_rasterizer.cpp
parentvideo_core: Implement maxwell3d draw texture method (diff)
downloadyuzu-013b6891531b37e0f882b8b88d404feb63370617.tar
yuzu-013b6891531b37e0f882b8b88d404feb63370617.tar.gz
yuzu-013b6891531b37e0f882b8b88d404feb63370617.tar.bz2
yuzu-013b6891531b37e0f882b8b88d404feb63370617.tar.lz
yuzu-013b6891531b37e0f882b8b88d404feb63370617.tar.xz
yuzu-013b6891531b37e0f882b8b88d404feb63370617.tar.zst
yuzu-013b6891531b37e0f882b8b88d404feb63370617.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index 242bf9602..153096fa4 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -265,6 +265,34 @@ void RasterizerVulkan::DrawIndirect() {
buffer_cache.SetDrawIndirect(nullptr);
}
+void RasterizerVulkan::DrawTexture() {
+ MICROPROFILE_SCOPE(Vulkan_Drawing);
+
+ SCOPE_EXIT({ gpu.TickWork(); });
+ FlushWork();
+
+ query_cache.UpdateCounters();
+
+ texture_cache.SynchronizeGraphicsDescriptors();
+ texture_cache.UpdateRenderTargets(false);
+
+ UpdateDynamicStates();
+
+ const auto& draw_texture_state = maxwell3d->draw_manager->GetDrawTextureState();
+ const auto& sampler = texture_cache.GetGraphicsSampler(draw_texture_state.src_sampler);
+ const auto& texture = texture_cache.GetImageView(draw_texture_state.src_texture);
+ Region2D dst_region = {Offset2D{.x = static_cast<s32>(draw_texture_state.dst_x0),
+ .y = static_cast<s32>(draw_texture_state.dst_y0)},
+ Offset2D{.x = static_cast<s32>(draw_texture_state.dst_x1),
+ .y = static_cast<s32>(draw_texture_state.dst_y1)}};
+ Region2D src_region = {Offset2D{.x = static_cast<s32>(draw_texture_state.src_x0),
+ .y = static_cast<s32>(draw_texture_state.src_y0)},
+ Offset2D{.x = static_cast<s32>(draw_texture_state.src_x1),
+ .y = static_cast<s32>(draw_texture_state.src_y1)}};
+ blit_image.BlitColor(texture_cache.GetFramebuffer(), texture.RenderTarget(), sampler->Handle(),
+ dst_region, src_region, texture.size);
+}
+
void RasterizerVulkan::Clear(u32 layer_count) {
MICROPROFILE_SCOPE(Vulkan_Clearing);