summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/CMakeLists.txt11
-rw-r--r--src/audio_core/sink/sink_stream.cpp8
-rw-r--r--src/audio_core/sink/sink_stream.h2
-rw-r--r--src/common/intrusive_red_black_tree.h8
-rw-r--r--src/common/typed_address.h5
-rw-r--r--src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp10
-rw-r--r--src/core/internal_network/socket_proxy.h3
-rw-r--r--src/core/internal_network/sockets.h13
-rw-r--r--src/input_common/drivers/mouse.cpp2
-rw-r--r--src/video_core/engines/maxwell_3d.h8
-rw-r--r--src/video_core/texture_cache/image_info.cpp88
-rw-r--r--src/video_core/texture_cache/image_info.h7
-rw-r--r--src/video_core/texture_cache/texture_cache.h4
-rw-r--r--src/web_service/verify_login.cpp2
-rw-r--r--src/yuzu/configuration/configure_general.ui2
-rw-r--r--src/yuzu_cmd/default_ini.h2
16 files changed, 85 insertions, 90 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0eca8e90e..312a49f42 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -126,6 +126,17 @@ else()
add_compile_options("-stdlib=libc++")
endif()
+ # GCC bugs
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ # These diagnostics would be great if they worked, but are just completely broken
+ # and produce bogus errors on external libraries like fmt.
+ add_compile_options(
+ -Wno-array-bounds
+ -Wno-stringop-overread
+ -Wno-stringop-overflow
+ )
+ endif()
+
# Set file offset size to 64 bits.
#
# On modern Unixes, this is typically already the case. The lone exception is
diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp
index f99dbd8ec..13ba26e74 100644
--- a/src/audio_core/sink/sink_stream.cpp
+++ b/src/audio_core/sink/sink_stream.cpp
@@ -252,8 +252,7 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz
{
std::scoped_lock lk{sample_count_lock};
- last_sample_count_update_time =
- Core::Timing::CyclesToUs(system.CoreTiming().GetClockTicks());
+ last_sample_count_update_time = system.CoreTiming().GetGlobalTimeNs();
min_played_sample_count = max_played_sample_count;
max_played_sample_count += actual_frames_written;
}
@@ -261,12 +260,13 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz
u64 SinkStream::GetExpectedPlayedSampleCount() {
std::scoped_lock lk{sample_count_lock};
- auto cur_time{Core::Timing::CyclesToUs(system.CoreTiming().GetClockTicks())};
+ auto cur_time{system.CoreTiming().GetGlobalTimeNs()};
auto time_delta{cur_time - last_sample_count_update_time};
auto exp_played_sample_count{min_played_sample_count +
(TargetSampleRate * time_delta) / std::chrono::seconds{1}};
- return std::min<u64>(exp_played_sample_count, max_played_sample_count);
+ // Add 15ms of latency in sample reporting to allow for some leeway in scheduler timings
+ return std::min<u64>(exp_played_sample_count, max_played_sample_count) + TargetSampleCount * 3;
}
void SinkStream::WaitFreeSpace() {
diff --git a/src/audio_core/sink/sink_stream.h b/src/audio_core/sink/sink_stream.h
index 23e289c7b..21b5b40a1 100644
--- a/src/audio_core/sink/sink_stream.h
+++ b/src/audio_core/sink/sink_stream.h
@@ -246,7 +246,7 @@ private:
/// Maximum number of total samples that can be played since the last callback
u64 max_played_sample_count{};
/// The time the two above tracking variables were last written to
- std::chrono::microseconds last_sample_count_update_time{};
+ std::chrono::nanoseconds last_sample_count_update_time{};
/// Set by the audio render/in/out system which uses this stream
f32 system_volume{1.0f};
/// Set via IAudioDevice service calls
diff --git a/src/common/intrusive_red_black_tree.h b/src/common/intrusive_red_black_tree.h
index 5f6b34e82..bc2940fa0 100644
--- a/src/common/intrusive_red_black_tree.h
+++ b/src/common/intrusive_red_black_tree.h
@@ -96,10 +96,6 @@ public:
return m_node == rhs.m_node;
}
- constexpr bool operator!=(const Iterator& rhs) const {
- return !(*this == rhs);
- }
-
constexpr pointer operator->() const {
return m_node;
}
@@ -324,10 +320,6 @@ public:
return m_impl == rhs.m_impl;
}
- constexpr bool operator!=(const Iterator& rhs) const {
- return !(*this == rhs);
- }
-
constexpr pointer operator->() const {
return Traits::GetParent(std::addressof(*m_impl));
}
diff --git a/src/common/typed_address.h b/src/common/typed_address.h
index cf7bbeae1..64f4a07c2 100644
--- a/src/common/typed_address.h
+++ b/src/common/typed_address.h
@@ -116,7 +116,6 @@ public:
// Comparison operators.
constexpr bool operator==(const TypedAddress&) const = default;
- constexpr bool operator!=(const TypedAddress&) const = default;
constexpr auto operator<=>(const TypedAddress&) const = default;
// For convenience, also define comparison operators versus uint64_t.
@@ -124,10 +123,6 @@ public:
return m_address == rhs;
}
- constexpr inline bool operator!=(uint64_t rhs) const {
- return m_address != rhs;
- }
-
// Allow getting the address explicitly, for use in accessors.
constexpr inline uint64_t GetValue() const {
return m_address;
diff --git a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp
index 42d1fcc28..36d0d20d2 100644
--- a/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp
+++ b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp
@@ -35,11 +35,11 @@ namespace {
using namespace Common::Literals;
u32 GetMemorySizeForInit() {
- return Settings::values.use_extended_memory_layout ? Smc::MemorySize_6GB : Smc::MemorySize_4GB;
+ return Settings::values.use_extended_memory_layout ? Smc::MemorySize_8GB : Smc::MemorySize_4GB;
}
Smc::MemoryArrangement GetMemoryArrangeForInit() {
- return Settings::values.use_extended_memory_layout ? Smc::MemoryArrangement_6GB
+ return Settings::values.use_extended_memory_layout ? Smc::MemoryArrangement_8GB
: Smc::MemoryArrangement_4GB;
}
} // namespace
@@ -91,7 +91,8 @@ std::size_t KSystemControl::Init::GetApplicationPoolSize() {
case Smc::MemoryArrangement_6GBForAppletDev:
return 3285_MiB;
case Smc::MemoryArrangement_8GB:
- return 4916_MiB;
+ // Real kernel sets this to 4916_MiB. We are not debugging applets.
+ return 6547_MiB;
}
}();
@@ -115,7 +116,8 @@ size_t KSystemControl::Init::GetAppletPoolSize() {
case Smc::MemoryArrangement_6GBForAppletDev:
return 2193_MiB;
case Smc::MemoryArrangement_8GB:
- return 2193_MiB;
+ //! Real kernel sets this to 2193_MiB. We are not debugging applets.
+ return 562_MiB;
}
}();
diff --git a/src/core/internal_network/socket_proxy.h b/src/core/internal_network/socket_proxy.h
index 9421492bc..6e991fa38 100644
--- a/src/core/internal_network/socket_proxy.h
+++ b/src/core/internal_network/socket_proxy.h
@@ -16,9 +16,6 @@ namespace Network {
class ProxySocket : public SocketBase {
public:
- YUZU_NON_COPYABLE(ProxySocket);
- YUZU_NON_MOVEABLE(ProxySocket);
-
explicit ProxySocket(RoomNetwork& room_network_) noexcept;
~ProxySocket() override;
diff --git a/src/core/internal_network/sockets.h b/src/core/internal_network/sockets.h
index 4c7489258..11e479e50 100644
--- a/src/core/internal_network/sockets.h
+++ b/src/core/internal_network/sockets.h
@@ -36,13 +36,10 @@ public:
SocketBase() = default;
explicit SocketBase(SOCKET fd_) : fd{fd_} {}
-
virtual ~SocketBase() = default;
- virtual SocketBase& operator=(const SocketBase&) = delete;
-
- // Avoid closing sockets implicitly
- virtual SocketBase& operator=(SocketBase&&) noexcept = delete;
+ YUZU_NON_COPYABLE(SocketBase);
+ YUZU_NON_MOVEABLE(SocketBase);
virtual Errno Initialize(Domain domain, Type type, Protocol protocol) = 0;
@@ -109,14 +106,8 @@ public:
~Socket() override;
- Socket(const Socket&) = delete;
- Socket& operator=(const Socket&) = delete;
-
Socket(Socket&& rhs) noexcept;
- // Avoid closing sockets implicitly
- Socket& operator=(Socket&&) noexcept = delete;
-
Errno Initialize(Domain domain, Type type, Protocol protocol) override;
Errno Close() override;
diff --git a/src/input_common/drivers/mouse.cpp b/src/input_common/drivers/mouse.cpp
index 4fb2a6cfa..0c9f642bb 100644
--- a/src/input_common/drivers/mouse.cpp
+++ b/src/input_common/drivers/mouse.cpp
@@ -135,7 +135,7 @@ void Mouse::Move(int x, int y, int center_x, int center_y) {
auto mouse_change =
(Common::MakeVec(x, y) - Common::MakeVec(center_x, center_y)).Cast<float>();
- last_motion_change += {-mouse_change.y, -mouse_change.x, last_motion_change.z};
+ last_motion_change += {-mouse_change.y, -mouse_change.x, 0};
const auto move_distance = mouse_change.Length();
if (move_distance == 0) {
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index c89969bb4..6c19354e1 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -856,8 +856,8 @@ public:
struct ZetaSize {
enum class DimensionControl : u32 {
- DepthDefinesArray = 0,
- ArraySizeOne = 1,
+ DefineArraySize = 0,
+ ArraySizeIsOne = 1,
};
u32 width;
@@ -1104,8 +1104,8 @@ public:
struct TileMode {
enum class DimensionControl : u32 {
- DepthDefinesArray = 0,
- DepthDefinesDepth = 1,
+ DefineArraySize = 0,
+ DefineDepthSize = 1,
};
union {
BitField<0, 4, u32> block_width;
diff --git a/src/video_core/texture_cache/image_info.cpp b/src/video_core/texture_cache/image_info.cpp
index a1296b574..11f3f78a1 100644
--- a/src/video_core/texture_cache/image_info.cpp
+++ b/src/video_core/texture_cache/image_info.cpp
@@ -14,6 +14,7 @@
namespace VideoCommon {
+using Tegra::Engines::Fermi2D;
using Tegra::Engines::Maxwell3D;
using Tegra::Texture::TextureType;
using Tegra::Texture::TICEntry;
@@ -114,86 +115,89 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept {
}
}
-ImageInfo::ImageInfo(const Maxwell3D::Regs& regs, size_t index) noexcept {
- const auto& rt = regs.rt[index];
- format = VideoCore::Surface::PixelFormatFromRenderTargetFormat(rt.format);
+ImageInfo::ImageInfo(const Maxwell3D::Regs::RenderTargetConfig& ct,
+ Tegra::Texture::MsaaMode msaa_mode) noexcept {
+ format = VideoCore::Surface::PixelFormatFromRenderTargetFormat(ct.format);
rescaleable = false;
- if (rt.tile_mode.is_pitch_linear) {
- ASSERT(rt.tile_mode.dim_control ==
- Maxwell3D::Regs::TileMode::DimensionControl::DepthDefinesArray);
+ if (ct.tile_mode.is_pitch_linear) {
+ ASSERT(ct.tile_mode.dim_control ==
+ Maxwell3D::Regs::TileMode::DimensionControl::DefineArraySize);
type = ImageType::Linear;
- pitch = rt.width;
+ pitch = ct.width;
size = Extent3D{
.width = pitch / BytesPerBlock(format),
- .height = rt.height,
+ .height = ct.height,
.depth = 1,
};
return;
}
- size.width = rt.width;
- size.height = rt.height;
- layer_stride = rt.array_pitch * 4;
+ size.width = ct.width;
+ size.height = ct.height;
+ layer_stride = ct.array_pitch * 4;
maybe_unaligned_layer_stride = layer_stride;
- num_samples = NumSamples(regs.anti_alias_samples_mode);
+ num_samples = NumSamples(msaa_mode);
block = Extent3D{
- .width = rt.tile_mode.block_width,
- .height = rt.tile_mode.block_height,
- .depth = rt.tile_mode.block_depth,
+ .width = ct.tile_mode.block_width,
+ .height = ct.tile_mode.block_height,
+ .depth = ct.tile_mode.block_depth,
};
- if (rt.tile_mode.dim_control ==
- Maxwell3D::Regs::TileMode::DimensionControl::DepthDefinesDepth) {
+ if (ct.tile_mode.dim_control == Maxwell3D::Regs::TileMode::DimensionControl::DefineDepthSize) {
type = ImageType::e3D;
- size.depth = rt.depth;
+ size.depth = ct.depth;
} else {
rescaleable = block.depth == 0;
rescaleable &= size.height > 256;
downscaleable = size.height > 512;
type = ImageType::e2D;
- resources.layers = rt.depth;
+ resources.layers = ct.depth;
}
}
-ImageInfo::ImageInfo(const Tegra::Engines::Maxwell3D::Regs& regs) noexcept {
- format = VideoCore::Surface::PixelFormatFromDepthFormat(regs.zeta.format);
- size.width = regs.zeta_size.width;
- size.height = regs.zeta_size.height;
+ImageInfo::ImageInfo(const Maxwell3D::Regs::Zeta& zt, const Maxwell3D::Regs::ZetaSize& zt_size,
+ Tegra::Texture::MsaaMode msaa_mode) noexcept {
+ format = VideoCore::Surface::PixelFormatFromDepthFormat(zt.format);
+ size.width = zt_size.width;
+ size.height = zt_size.height;
rescaleable = false;
resources.levels = 1;
- layer_stride = regs.zeta.array_pitch * 4;
+ layer_stride = zt.array_pitch * 4;
maybe_unaligned_layer_stride = layer_stride;
- num_samples = NumSamples(regs.anti_alias_samples_mode);
+ num_samples = NumSamples(msaa_mode);
block = Extent3D{
- .width = regs.zeta.tile_mode.block_width,
- .height = regs.zeta.tile_mode.block_height,
- .depth = regs.zeta.tile_mode.block_depth,
+ .width = zt.tile_mode.block_width,
+ .height = zt.tile_mode.block_height,
+ .depth = zt.tile_mode.block_depth,
};
- if (regs.zeta.tile_mode.is_pitch_linear) {
- ASSERT(regs.zeta.tile_mode.dim_control ==
- Maxwell3D::Regs::TileMode::DimensionControl::DepthDefinesArray);
+ if (zt.tile_mode.is_pitch_linear) {
+ ASSERT(zt.tile_mode.dim_control ==
+ Maxwell3D::Regs::TileMode::DimensionControl::DefineArraySize);
type = ImageType::Linear;
pitch = size.width * BytesPerBlock(format);
- } else if (regs.zeta.tile_mode.dim_control ==
- Maxwell3D::Regs::TileMode::DimensionControl::DepthDefinesDepth) {
- ASSERT(regs.zeta.tile_mode.is_pitch_linear == 0);
- ASSERT(regs.zeta_size.dim_control ==
- Maxwell3D::Regs::ZetaSize::DimensionControl::ArraySizeOne);
+ } else if (zt.tile_mode.dim_control ==
+ Maxwell3D::Regs::TileMode::DimensionControl::DefineDepthSize) {
+ ASSERT(zt_size.dim_control == Maxwell3D::Regs::ZetaSize::DimensionControl::ArraySizeIsOne);
type = ImageType::e3D;
- size.depth = regs.zeta_size.depth;
+ size.depth = zt_size.depth;
} else {
- ASSERT(regs.zeta_size.dim_control ==
- Maxwell3D::Regs::ZetaSize::DimensionControl::DepthDefinesArray);
rescaleable = block.depth == 0;
downscaleable = size.height > 512;
type = ImageType::e2D;
- resources.layers = regs.zeta_size.depth;
+ switch (zt_size.dim_control) {
+ case Maxwell3D::Regs::ZetaSize::DimensionControl::DefineArraySize:
+ resources.layers = zt_size.depth;
+ break;
+ case Maxwell3D::Regs::ZetaSize::DimensionControl::ArraySizeIsOne:
+ resources.layers = 1;
+ break;
+ }
}
}
-ImageInfo::ImageInfo(const Tegra::Engines::Fermi2D::Surface& config) noexcept {
+ImageInfo::ImageInfo(const Fermi2D::Surface& config) noexcept {
UNIMPLEMENTED_IF_MSG(config.layer != 0, "Surface layer is not zero");
format = VideoCore::Surface::PixelFormatFromRenderTargetFormat(config.format);
rescaleable = false;
- if (config.linear == Tegra::Engines::Fermi2D::MemoryLayout::Pitch) {
+ if (config.linear == Fermi2D::MemoryLayout::Pitch) {
type = ImageType::Linear;
size = Extent3D{
.width = config.pitch / VideoCore::Surface::BytesPerBlock(format),
diff --git a/src/video_core/texture_cache/image_info.h b/src/video_core/texture_cache/image_info.h
index a12f5b44f..4b7dfa315 100644
--- a/src/video_core/texture_cache/image_info.h
+++ b/src/video_core/texture_cache/image_info.h
@@ -17,8 +17,11 @@ using VideoCore::Surface::PixelFormat;
struct ImageInfo {
ImageInfo() = default;
explicit ImageInfo(const TICEntry& config) noexcept;
- explicit ImageInfo(const Tegra::Engines::Maxwell3D::Regs& regs, size_t index) noexcept;
- explicit ImageInfo(const Tegra::Engines::Maxwell3D::Regs& regs) noexcept;
+ explicit ImageInfo(const Tegra::Engines::Maxwell3D::Regs::RenderTargetConfig& ct,
+ Tegra::Texture::MsaaMode msaa_mode) noexcept;
+ explicit ImageInfo(const Tegra::Engines::Maxwell3D::Regs::Zeta& zt,
+ const Tegra::Engines::Maxwell3D::Regs::ZetaSize& zt_size,
+ Tegra::Texture::MsaaMode msaa_mode) noexcept;
explicit ImageInfo(const Tegra::Engines::Fermi2D::Surface& config) noexcept;
explicit ImageInfo(const Tegra::DMA::ImageOperand& config) noexcept;
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 62fb98b55..ed5c768d8 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -1503,7 +1503,7 @@ ImageViewId TextureCache<P>::FindColorBuffer(size_t index, bool is_clear) {
if (rt.format == Tegra::RenderTargetFormat::NONE) {
return ImageViewId{};
}
- const ImageInfo info(regs, index);
+ const ImageInfo info(regs.rt[index], regs.anti_alias_samples_mode);
return FindRenderTargetView(info, gpu_addr, is_clear);
}
@@ -1517,7 +1517,7 @@ ImageViewId TextureCache<P>::FindDepthBuffer(bool is_clear) {
if (gpu_addr == 0) {
return ImageViewId{};
}
- const ImageInfo info(regs);
+ const ImageInfo info(regs.zeta, regs.zeta_size, regs.anti_alias_samples_mode);
return FindRenderTargetView(info, gpu_addr, is_clear);
}
diff --git a/src/web_service/verify_login.cpp b/src/web_service/verify_login.cpp
index 050080278..d5b7161cb 100644
--- a/src/web_service/verify_login.cpp
+++ b/src/web_service/verify_login.cpp
@@ -21,7 +21,7 @@ bool VerifyLogin(const std::string& host, const std::string& username, const std
return username.empty();
}
- return username == *iter;
+ return *iter == username;
}
} // namespace WebService
diff --git a/src/yuzu/configuration/configure_general.ui b/src/yuzu/configuration/configure_general.ui
index 6cd79673c..add110bb0 100644
--- a/src/yuzu/configuration/configure_general.ui
+++ b/src/yuzu/configuration/configure_general.ui
@@ -64,7 +64,7 @@
<item>
<widget class="QCheckBox" name="use_extended_memory_layout">
<property name="text">
- <string>Extended memory layout (6GB DRAM)</string>
+ <string>Extended memory layout (8GB DRAM)</string>
</property>
</widget>
</item>
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h
index 20e403400..209cfc28a 100644
--- a/src/yuzu_cmd/default_ini.h
+++ b/src/yuzu_cmd/default_ini.h
@@ -163,7 +163,7 @@ keyboard_enabled =
# 0: Disabled, 1 (default): Enabled
use_multi_core =
-# Enable extended guest system memory layout (6GB DRAM)
+# Enable extended guest system memory layout (8GB DRAM)
# 0 (default): Disabled, 1: Enabled
use_extended_memory_layout =