diff options
Diffstat (limited to 'src/video_core/engines')
-rw-r--r-- | src/video_core/engines/fermi_2d.cpp | 16 | ||||
-rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 13 |
2 files changed, 21 insertions, 8 deletions
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp index a126c359c..02e161270 100644 --- a/src/video_core/engines/fermi_2d.cpp +++ b/src/video_core/engines/fermi_2d.cpp @@ -77,6 +77,14 @@ void Fermi2D::Blit() { const auto bytes_per_pixel = BytesPerBlock(PixelFormatFromRenderTargetFormat(src.format)); const bool delegate_to_gpu = src.width > 512 && src.height > 512 && bytes_per_pixel <= 8 && src.format != regs.dst.format; + + auto srcX = args.src_x0; + auto srcY = args.src_y0; + if (args.sample_mode.origin == Origin::Corner) { + srcX -= (args.du_dx >> 33) << 32; + srcY -= (args.dv_dy >> 33) << 32; + } + Config config{ .operation = regs.operation, .filter = args.sample_mode.filter, @@ -86,10 +94,10 @@ void Fermi2D::Blit() { .dst_y0 = args.dst_y0, .dst_x1 = args.dst_x0 + args.dst_width, .dst_y1 = args.dst_y0 + args.dst_height, - .src_x0 = static_cast<s32>(args.src_x0 >> 32), - .src_y0 = static_cast<s32>(args.src_y0 >> 32), - .src_x1 = static_cast<s32>((args.du_dx * args.dst_width + args.src_x0) >> 32), - .src_y1 = static_cast<s32>((args.dv_dy * args.dst_height + args.src_y0) >> 32), + .src_x0 = static_cast<s32>(srcX >> 32), + .src_y0 = static_cast<s32>(srcY >> 32), + .src_x1 = static_cast<s32>((srcX + args.du_dx * args.dst_width) >> 32), + .src_y1 = static_cast<s32>((srcY + args.dv_dy * args.dst_height) >> 32), }; const auto need_align_to_pitch = diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 614d61db4..2f986097f 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -4,6 +4,7 @@ #include <cstring> #include <optional> #include "common/assert.h" +#include "common/bit_util.h" #include "common/scope_exit.h" #include "common/settings.h" #include "core/core.h" @@ -222,6 +223,9 @@ void Maxwell3D::ProcessMacro(u32 method, const u32* base_start, u32 amount, bool } void Maxwell3D::RefreshParametersImpl() { + if (!Settings::IsGPULevelHigh()) { + return; + } size_t current_index = 0; for (auto& segment : macro_segments) { if (segment.first == 0) { @@ -259,12 +263,13 @@ u32 Maxwell3D::GetMaxCurrentVertices() { size_t Maxwell3D::EstimateIndexBufferSize() { GPUVAddr start_address = regs.index_buffer.StartAddress(); GPUVAddr end_address = regs.index_buffer.EndAddress(); - static constexpr std::array<size_t, 4> max_sizes = { - std::numeric_limits<u8>::max(), std::numeric_limits<u16>::max(), - std::numeric_limits<u32>::max(), std::numeric_limits<u32>::max()}; + static constexpr std::array<size_t, 3> max_sizes = {std::numeric_limits<u8>::max(), + std::numeric_limits<u16>::max(), + std::numeric_limits<u32>::max()}; const size_t byte_size = regs.index_buffer.FormatSizeInBytes(); + const size_t log2_byte_size = Common::Log2Ceil64(byte_size); return std::min<size_t>( - memory_manager.GetMemoryLayoutSize(start_address, byte_size * max_sizes[byte_size]) / + memory_manager.GetMemoryLayoutSize(start_address, byte_size * max_sizes[log2_byte_size]) / byte_size, static_cast<size_t>(end_address - start_address)); } |