diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-01-19 20:58:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-19 20:58:53 +0100 |
commit | 475370c8f89002e3b508eb152b981a5b89049d68 (patch) | |
tree | 79a145e24f2bf5ab5baca6824cae6cd525a8d170 /src/video_core/engines/draw_manager.cpp | |
parent | Merge pull request #9623 from liamwhite/wp-oops (diff) | |
parent | Address feedback (diff) | |
download | yuzu-475370c8f89002e3b508eb152b981a5b89049d68.tar yuzu-475370c8f89002e3b508eb152b981a5b89049d68.tar.gz yuzu-475370c8f89002e3b508eb152b981a5b89049d68.tar.bz2 yuzu-475370c8f89002e3b508eb152b981a5b89049d68.tar.lz yuzu-475370c8f89002e3b508eb152b981a5b89049d68.tar.xz yuzu-475370c8f89002e3b508eb152b981a5b89049d68.tar.zst yuzu-475370c8f89002e3b508eb152b981a5b89049d68.zip |
Diffstat (limited to 'src/video_core/engines/draw_manager.cpp')
-rw-r--r-- | src/video_core/engines/draw_manager.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/video_core/engines/draw_manager.cpp b/src/video_core/engines/draw_manager.cpp index 2437121ce..1d22d25f1 100644 --- a/src/video_core/engines/draw_manager.cpp +++ b/src/video_core/engines/draw_manager.cpp @@ -51,6 +51,10 @@ void DrawManager::ProcessMethodCall(u32 method, u32 argument) { LOG_WARNING(HW_GPU, "(STUBBED) called"); break; } + case MAXWELL3D_REG_INDEX(draw_texture.src_y0): { + DrawTexture(); + break; + } default: break; } @@ -179,6 +183,33 @@ void DrawManager::DrawIndexSmall(u32 argument) { ProcessDraw(true, 1); } +void DrawManager::DrawTexture() { + const auto& regs{maxwell3d->regs}; + draw_texture_state.dst_x0 = static_cast<float>(regs.draw_texture.dst_x0) / 4096.f; + draw_texture_state.dst_y0 = static_cast<float>(regs.draw_texture.dst_y0) / 4096.f; + const auto dst_width = static_cast<float>(regs.draw_texture.dst_width) / 4096.f; + const auto dst_height = static_cast<float>(regs.draw_texture.dst_height) / 4096.f; + const bool lower_left{regs.window_origin.mode != + Maxwell3D::Regs::WindowOrigin::Mode::UpperLeft}; + if (lower_left) { + draw_texture_state.dst_y0 -= dst_height; + } + draw_texture_state.dst_x1 = draw_texture_state.dst_x0 + dst_width; + draw_texture_state.dst_y1 = draw_texture_state.dst_y0 + dst_height; + draw_texture_state.src_x0 = static_cast<float>(regs.draw_texture.src_x0) / 4096.f; + draw_texture_state.src_y0 = static_cast<float>(regs.draw_texture.src_y0) / 4096.f; + draw_texture_state.src_x1 = + (static_cast<float>(regs.draw_texture.dx_du) / 4294967296.f) * dst_width + + draw_texture_state.src_x0; + draw_texture_state.src_y1 = + (static_cast<float>(regs.draw_texture.dy_dv) / 4294967296.f) * dst_height + + draw_texture_state.src_y0; + draw_texture_state.src_sampler = regs.draw_texture.src_sampler; + draw_texture_state.src_texture = regs.draw_texture.src_texture; + + maxwell3d->rasterizer->DrawTexture(); +} + void DrawManager::UpdateTopology() { const auto& regs{maxwell3d->regs}; switch (regs.primitive_topology_control) { |