diff options
Diffstat (limited to 'src')
30 files changed, 80 insertions, 67 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 42d9dd844..f3da525d6 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp | |||
| @@ -43,7 +43,7 @@ void SessionRequestHandler::ClientDisconnected(const SharedPtr<ServerSession>& s | |||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | SharedPtr<WritableEvent> HLERequestContext::SleepClientThread( | 45 | SharedPtr<WritableEvent> HLERequestContext::SleepClientThread( |
| 46 | SharedPtr<Thread> thread, const std::string& reason, u64 timeout, WakeupCallback&& callback, | 46 | const std::string& reason, u64 timeout, WakeupCallback&& callback, |
| 47 | SharedPtr<WritableEvent> writable_event) { | 47 | SharedPtr<WritableEvent> writable_event) { |
| 48 | // Put the client thread to sleep until the wait event is signaled or the timeout expires. | 48 | // Put the client thread to sleep until the wait event is signaled or the timeout expires. |
| 49 | thread->SetWakeupCallback([context = *this, callback]( | 49 | thread->SetWakeupCallback([context = *this, callback]( |
| @@ -76,8 +76,9 @@ SharedPtr<WritableEvent> HLERequestContext::SleepClientThread( | |||
| 76 | return writable_event; | 76 | return writable_event; |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | HLERequestContext::HLERequestContext(SharedPtr<Kernel::ServerSession> server_session) | 79 | HLERequestContext::HLERequestContext(SharedPtr<Kernel::ServerSession> server_session, |
| 80 | : server_session(std::move(server_session)) { | 80 | SharedPtr<Thread> thread) |
| 81 | : server_session(std::move(server_session)), thread(std::move(thread)) { | ||
| 81 | cmd_buf[0] = 0; | 82 | cmd_buf[0] = 0; |
| 82 | } | 83 | } |
| 83 | 84 | ||
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index 2bdd9f02c..ccf5e56aa 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h | |||
| @@ -97,7 +97,7 @@ protected: | |||
| 97 | */ | 97 | */ |
| 98 | class HLERequestContext { | 98 | class HLERequestContext { |
| 99 | public: | 99 | public: |
| 100 | explicit HLERequestContext(SharedPtr<ServerSession> session); | 100 | explicit HLERequestContext(SharedPtr<ServerSession> session, SharedPtr<Thread> thread); |
| 101 | ~HLERequestContext(); | 101 | ~HLERequestContext(); |
| 102 | 102 | ||
| 103 | /// Returns a pointer to the IPC command buffer for this request. | 103 | /// Returns a pointer to the IPC command buffer for this request. |
| @@ -119,7 +119,6 @@ public: | |||
| 119 | /** | 119 | /** |
| 120 | * Puts the specified guest thread to sleep until the returned event is signaled or until the | 120 | * Puts the specified guest thread to sleep until the returned event is signaled or until the |
| 121 | * specified timeout expires. | 121 | * specified timeout expires. |
| 122 | * @param thread Thread to be put to sleep. | ||
| 123 | * @param reason Reason for pausing the thread, to be used for debugging purposes. | 122 | * @param reason Reason for pausing the thread, to be used for debugging purposes. |
| 124 | * @param timeout Timeout in nanoseconds after which the thread will be awoken and the callback | 123 | * @param timeout Timeout in nanoseconds after which the thread will be awoken and the callback |
| 125 | * invoked with a Timeout reason. | 124 | * invoked with a Timeout reason. |
| @@ -130,8 +129,8 @@ public: | |||
| 130 | * created. | 129 | * created. |
| 131 | * @returns Event that when signaled will resume the thread and call the callback function. | 130 | * @returns Event that when signaled will resume the thread and call the callback function. |
| 132 | */ | 131 | */ |
| 133 | SharedPtr<WritableEvent> SleepClientThread(SharedPtr<Thread> thread, const std::string& reason, | 132 | SharedPtr<WritableEvent> SleepClientThread(const std::string& reason, u64 timeout, |
| 134 | u64 timeout, WakeupCallback&& callback, | 133 | WakeupCallback&& callback, |
| 135 | SharedPtr<WritableEvent> writable_event = nullptr); | 134 | SharedPtr<WritableEvent> writable_event = nullptr); |
| 136 | 135 | ||
| 137 | /// Populates this context with data from the requesting process/thread. | 136 | /// Populates this context with data from the requesting process/thread. |
| @@ -268,6 +267,7 @@ private: | |||
| 268 | 267 | ||
| 269 | std::array<u32, IPC::COMMAND_BUFFER_LENGTH> cmd_buf; | 268 | std::array<u32, IPC::COMMAND_BUFFER_LENGTH> cmd_buf; |
| 270 | SharedPtr<Kernel::ServerSession> server_session; | 269 | SharedPtr<Kernel::ServerSession> server_session; |
| 270 | SharedPtr<Thread> thread; | ||
| 271 | // TODO(yuriks): Check common usage of this and optimize size accordingly | 271 | // TODO(yuriks): Check common usage of this and optimize size accordingly |
| 272 | boost::container::small_vector<SharedPtr<Object>, 8> move_objects; | 272 | boost::container::small_vector<SharedPtr<Object>, 8> move_objects; |
| 273 | boost::container::small_vector<SharedPtr<Object>, 8> copy_objects; | 273 | boost::container::small_vector<SharedPtr<Object>, 8> copy_objects; |
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp index 696a82cd9..30b2bfb5a 100644 --- a/src/core/hle/kernel/server_session.cpp +++ b/src/core/hle/kernel/server_session.cpp | |||
| @@ -130,7 +130,7 @@ ResultCode ServerSession::HandleSyncRequest(SharedPtr<Thread> thread) { | |||
| 130 | // The ServerSession received a sync request, this means that there's new data available | 130 | // The ServerSession received a sync request, this means that there's new data available |
| 131 | // from its ClientSession, so wake up any threads that may be waiting on a svcReplyAndReceive or | 131 | // from its ClientSession, so wake up any threads that may be waiting on a svcReplyAndReceive or |
| 132 | // similar. | 132 | // similar. |
| 133 | Kernel::HLERequestContext context(this); | 133 | Kernel::HLERequestContext context(this, thread); |
| 134 | u32* cmd_buf = (u32*)Memory::GetPointer(thread->GetTLSAddress()); | 134 | u32* cmd_buf = (u32*)Memory::GetPointer(thread->GetTLSAddress()); |
| 135 | context.PopulateFromIncomingCommandBuffer(kernel.CurrentProcess()->GetHandleTable(), cmd_buf); | 135 | context.PopulateFromIncomingCommandBuffer(kernel.CurrentProcess()->GetHandleTable(), cmd_buf); |
| 136 | 136 | ||
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 4e17249a9..f1fa6ccd1 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -556,7 +556,7 @@ private: | |||
| 556 | } else { | 556 | } else { |
| 557 | // Wait the current thread until a buffer becomes available | 557 | // Wait the current thread until a buffer becomes available |
| 558 | ctx.SleepClientThread( | 558 | ctx.SleepClientThread( |
| 559 | Kernel::GetCurrentThread(), "IHOSBinderDriver::DequeueBuffer", -1, | 559 | "IHOSBinderDriver::DequeueBuffer", -1, |
| 560 | [=](Kernel::SharedPtr<Kernel::Thread> thread, Kernel::HLERequestContext& ctx, | 560 | [=](Kernel::SharedPtr<Kernel::Thread> thread, Kernel::HLERequestContext& ctx, |
| 561 | Kernel::ThreadWakeupReason reason) { | 561 | Kernel::ThreadWakeupReason reason) { |
| 562 | // Repeat TransactParcel DequeueBuffer when a buffer is available | 562 | // Repeat TransactParcel DequeueBuffer when a buffer is available |
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 4c380677d..6d4658c8b 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -371,7 +371,7 @@ private: | |||
| 371 | location += GENERIC_VARYING_START_LOCATION; | 371 | location += GENERIC_VARYING_START_LOCATION; |
| 372 | } | 372 | } |
| 373 | 373 | ||
| 374 | code.AddLine("layout (location = {}) {} in vec4 {};", name, location, suffix, name); | 374 | code.AddLine("layout (location = {}) {} in vec4 {};", location, suffix, name); |
| 375 | } | 375 | } |
| 376 | 376 | ||
| 377 | void DeclareOutputAttributes() { | 377 | void DeclareOutputAttributes() { |
diff --git a/src/video_core/shader/decode/arithmetic.cpp b/src/video_core/shader/decode/arithmetic.cpp index 3190e2d7c..b4859bc1e 100644 --- a/src/video_core/shader/decode/arithmetic.cpp +++ b/src/video_core/shader/decode/arithmetic.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "common/assert.h" | 5 | #include "common/assert.h" |
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | #include "common/logging/log.h" | ||
| 7 | #include "video_core/engines/shader_bytecode.h" | 8 | #include "video_core/engines/shader_bytecode.h" |
| 8 | #include "video_core/shader/shader_ir.h" | 9 | #include "video_core/shader/shader_ir.h" |
| 9 | 10 | ||
| @@ -152,4 +153,4 @@ u32 ShaderIR::DecodeArithmetic(NodeBlock& bb, u32 pc) { | |||
| 152 | return pc; | 153 | return pc; |
| 153 | } | 154 | } |
| 154 | 155 | ||
| 155 | } // namespace VideoCommon::Shader \ No newline at end of file | 156 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/arithmetic_half.cpp b/src/video_core/shader/decode/arithmetic_half.cpp index 2098c1170..3a29c4a46 100644 --- a/src/video_core/shader/decode/arithmetic_half.cpp +++ b/src/video_core/shader/decode/arithmetic_half.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "common/assert.h" | 5 | #include "common/assert.h" |
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | #include "common/logging/log.h" | ||
| 7 | #include "video_core/engines/shader_bytecode.h" | 8 | #include "video_core/engines/shader_bytecode.h" |
| 8 | #include "video_core/shader/shader_ir.h" | 9 | #include "video_core/shader/shader_ir.h" |
| 9 | 10 | ||
diff --git a/src/video_core/shader/decode/arithmetic_half_immediate.cpp b/src/video_core/shader/decode/arithmetic_half_immediate.cpp index fbcd35b18..5341e460f 100644 --- a/src/video_core/shader/decode/arithmetic_half_immediate.cpp +++ b/src/video_core/shader/decode/arithmetic_half_immediate.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "common/assert.h" | 5 | #include "common/assert.h" |
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | #include "common/logging/log.h" | ||
| 7 | #include "video_core/engines/shader_bytecode.h" | 8 | #include "video_core/engines/shader_bytecode.h" |
| 8 | #include "video_core/shader/shader_ir.h" | 9 | #include "video_core/shader/shader_ir.h" |
| 9 | 10 | ||
| @@ -47,4 +48,4 @@ u32 ShaderIR::DecodeArithmeticHalfImmediate(NodeBlock& bb, u32 pc) { | |||
| 47 | return pc; | 48 | return pc; |
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | } // namespace VideoCommon::Shader \ No newline at end of file | 51 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/arithmetic_immediate.cpp b/src/video_core/shader/decode/arithmetic_immediate.cpp index 0d139c0d2..3095f2fd4 100644 --- a/src/video_core/shader/decode/arithmetic_immediate.cpp +++ b/src/video_core/shader/decode/arithmetic_immediate.cpp | |||
| @@ -49,4 +49,4 @@ u32 ShaderIR::DecodeArithmeticImmediate(NodeBlock& bb, u32 pc) { | |||
| 49 | return pc; | 49 | return pc; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | } // namespace VideoCommon::Shader \ No newline at end of file | 52 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/arithmetic_integer_immediate.cpp b/src/video_core/shader/decode/arithmetic_integer_immediate.cpp index 3ed5ccc5a..679ac0d4e 100644 --- a/src/video_core/shader/decode/arithmetic_integer_immediate.cpp +++ b/src/video_core/shader/decode/arithmetic_integer_immediate.cpp | |||
| @@ -93,4 +93,4 @@ void ShaderIR::WriteLogicOperation(NodeBlock& bb, Register dest, LogicOperation | |||
| 93 | } | 93 | } |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | } // namespace VideoCommon::Shader \ No newline at end of file | 96 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/bfe.cpp b/src/video_core/shader/decode/bfe.cpp index 6a95dc928..1ae192c6a 100644 --- a/src/video_core/shader/decode/bfe.cpp +++ b/src/video_core/shader/decode/bfe.cpp | |||
| @@ -46,4 +46,4 @@ u32 ShaderIR::DecodeBfe(NodeBlock& bb, u32 pc) { | |||
| 46 | return pc; | 46 | return pc; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | } // namespace VideoCommon::Shader \ No newline at end of file | 49 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/bfi.cpp b/src/video_core/shader/decode/bfi.cpp index 601d66f1f..0b12a0d08 100644 --- a/src/video_core/shader/decode/bfi.cpp +++ b/src/video_core/shader/decode/bfi.cpp | |||
| @@ -38,4 +38,4 @@ u32 ShaderIR::DecodeBfi(NodeBlock& bb, u32 pc) { | |||
| 38 | return pc; | 38 | return pc; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | } // namespace VideoCommon::Shader \ No newline at end of file | 41 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/ffma.cpp b/src/video_core/shader/decode/ffma.cpp index 0559cc8de..a1d04c6e5 100644 --- a/src/video_core/shader/decode/ffma.cpp +++ b/src/video_core/shader/decode/ffma.cpp | |||
| @@ -56,4 +56,4 @@ u32 ShaderIR::DecodeFfma(NodeBlock& bb, u32 pc) { | |||
| 56 | return pc; | 56 | return pc; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | } // namespace VideoCommon::Shader \ No newline at end of file | 59 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/float_set.cpp b/src/video_core/shader/decode/float_set.cpp index 1bd6755dd..cc522f1de 100644 --- a/src/video_core/shader/decode/float_set.cpp +++ b/src/video_core/shader/decode/float_set.cpp | |||
| @@ -55,4 +55,4 @@ u32 ShaderIR::DecodeFloatSet(NodeBlock& bb, u32 pc) { | |||
| 55 | return pc; | 55 | return pc; |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | } // namespace VideoCommon::Shader \ No newline at end of file | 58 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/float_set_predicate.cpp b/src/video_core/shader/decode/float_set_predicate.cpp index 9285b8d05..9d2322a1d 100644 --- a/src/video_core/shader/decode/float_set_predicate.cpp +++ b/src/video_core/shader/decode/float_set_predicate.cpp | |||
| @@ -53,4 +53,4 @@ u32 ShaderIR::DecodeFloatSetPredicate(NodeBlock& bb, u32 pc) { | |||
| 53 | return pc; | 53 | return pc; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | } // namespace VideoCommon::Shader \ No newline at end of file | 56 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/half_set.cpp b/src/video_core/shader/decode/half_set.cpp index 1dd94bf9d..755f2ec44 100644 --- a/src/video_core/shader/decode/half_set.cpp +++ b/src/video_core/shader/decode/half_set.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 8 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 9 | #include "common/logging/log.h" | ||
| 9 | #include "video_core/engines/shader_bytecode.h" | 10 | #include "video_core/engines/shader_bytecode.h" |
| 10 | #include "video_core/shader/shader_ir.h" | 11 | #include "video_core/shader/shader_ir.h" |
| 11 | 12 | ||
| @@ -64,4 +65,4 @@ u32 ShaderIR::DecodeHalfSet(NodeBlock& bb, u32 pc) { | |||
| 64 | return pc; | 65 | return pc; |
| 65 | } | 66 | } |
| 66 | 67 | ||
| 67 | } // namespace VideoCommon::Shader \ No newline at end of file | 68 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/half_set_predicate.cpp b/src/video_core/shader/decode/half_set_predicate.cpp index 6e59eb650..fba44d714 100644 --- a/src/video_core/shader/decode/half_set_predicate.cpp +++ b/src/video_core/shader/decode/half_set_predicate.cpp | |||
| @@ -59,4 +59,4 @@ u32 ShaderIR::DecodeHalfSetPredicate(NodeBlock& bb, u32 pc) { | |||
| 59 | return pc; | 59 | return pc; |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | } // namespace VideoCommon::Shader \ No newline at end of file | 62 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/integer_set.cpp b/src/video_core/shader/decode/integer_set.cpp index a3bf17eba..a4cdaf74d 100644 --- a/src/video_core/shader/decode/integer_set.cpp +++ b/src/video_core/shader/decode/integer_set.cpp | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/assert.h" | ||
| 6 | #include "common/common_types.h" | 5 | #include "common/common_types.h" |
| 7 | #include "video_core/engines/shader_bytecode.h" | 6 | #include "video_core/engines/shader_bytecode.h" |
| 8 | #include "video_core/shader/shader_ir.h" | 7 | #include "video_core/shader/shader_ir.h" |
| @@ -47,4 +46,4 @@ u32 ShaderIR::DecodeIntegerSet(NodeBlock& bb, u32 pc) { | |||
| 47 | return pc; | 46 | return pc; |
| 48 | } | 47 | } |
| 49 | 48 | ||
| 50 | } // namespace VideoCommon::Shader \ No newline at end of file | 49 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/integer_set_predicate.cpp b/src/video_core/shader/decode/integer_set_predicate.cpp index aad836d24..a6a1fb632 100644 --- a/src/video_core/shader/decode/integer_set_predicate.cpp +++ b/src/video_core/shader/decode/integer_set_predicate.cpp | |||
| @@ -50,4 +50,4 @@ u32 ShaderIR::DecodeIntegerSetPredicate(NodeBlock& bb, u32 pc) { | |||
| 50 | return pc; | 50 | return pc; |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | } // namespace VideoCommon::Shader \ No newline at end of file | 53 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp index a5ca9a164..e6a010a7d 100644 --- a/src/video_core/shader/decode/memory.cpp +++ b/src/video_core/shader/decode/memory.cpp | |||
| @@ -12,8 +12,6 @@ | |||
| 12 | #include "video_core/engines/shader_bytecode.h" | 12 | #include "video_core/engines/shader_bytecode.h" |
| 13 | #include "video_core/shader/shader_ir.h" | 13 | #include "video_core/shader/shader_ir.h" |
| 14 | 14 | ||
| 15 | #pragma optimize("", off) | ||
| 16 | |||
| 17 | namespace VideoCommon::Shader { | 15 | namespace VideoCommon::Shader { |
| 18 | 16 | ||
| 19 | using Tegra::Shader::Attribute; | 17 | using Tegra::Shader::Attribute; |
diff --git a/src/video_core/shader/decode/other.cpp b/src/video_core/shader/decode/other.cpp index fa17c45b5..ca7af72e1 100644 --- a/src/video_core/shader/decode/other.cpp +++ b/src/video_core/shader/decode/other.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "common/assert.h" | 5 | #include "common/assert.h" |
| 6 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 7 | #include "common/logging/log.h" | ||
| 7 | #include "video_core/engines/shader_bytecode.h" | 8 | #include "video_core/engines/shader_bytecode.h" |
| 8 | #include "video_core/shader/shader_ir.h" | 9 | #include "video_core/shader/shader_ir.h" |
| 9 | 10 | ||
diff --git a/src/video_core/shader/decode/predicate_set_predicate.cpp b/src/video_core/shader/decode/predicate_set_predicate.cpp index 83c61680e..71844c42b 100644 --- a/src/video_core/shader/decode/predicate_set_predicate.cpp +++ b/src/video_core/shader/decode/predicate_set_predicate.cpp | |||
| @@ -64,4 +64,4 @@ u32 ShaderIR::DecodePredicateSetPredicate(NodeBlock& bb, u32 pc) { | |||
| 64 | return pc; | 64 | return pc; |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | } // namespace VideoCommon::Shader \ No newline at end of file | 67 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/predicate_set_register.cpp b/src/video_core/shader/decode/predicate_set_register.cpp index d0495995d..387491bd3 100644 --- a/src/video_core/shader/decode/predicate_set_register.cpp +++ b/src/video_core/shader/decode/predicate_set_register.cpp | |||
| @@ -43,4 +43,4 @@ u32 ShaderIR::DecodePredicateSetRegister(NodeBlock& bb, u32 pc) { | |||
| 43 | return pc; | 43 | return pc; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | } // namespace VideoCommon::Shader \ No newline at end of file | 46 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/register_set_predicate.cpp b/src/video_core/shader/decode/register_set_predicate.cpp index f070e8912..f8659e48e 100644 --- a/src/video_core/shader/decode/register_set_predicate.cpp +++ b/src/video_core/shader/decode/register_set_predicate.cpp | |||
| @@ -48,4 +48,4 @@ u32 ShaderIR::DecodeRegisterSetPredicate(NodeBlock& bb, u32 pc) { | |||
| 48 | return pc; | 48 | return pc; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | } // namespace VideoCommon::Shader \ No newline at end of file | 51 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/shift.cpp b/src/video_core/shader/decode/shift.cpp index 951e85f44..44ae87ece 100644 --- a/src/video_core/shader/decode/shift.cpp +++ b/src/video_core/shader/decode/shift.cpp | |||
| @@ -52,4 +52,4 @@ u32 ShaderIR::DecodeShift(NodeBlock& bb, u32 pc) { | |||
| 52 | return pc; | 52 | return pc; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | } // namespace VideoCommon::Shader \ No newline at end of file | 55 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/decode/video.cpp b/src/video_core/shader/decode/video.cpp index 956c01d9b..cb9ab72b1 100644 --- a/src/video_core/shader/decode/video.cpp +++ b/src/video_core/shader/decode/video.cpp | |||
| @@ -108,4 +108,4 @@ Node ShaderIR::GetVideoOperand(Node op, bool is_chunk, bool is_signed, | |||
| 108 | } | 108 | } |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | } // namespace VideoCommon::Shader \ No newline at end of file | 111 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp index 153ad1fd0..8a6ee5cf5 100644 --- a/src/video_core/shader/shader_ir.cpp +++ b/src/video_core/shader/shader_ir.cpp | |||
| @@ -39,8 +39,8 @@ Node ShaderIR::Conditional(Node condition, std::vector<Node>&& code) { | |||
| 39 | return StoreNode(ConditionalNode(condition, std::move(code))); | 39 | return StoreNode(ConditionalNode(condition, std::move(code))); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | Node ShaderIR::Comment(const std::string& text) { | 42 | Node ShaderIR::Comment(std::string text) { |
| 43 | return StoreNode(CommentNode(text)); | 43 | return StoreNode(CommentNode(std::move(text))); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | Node ShaderIR::Immediate(u32 value) { | 46 | Node ShaderIR::Immediate(u32 value) { |
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h index 0f769ed8d..35f72bddb 100644 --- a/src/video_core/shader/shader_ir.h +++ b/src/video_core/shader/shader_ir.h | |||
| @@ -663,7 +663,7 @@ private: | |||
| 663 | /// Creates a conditional node | 663 | /// Creates a conditional node |
| 664 | Node Conditional(Node condition, std::vector<Node>&& code); | 664 | Node Conditional(Node condition, std::vector<Node>&& code); |
| 665 | /// Creates a commentary | 665 | /// Creates a commentary |
| 666 | Node Comment(const std::string& text); | 666 | Node Comment(std::string text); |
| 667 | /// Creates an u32 immediate | 667 | /// Creates an u32 immediate |
| 668 | Node Immediate(u32 value); | 668 | Node Immediate(u32 value); |
| 669 | /// Creates a s32 immediate | 669 | /// Creates a s32 immediate |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index d28826c67..db27da23e 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include "core/hle/service/hid/controllers/npad.h" | 11 | #include "core/hle/service/hid/controllers/npad.h" |
| 12 | #include "input_common/main.h" | 12 | #include "input_common/main.h" |
| 13 | #include "yuzu/configuration/config.h" | 13 | #include "yuzu/configuration/config.h" |
| 14 | #include "yuzu/ui_settings.h" | ||
| 14 | 15 | ||
| 15 | Config::Config() { | 16 | Config::Config() { |
| 16 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. | 17 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. |
| @@ -206,25 +207,28 @@ const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> Config::default | |||
| 206 | }; | 207 | }; |
| 207 | 208 | ||
| 208 | // This shouldn't have anything except static initializers (no functions). So | 209 | // This shouldn't have anything except static initializers (no functions). So |
| 209 | // QKeySequnce(...).toString() is NOT ALLOWED HERE. | 210 | // QKeySequence(...).toString() is NOT ALLOWED HERE. |
| 210 | // This must be in alphabetical order according to action name as it must have the same order as | 211 | // This must be in alphabetical order according to action name as it must have the same order as |
| 211 | // UISetting::values.shortcuts, which is alphabetically ordered. | 212 | // UISetting::values.shortcuts, which is alphabetically ordered. |
| 212 | const std::array<UISettings::Shortcut, 15> Config::default_hotkeys{ | 213 | // clang-format off |
| 213 | {{"Capture Screenshot", "Main Window", {"Ctrl+P", Qt::ApplicationShortcut}}, | 214 | const std::array<UISettings::Shortcut, 15> default_hotkeys{{ |
| 214 | {"Continue/Pause Emulation", "Main Window", {"F4", Qt::WindowShortcut}}, | 215 | {QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), Qt::ApplicationShortcut}}, |
| 215 | {"Decrease Speed Limit", "Main Window", {"-", Qt::ApplicationShortcut}}, | 216 | {QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), Qt::WindowShortcut}}, |
| 216 | {"Exit yuzu", "Main Window", {"Ctrl+Q", Qt::WindowShortcut}}, | 217 | {QStringLiteral("Decrease Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("-"), Qt::ApplicationShortcut}}, |
| 217 | {"Exit Fullscreen", "Main Window", {"Esc", Qt::WindowShortcut}}, | 218 | {QStringLiteral("Exit yuzu"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Q"), Qt::WindowShortcut}}, |
| 218 | {"Fullscreen", "Main Window", {"F11", Qt::WindowShortcut}}, | 219 | {QStringLiteral("Exit Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("Esc"), Qt::WindowShortcut}}, |
| 219 | {"Increase Speed Limit", "Main Window", {"+", Qt::ApplicationShortcut}}, | 220 | {QStringLiteral("Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("F11"), Qt::WindowShortcut}}, |
| 220 | {"Load Amiibo", "Main Window", {"F2", Qt::ApplicationShortcut}}, | 221 | {QStringLiteral("Increase Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("+"), Qt::ApplicationShortcut}}, |
| 221 | {"Load File", "Main Window", {"Ctrl+O", Qt::WindowShortcut}}, | 222 | {QStringLiteral("Load Amiibo"), QStringLiteral("Main Window"), {QStringLiteral("F2"), Qt::ApplicationShortcut}}, |
| 222 | {"Restart Emulation", "Main Window", {"F6", Qt::WindowShortcut}}, | 223 | {QStringLiteral("Load File"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+O"), Qt::WindowShortcut}}, |
| 223 | {"Stop Emulation", "Main Window", {"F5", Qt::WindowShortcut}}, | 224 | {QStringLiteral("Restart Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F6"), Qt::WindowShortcut}}, |
| 224 | {"Toggle Filter Bar", "Main Window", {"Ctrl+F", Qt::WindowShortcut}}, | 225 | {QStringLiteral("Stop Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F5"), Qt::WindowShortcut}}, |
| 225 | {"Toggle Speed Limit", "Main Window", {"Ctrl+Z", Qt::ApplicationShortcut}}, | 226 | {QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), Qt::WindowShortcut}}, |
| 226 | {"Toggle Status Bar", "Main Window", {"Ctrl+S", Qt::WindowShortcut}}, | 227 | {QStringLiteral("Toggle Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Z"), Qt::ApplicationShortcut}}, |
| 227 | {"Change Docked Mode", "Main Window", {"F10", Qt::ApplicationShortcut}}}}; | 228 | {QStringLiteral("Toggle Status Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+S"), Qt::WindowShortcut}}, |
| 229 | {QStringLiteral("Change Docked Mode"), QStringLiteral("Main Window"), {QStringLiteral("F10"), Qt::ApplicationShortcut}}, | ||
| 230 | }}; | ||
| 231 | // clang-format on | ||
| 228 | 232 | ||
| 229 | void Config::ReadPlayerValues() { | 233 | void Config::ReadPlayerValues() { |
| 230 | for (std::size_t p = 0; p < Settings::values.players.size(); ++p) { | 234 | for (std::size_t p = 0; p < Settings::values.players.size(); ++p) { |
| @@ -370,14 +374,21 @@ void Config::ReadMouseValues() { | |||
| 370 | } | 374 | } |
| 371 | 375 | ||
| 372 | void Config::ReadTouchscreenValues() { | 376 | void Config::ReadTouchscreenValues() { |
| 373 | Settings::values.touchscreen.enabled = ReadSetting("touchscreen_enabled", true).toBool(); | 377 | Settings::values.touchscreen.enabled = |
| 378 | ReadSetting(QStringLiteral("touchscreen_enabled"), true).toBool(); | ||
| 374 | Settings::values.touchscreen.device = | 379 | Settings::values.touchscreen.device = |
| 375 | ReadSetting("touchscreen_device", "engine:emu_window").toString().toStdString(); | 380 | ReadSetting(QStringLiteral("touchscreen_device"), QStringLiteral("engine:emu_window")) |
| 381 | .toString() | ||
| 382 | .toStdString(); | ||
| 376 | 383 | ||
| 377 | Settings::values.touchscreen.finger = ReadSetting("touchscreen_finger", 0).toUInt(); | 384 | Settings::values.touchscreen.finger = |
| 378 | Settings::values.touchscreen.rotation_angle = ReadSetting("touchscreen_angle", 0).toUInt(); | 385 | ReadSetting(QStringLiteral("touchscreen_finger"), 0).toUInt(); |
| 379 | Settings::values.touchscreen.diameter_x = ReadSetting("touchscreen_diameter_x", 15).toUInt(); | 386 | Settings::values.touchscreen.rotation_angle = |
| 380 | Settings::values.touchscreen.diameter_y = ReadSetting("touchscreen_diameter_y", 15).toUInt(); | 387 | ReadSetting(QStringLiteral("touchscreen_angle"), 0).toUInt(); |
| 388 | Settings::values.touchscreen.diameter_x = | ||
| 389 | ReadSetting(QStringLiteral("touchscreen_diameter_x"), 15).toUInt(); | ||
| 390 | Settings::values.touchscreen.diameter_y = | ||
| 391 | ReadSetting(QStringLiteral("touchscreen_diameter_y"), 15).toUInt(); | ||
| 381 | } | 392 | } |
| 382 | 393 | ||
| 383 | void Config::ApplyDefaultProfileIfInputInvalid() { | 394 | void Config::ApplyDefaultProfileIfInputInvalid() { |
| @@ -541,8 +552,8 @@ void Config::ReadRendererValues() { | |||
| 541 | void Config::ReadShortcutValues() { | 552 | void Config::ReadShortcutValues() { |
| 542 | qt_config->beginGroup(QStringLiteral("Shortcuts")); | 553 | qt_config->beginGroup(QStringLiteral("Shortcuts")); |
| 543 | 554 | ||
| 544 | for (auto [name, group, shortcut] : default_hotkeys) { | 555 | for (const auto& [name, group, shortcut] : default_hotkeys) { |
| 545 | auto [keyseq, context] = shortcut; | 556 | const auto& [keyseq, context] = shortcut; |
| 546 | qt_config->beginGroup(group); | 557 | qt_config->beginGroup(group); |
| 547 | qt_config->beginGroup(name); | 558 | qt_config->beginGroup(name); |
| 548 | UISettings::values.shortcuts.push_back( | 559 | UISettings::values.shortcuts.push_back( |
| @@ -591,7 +602,8 @@ void Config::ReadUIValues() { | |||
| 591 | qt_config->beginGroup(QStringLiteral("UI")); | 602 | qt_config->beginGroup(QStringLiteral("UI")); |
| 592 | 603 | ||
| 593 | UISettings::values.theme = | 604 | UISettings::values.theme = |
| 594 | ReadSetting(QStringLiteral("theme"), UISettings::themes[0].second).toString(); | 605 | ReadSetting(QStringLiteral("theme"), QString::fromUtf8(UISettings::themes[0].second)) |
| 606 | .toString(); | ||
| 595 | UISettings::values.enable_discord_presence = | 607 | UISettings::values.enable_discord_presence = |
| 596 | ReadSetting(QStringLiteral("enable_discord_presence"), true).toBool(); | 608 | ReadSetting(QStringLiteral("enable_discord_presence"), true).toBool(); |
| 597 | UISettings::values.screenshot_resolution_factor = | 609 | UISettings::values.screenshot_resolution_factor = |
| @@ -626,7 +638,7 @@ void Config::ReadUIValues() { | |||
| 626 | } | 638 | } |
| 627 | 639 | ||
| 628 | void Config::ReadUIGamelistValues() { | 640 | void Config::ReadUIGamelistValues() { |
| 629 | qt_config->beginGroup("UIGameList"); | 641 | qt_config->beginGroup(QStringLiteral("UIGameList")); |
| 630 | 642 | ||
| 631 | UISettings::values.show_unknown = ReadSetting(QStringLiteral("show_unknown"), true).toBool(); | 643 | UISettings::values.show_unknown = ReadSetting(QStringLiteral("show_unknown"), true).toBool(); |
| 632 | UISettings::values.show_add_ons = ReadSetting(QStringLiteral("show_add_ons"), true).toBool(); | 644 | UISettings::values.show_add_ons = ReadSetting(QStringLiteral("show_add_ons"), true).toBool(); |
| @@ -723,7 +735,7 @@ void Config::SavePlayerValues() { | |||
| 723 | } | 735 | } |
| 724 | 736 | ||
| 725 | void Config::SaveDebugValues() { | 737 | void Config::SaveDebugValues() { |
| 726 | WriteSetting("debug_pad_enabled", Settings::values.debug_pad_enabled, false); | 738 | WriteSetting(QStringLiteral("debug_pad_enabled"), Settings::values.debug_pad_enabled, false); |
| 727 | for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) { | 739 | for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) { |
| 728 | const std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]); | 740 | const std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]); |
| 729 | WriteSetting(QStringLiteral("debug_pad_") + | 741 | WriteSetting(QStringLiteral("debug_pad_") + |
| @@ -924,7 +936,7 @@ void Config::SaveShortcutValues() { | |||
| 924 | // Lengths of UISettings::values.shortcuts & default_hotkeys are same. | 936 | // Lengths of UISettings::values.shortcuts & default_hotkeys are same. |
| 925 | // However, their ordering must also be the same. | 937 | // However, their ordering must also be the same. |
| 926 | for (std::size_t i = 0; i < default_hotkeys.size(); i++) { | 938 | for (std::size_t i = 0; i < default_hotkeys.size(); i++) { |
| 927 | const auto [name, group, shortcut] = UISettings::values.shortcuts[i]; | 939 | const auto& [name, group, shortcut] = UISettings::values.shortcuts[i]; |
| 928 | const auto& default_hotkey = default_hotkeys[i].shortcut; | 940 | const auto& default_hotkey = default_hotkeys[i].shortcut; |
| 929 | 941 | ||
| 930 | qt_config->beginGroup(group); | 942 | qt_config->beginGroup(group); |
| @@ -961,7 +973,8 @@ void Config::SaveSystemValues() { | |||
| 961 | void Config::SaveUIValues() { | 973 | void Config::SaveUIValues() { |
| 962 | qt_config->beginGroup(QStringLiteral("UI")); | 974 | qt_config->beginGroup(QStringLiteral("UI")); |
| 963 | 975 | ||
| 964 | WriteSetting(QStringLiteral("theme"), UISettings::values.theme, UISettings::themes[0].second); | 976 | WriteSetting(QStringLiteral("theme"), UISettings::values.theme, |
| 977 | QString::fromUtf8(UISettings::themes[0].second)); | ||
| 965 | WriteSetting(QStringLiteral("enable_discord_presence"), | 978 | WriteSetting(QStringLiteral("enable_discord_presence"), |
| 966 | UISettings::values.enable_discord_presence, true); | 979 | UISettings::values.enable_discord_presence, true); |
| 967 | WriteSetting(QStringLiteral("screenshot_resolution_factor"), | 980 | WriteSetting(QStringLiteral("screenshot_resolution_factor"), |
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h index b62a480ee..6b523ecdd 100644 --- a/src/yuzu/configuration/config.h +++ b/src/yuzu/configuration/config.h | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include <string> | 9 | #include <string> |
| 10 | #include <QVariant> | 10 | #include <QVariant> |
| 11 | #include "core/settings.h" | 11 | #include "core/settings.h" |
| 12 | #include "yuzu/ui_settings.h" | ||
| 13 | 12 | ||
| 14 | class QSettings; | 13 | class QSettings; |
| 15 | 14 | ||
| @@ -82,8 +81,6 @@ private: | |||
| 82 | void WriteSetting(const QString& name, const QVariant& value); | 81 | void WriteSetting(const QString& name, const QVariant& value); |
| 83 | void WriteSetting(const QString& name, const QVariant& value, const QVariant& default_value); | 82 | void WriteSetting(const QString& name, const QVariant& value, const QVariant& default_value); |
| 84 | 83 | ||
| 85 | static const std::array<UISettings::Shortcut, 15> default_hotkeys; | ||
| 86 | |||
| 87 | std::unique_ptr<QSettings> qt_config; | 84 | std::unique_ptr<QSettings> qt_config; |
| 88 | std::string qt_config_loc; | 85 | std::string qt_config_loc; |
| 89 | }; | 86 | }; |