diff options
author | Liam <byteslice@airmail.cc> | 2023-04-20 05:25:00 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-04-22 16:35:26 +0200 |
commit | eb7c2314f69b50a171944cbd4ef49f3b765e5b2d (patch) | |
tree | 365b5479fc62f8b5731973c2400b0667d3864f85 /src/video_core/engines | |
parent | Merge pull request #10057 from liamwhite/its-not-in-the-timeline (diff) | |
download | yuzu-eb7c2314f69b50a171944cbd4ef49f3b765e5b2d.tar yuzu-eb7c2314f69b50a171944cbd4ef49f3b765e5b2d.tar.gz yuzu-eb7c2314f69b50a171944cbd4ef49f3b765e5b2d.tar.bz2 yuzu-eb7c2314f69b50a171944cbd4ef49f3b765e5b2d.tar.lz yuzu-eb7c2314f69b50a171944cbd4ef49f3b765e5b2d.tar.xz yuzu-eb7c2314f69b50a171944cbd4ef49f3b765e5b2d.tar.zst yuzu-eb7c2314f69b50a171944cbd4ef49f3b765e5b2d.zip |
Diffstat (limited to 'src/video_core/engines')
-rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 614d61db4..0932fadc2 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" @@ -259,12 +260,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)); } |