summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio_core/renderer/system.cpp5
-rw-r--r--src/common/address_space.inc2
-rw-r--r--src/core/hid/emulated_controller.cpp4
-rw-r--r--src/video_core/shader_cache.cpp4
-rw-r--r--src/video_core/shader_environment.cpp16
-rw-r--r--src/video_core/shader_environment.h6
6 files changed, 22 insertions, 15 deletions
diff --git a/src/audio_core/renderer/system.cpp b/src/audio_core/renderer/system.cpp
index ad869facb..53b258c4f 100644
--- a/src/audio_core/renderer/system.cpp
+++ b/src/audio_core/renderer/system.cpp
@@ -436,10 +436,7 @@ void System::Stop() {
436 } 436 }
437 437
438 if (execution_mode == ExecutionMode::Auto) { 438 if (execution_mode == ExecutionMode::Auto) {
439 // Should wait for the system to terminate here, but core timing (should have) already 439 terminate_event.Wait();
440 // stopped, so this isn't needed. Find a way to make this definite.
441
442 // terminate_event.Wait();
443 } 440 }
444} 441}
445 442
diff --git a/src/common/address_space.inc b/src/common/address_space.inc
index 2195dabd5..c97dc8651 100644
--- a/src/common/address_space.inc
+++ b/src/common/address_space.inc
@@ -72,7 +72,7 @@ MAP_MEMBER(void)::MapLocked(VaType virt, PaType phys, VaType size, ExtraBlockInf
72 } 72 }
73 }()}; 73 }()};
74 74
75 if (block_end_predecessor->virt >= virt) { 75 if (block_end_predecessor != blocks.begin() && block_end_predecessor->virt >= virt) {
76 // If this block's start would be overlapped by the map then reuse it as a tail 76 // If this block's start would be overlapped by the map then reuse it as a tail
77 // block 77 // block
78 block_end_predecessor->virt = virt_end; 78 block_end_predecessor->virt = virt_end;
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index a5c2e3db8..ecab85893 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -552,6 +552,8 @@ void EmulatedController::EnableSystemButtons() {
552void EmulatedController::DisableSystemButtons() { 552void EmulatedController::DisableSystemButtons() {
553 std::scoped_lock lock{mutex}; 553 std::scoped_lock lock{mutex};
554 system_buttons_enabled = false; 554 system_buttons_enabled = false;
555 controller.home_button_state.raw = 0;
556 controller.capture_button_state.raw = 0;
555} 557}
556 558
557void EmulatedController::ResetSystemButtons() { 559void EmulatedController::ResetSystemButtons() {
@@ -735,6 +737,8 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback
735 if (is_configuring) { 737 if (is_configuring) {
736 controller.npad_button_state.raw = NpadButton::None; 738 controller.npad_button_state.raw = NpadButton::None;
737 controller.debug_pad_button_state.raw = 0; 739 controller.debug_pad_button_state.raw = 0;
740 controller.home_button_state.raw = 0;
741 controller.capture_button_state.raw = 0;
738 lock.unlock(); 742 lock.unlock();
739 TriggerOnChange(ControllerTriggerType::Button, false); 743 TriggerOnChange(ControllerTriggerType::Button, false);
740 return; 744 return;
diff --git a/src/video_core/shader_cache.cpp b/src/video_core/shader_cache.cpp
index d9482371b..c5213875b 100644
--- a/src/video_core/shader_cache.cpp
+++ b/src/video_core/shader_cache.cpp
@@ -228,14 +228,14 @@ const ShaderInfo* ShaderCache::MakeShaderInfo(GenericEnvironment& env, VAddr cpu
228 auto info = std::make_unique<ShaderInfo>(); 228 auto info = std::make_unique<ShaderInfo>();
229 if (const std::optional<u64> cached_hash{env.Analyze()}) { 229 if (const std::optional<u64> cached_hash{env.Analyze()}) {
230 info->unique_hash = *cached_hash; 230 info->unique_hash = *cached_hash;
231 info->size_bytes = env.CachedSize(); 231 info->size_bytes = env.CachedSizeBytes();
232 } else { 232 } else {
233 // Slow path, not really hit on commercial games 233 // Slow path, not really hit on commercial games
234 // Build a control flow graph to get the real shader size 234 // Build a control flow graph to get the real shader size
235 Shader::ObjectPool<Shader::Maxwell::Flow::Block> flow_block; 235 Shader::ObjectPool<Shader::Maxwell::Flow::Block> flow_block;
236 Shader::Maxwell::Flow::CFG cfg{env, flow_block, env.StartAddress()}; 236 Shader::Maxwell::Flow::CFG cfg{env, flow_block, env.StartAddress()};
237 info->unique_hash = env.CalculateHash(); 237 info->unique_hash = env.CalculateHash();
238 info->size_bytes = env.ReadSize(); 238 info->size_bytes = env.ReadSizeBytes();
239 } 239 }
240 const size_t size_bytes{info->size_bytes}; 240 const size_t size_bytes{info->size_bytes};
241 const ShaderInfo* const result{info.get()}; 241 const ShaderInfo* const result{info.get()};
diff --git a/src/video_core/shader_environment.cpp b/src/video_core/shader_environment.cpp
index 574760f80..c7cb56243 100644
--- a/src/video_core/shader_environment.cpp
+++ b/src/video_core/shader_environment.cpp
@@ -170,15 +170,19 @@ std::optional<u64> GenericEnvironment::Analyze() {
170void GenericEnvironment::SetCachedSize(size_t size_bytes) { 170void GenericEnvironment::SetCachedSize(size_t size_bytes) {
171 cached_lowest = start_address; 171 cached_lowest = start_address;
172 cached_highest = start_address + static_cast<u32>(size_bytes); 172 cached_highest = start_address + static_cast<u32>(size_bytes);
173 code.resize(CachedSize()); 173 code.resize(CachedSizeWords());
174 gpu_memory->ReadBlock(program_base + cached_lowest, code.data(), code.size() * sizeof(u64)); 174 gpu_memory->ReadBlock(program_base + cached_lowest, code.data(), code.size() * sizeof(u64));
175} 175}
176 176
177size_t GenericEnvironment::CachedSize() const noexcept { 177size_t GenericEnvironment::CachedSizeWords() const noexcept {
178 return cached_highest - cached_lowest + INST_SIZE; 178 return CachedSizeBytes() / INST_SIZE;
179} 179}
180 180
181size_t GenericEnvironment::ReadSize() const noexcept { 181size_t GenericEnvironment::CachedSizeBytes() const noexcept {
182 return static_cast<size_t>(cached_highest) - cached_lowest + INST_SIZE;
183}
184
185size_t GenericEnvironment::ReadSizeBytes() const noexcept {
182 return read_highest - read_lowest + INST_SIZE; 186 return read_highest - read_lowest + INST_SIZE;
183} 187}
184 188
@@ -187,7 +191,7 @@ bool GenericEnvironment::CanBeSerialized() const noexcept {
187} 191}
188 192
189u64 GenericEnvironment::CalculateHash() const { 193u64 GenericEnvironment::CalculateHash() const {
190 const size_t size{ReadSize()}; 194 const size_t size{ReadSizeBytes()};
191 const auto data{std::make_unique<char[]>(size)}; 195 const auto data{std::make_unique<char[]>(size)};
192 gpu_memory->ReadBlock(program_base + read_lowest, data.get(), size); 196 gpu_memory->ReadBlock(program_base + read_lowest, data.get(), size);
193 return Common::CityHash64(data.get(), size); 197 return Common::CityHash64(data.get(), size);
@@ -198,7 +202,7 @@ void GenericEnvironment::Dump(u64 hash) {
198} 202}
199 203
200void GenericEnvironment::Serialize(std::ofstream& file) const { 204void GenericEnvironment::Serialize(std::ofstream& file) const {
201 const u64 code_size{static_cast<u64>(CachedSize())}; 205 const u64 code_size{static_cast<u64>(CachedSizeBytes())};
202 const u64 num_texture_types{static_cast<u64>(texture_types.size())}; 206 const u64 num_texture_types{static_cast<u64>(texture_types.size())};
203 const u64 num_texture_pixel_formats{static_cast<u64>(texture_pixel_formats.size())}; 207 const u64 num_texture_pixel_formats{static_cast<u64>(texture_pixel_formats.size())};
204 const u64 num_cbuf_values{static_cast<u64>(cbuf_values.size())}; 208 const u64 num_cbuf_values{static_cast<u64>(cbuf_values.size())};
diff --git a/src/video_core/shader_environment.h b/src/video_core/shader_environment.h
index d75987a52..a0f61cbda 100644
--- a/src/video_core/shader_environment.h
+++ b/src/video_core/shader_environment.h
@@ -48,9 +48,11 @@ public:
48 48
49 void SetCachedSize(size_t size_bytes); 49 void SetCachedSize(size_t size_bytes);
50 50
51 [[nodiscard]] size_t CachedSize() const noexcept; 51 [[nodiscard]] size_t CachedSizeWords() const noexcept;
52 52
53 [[nodiscard]] size_t ReadSize() const noexcept; 53 [[nodiscard]] size_t CachedSizeBytes() const noexcept;
54
55 [[nodiscard]] size_t ReadSizeBytes() const noexcept;
54 56
55 [[nodiscard]] bool CanBeSerialized() const noexcept; 57 [[nodiscard]] bool CanBeSerialized() const noexcept;
56 58