diff options
42 files changed, 154 insertions, 191 deletions
diff --git a/.ci/scripts/linux/upload.sh b/.ci/scripts/linux/upload.sh index ecd77e267..fe4e6b2ac 100644 --- a/.ci/scripts/linux/upload.sh +++ b/.ci/scripts/linux/upload.sh | |||
| @@ -7,9 +7,9 @@ ARCHIVE_NAME="${REV_NAME}.tar.xz" | |||
| 7 | COMPRESSION_FLAGS="-cJvf" | 7 | COMPRESSION_FLAGS="-cJvf" |
| 8 | 8 | ||
| 9 | if [ "${RELEASE_NAME}" = "mainline" ]; then | 9 | if [ "${RELEASE_NAME}" = "mainline" ]; then |
| 10 | DIR_NAME="${REV_NAME}_${RELEASE_NAME}" | ||
| 11 | else | ||
| 12 | DIR_NAME="${REV_NAME}" | 10 | DIR_NAME="${REV_NAME}" |
| 11 | else | ||
| 12 | DIR_NAME="${REV_NAME}_${RELEASE_NAME}" | ||
| 13 | fi | 13 | fi |
| 14 | 14 | ||
| 15 | mkdir "$DIR_NAME" | 15 | mkdir "$DIR_NAME" |
diff --git a/.ci/scripts/windows/upload.ps1 b/.ci/scripts/windows/upload.ps1 index 9fb99eaa3..e34e6681f 100644 --- a/.ci/scripts/windows/upload.ps1 +++ b/.ci/scripts/windows/upload.ps1 | |||
| @@ -4,9 +4,9 @@ $GITDATE = $(git show -s --date=short --format='%ad') -replace "-","" | |||
| 4 | $GITREV = $(git show -s --format='%h') | 4 | $GITREV = $(git show -s --format='%h') |
| 5 | 5 | ||
| 6 | if ("$BUILD_NAME" -eq "mainline") { | 6 | if ("$BUILD_NAME" -eq "mainline") { |
| 7 | $RELEASE_DIST = "yuzu-windows-msvc-$BUILD_NAME" | ||
| 8 | } else { | ||
| 9 | $RELEASE_DIST = "yuzu-windows-msvc" | 7 | $RELEASE_DIST = "yuzu-windows-msvc" |
| 8 | } else { | ||
| 9 | $RELEASE_DIST = "yuzu-windows-msvc-$BUILD_NAME" | ||
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | $MSVC_BUILD_ZIP = "yuzu-windows-msvc-$GITDATE-$GITREV.zip" -replace " ", "" | 12 | $MSVC_BUILD_ZIP = "yuzu-windows-msvc-$GITDATE-$GITREV.zip" -replace " ", "" |
diff --git a/.ci/scripts/windows/upload.sh b/.ci/scripts/windows/upload.sh index 41d87159f..ebf5b7dc1 100644 --- a/.ci/scripts/windows/upload.sh +++ b/.ci/scripts/windows/upload.sh | |||
| @@ -7,9 +7,9 @@ ARCHIVE_NAME="${REV_NAME}.tar.gz" | |||
| 7 | COMPRESSION_FLAGS="-czvf" | 7 | COMPRESSION_FLAGS="-czvf" |
| 8 | 8 | ||
| 9 | if [ "${RELEASE_NAME}" = "mainline" ]; then | 9 | if [ "${RELEASE_NAME}" = "mainline" ]; then |
| 10 | DIR_NAME="${REV_NAME}_${RELEASE_NAME}" | ||
| 11 | else | ||
| 12 | DIR_NAME="${REV_NAME}" | 10 | DIR_NAME="${REV_NAME}" |
| 11 | else | ||
| 12 | DIR_NAME="${REV_NAME}_${RELEASE_NAME}" | ||
| 13 | fi | 13 | fi |
| 14 | 14 | ||
| 15 | mkdir "$DIR_NAME" | 15 | mkdir "$DIR_NAME" |
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 9c6f1c07c..9b0c3db68 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -3,17 +3,8 @@ | |||
| 3 | # could affect the result, but much more unlikely than the following files. Keeping a list of files | 3 | # could affect the result, but much more unlikely than the following files. Keeping a list of files |
| 4 | # like this allows for much better caching since it doesn't force the user to recompile binary shaders every update | 4 | # like this allows for much better caching since it doesn't force the user to recompile binary shaders every update |
| 5 | set(VIDEO_CORE "${CMAKE_SOURCE_DIR}/src/video_core") | 5 | set(VIDEO_CORE "${CMAKE_SOURCE_DIR}/src/video_core") |
| 6 | if (DEFINED ENV{CI}) | 6 | if (DEFINED ENV{AZURECIREPO}) |
| 7 | if (DEFINED ENV{TRAVIS}) | 7 | set(BUILD_REPOSITORY $ENV{AZURECIREPO}) |
| 8 | set(BUILD_REPOSITORY $ENV{TRAVIS_REPO_SLUG}) | ||
| 9 | set(BUILD_TAG $ENV{TRAVIS_TAG}) | ||
| 10 | elseif(DEFINED ENV{APPVEYOR}) | ||
| 11 | set(BUILD_REPOSITORY $ENV{APPVEYOR_REPO_NAME}) | ||
| 12 | set(BUILD_TAG $ENV{APPVEYOR_REPO_TAG_NAME}) | ||
| 13 | elseif(DEFINED ENV{AZURE}) | ||
| 14 | set(BUILD_REPOSITORY $ENV{AZURE_REPO_NAME}) | ||
| 15 | set(BUILD_TAG $ENV{AZURE_REPO_TAG}) | ||
| 16 | endif() | ||
| 17 | endif() | 8 | endif() |
| 18 | if (DEFINED ENV{TITLEBARFORMATIDLE}) | 9 | if (DEFINED ENV{TITLEBARFORMATIDLE}) |
| 19 | set(TITLE_BAR_FORMAT_IDLE $ENV{TITLEBARFORMATIDLE}) | 10 | set(TITLE_BAR_FORMAT_IDLE $ENV{TITLEBARFORMATIDLE}) |
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index f3da525d6..a7b5849b0 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp | |||
| @@ -58,8 +58,7 @@ SharedPtr<WritableEvent> HLERequestContext::SleepClientThread( | |||
| 58 | auto& kernel = Core::System::GetInstance().Kernel(); | 58 | auto& kernel = Core::System::GetInstance().Kernel(); |
| 59 | if (!writable_event) { | 59 | if (!writable_event) { |
| 60 | // Create event if not provided | 60 | // Create event if not provided |
| 61 | const auto pair = WritableEvent::CreateEventPair(kernel, ResetType::Automatic, | 61 | const auto pair = WritableEvent::CreateEventPair(kernel, "HLE Pause Event: " + reason); |
| 62 | "HLE Pause Event: " + reason); | ||
| 63 | writable_event = pair.writable; | 62 | writable_event = pair.writable; |
| 64 | } | 63 | } |
| 65 | 64 | ||
diff --git a/src/core/hle/kernel/object.h b/src/core/hle/kernel/object.h index 2821176a7..a6faeb83b 100644 --- a/src/core/hle/kernel/object.h +++ b/src/core/hle/kernel/object.h | |||
| @@ -32,11 +32,6 @@ enum class HandleType : u32 { | |||
| 32 | ServerSession, | 32 | ServerSession, |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | enum class ResetType { | ||
| 36 | Automatic, ///< Reset automatically on object acquisition | ||
| 37 | Manual, ///< Never reset automatically | ||
| 38 | }; | ||
| 39 | |||
| 40 | class Object : NonCopyable { | 35 | class Object : NonCopyable { |
| 41 | public: | 36 | public: |
| 42 | explicit Object(KernelCore& kernel); | 37 | explicit Object(KernelCore& kernel); |
diff --git a/src/core/hle/kernel/readable_event.cpp b/src/core/hle/kernel/readable_event.cpp index 06463cd26..d8ac97aa1 100644 --- a/src/core/hle/kernel/readable_event.cpp +++ b/src/core/hle/kernel/readable_event.cpp | |||
| @@ -20,15 +20,13 @@ bool ReadableEvent::ShouldWait(const Thread* thread) const { | |||
| 20 | 20 | ||
| 21 | void ReadableEvent::Acquire(Thread* thread) { | 21 | void ReadableEvent::Acquire(Thread* thread) { |
| 22 | ASSERT_MSG(!ShouldWait(thread), "object unavailable!"); | 22 | ASSERT_MSG(!ShouldWait(thread), "object unavailable!"); |
| 23 | |||
| 24 | if (reset_type == ResetType::Automatic) { | ||
| 25 | signaled = false; | ||
| 26 | } | ||
| 27 | } | 23 | } |
| 28 | 24 | ||
| 29 | void ReadableEvent::Signal() { | 25 | void ReadableEvent::Signal() { |
| 30 | signaled = true; | 26 | if (!signaled) { |
| 31 | WakeupAllWaitingThreads(); | 27 | signaled = true; |
| 28 | WakeupAllWaitingThreads(); | ||
| 29 | }; | ||
| 32 | } | 30 | } |
| 33 | 31 | ||
| 34 | void ReadableEvent::Clear() { | 32 | void ReadableEvent::Clear() { |
diff --git a/src/core/hle/kernel/readable_event.h b/src/core/hle/kernel/readable_event.h index 84215f572..11ff71c3a 100644 --- a/src/core/hle/kernel/readable_event.h +++ b/src/core/hle/kernel/readable_event.h | |||
| @@ -27,10 +27,6 @@ public: | |||
| 27 | return name; | 27 | return name; |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | ResetType GetResetType() const { | ||
| 31 | return reset_type; | ||
| 32 | } | ||
| 33 | |||
| 34 | static constexpr HandleType HANDLE_TYPE = HandleType::ReadableEvent; | 30 | static constexpr HandleType HANDLE_TYPE = HandleType::ReadableEvent; |
| 35 | HandleType GetHandleType() const override { | 31 | HandleType GetHandleType() const override { |
| 36 | return HANDLE_TYPE; | 32 | return HANDLE_TYPE; |
| @@ -55,8 +51,7 @@ private: | |||
| 55 | 51 | ||
| 56 | void Signal(); | 52 | void Signal(); |
| 57 | 53 | ||
| 58 | ResetType reset_type; | 54 | bool signaled{}; |
| 59 | bool signaled; | ||
| 60 | 55 | ||
| 61 | std::string name; ///< Name of event (optional) | 56 | std::string name; ///< Name of event (optional) |
| 62 | }; | 57 | }; |
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index f64236be1..c63a9ba8b 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -2099,7 +2099,7 @@ static ResultCode CreateEvent(Core::System& system, Handle* write_handle, Handle | |||
| 2099 | 2099 | ||
| 2100 | auto& kernel = system.Kernel(); | 2100 | auto& kernel = system.Kernel(); |
| 2101 | const auto [readable_event, writable_event] = | 2101 | const auto [readable_event, writable_event] = |
| 2102 | WritableEvent::CreateEventPair(kernel, ResetType::Manual, "CreateEvent"); | 2102 | WritableEvent::CreateEventPair(kernel, "CreateEvent"); |
| 2103 | 2103 | ||
| 2104 | HandleTable& handle_table = kernel.CurrentProcess()->GetHandleTable(); | 2104 | HandleTable& handle_table = kernel.CurrentProcess()->GetHandleTable(); |
| 2105 | 2105 | ||
diff --git a/src/core/hle/kernel/writable_event.cpp b/src/core/hle/kernel/writable_event.cpp index a58ea6ec8..c783a34ee 100644 --- a/src/core/hle/kernel/writable_event.cpp +++ b/src/core/hle/kernel/writable_event.cpp | |||
| @@ -15,8 +15,7 @@ namespace Kernel { | |||
| 15 | WritableEvent::WritableEvent(KernelCore& kernel) : Object{kernel} {} | 15 | WritableEvent::WritableEvent(KernelCore& kernel) : Object{kernel} {} |
| 16 | WritableEvent::~WritableEvent() = default; | 16 | WritableEvent::~WritableEvent() = default; |
| 17 | 17 | ||
| 18 | EventPair WritableEvent::CreateEventPair(KernelCore& kernel, ResetType reset_type, | 18 | EventPair WritableEvent::CreateEventPair(KernelCore& kernel, std::string name) { |
| 19 | std::string name) { | ||
| 20 | SharedPtr<WritableEvent> writable_event(new WritableEvent(kernel)); | 19 | SharedPtr<WritableEvent> writable_event(new WritableEvent(kernel)); |
| 21 | SharedPtr<ReadableEvent> readable_event(new ReadableEvent(kernel)); | 20 | SharedPtr<ReadableEvent> readable_event(new ReadableEvent(kernel)); |
| 22 | 21 | ||
| @@ -24,7 +23,6 @@ EventPair WritableEvent::CreateEventPair(KernelCore& kernel, ResetType reset_typ | |||
| 24 | writable_event->readable = readable_event; | 23 | writable_event->readable = readable_event; |
| 25 | readable_event->name = name + ":Readable"; | 24 | readable_event->name = name + ":Readable"; |
| 26 | readable_event->signaled = false; | 25 | readable_event->signaled = false; |
| 27 | readable_event->reset_type = reset_type; | ||
| 28 | 26 | ||
| 29 | return {std::move(readable_event), std::move(writable_event)}; | 27 | return {std::move(readable_event), std::move(writable_event)}; |
| 30 | } | 28 | } |
| @@ -33,10 +31,6 @@ SharedPtr<ReadableEvent> WritableEvent::GetReadableEvent() const { | |||
| 33 | return readable; | 31 | return readable; |
| 34 | } | 32 | } |
| 35 | 33 | ||
| 36 | ResetType WritableEvent::GetResetType() const { | ||
| 37 | return readable->reset_type; | ||
| 38 | } | ||
| 39 | |||
| 40 | void WritableEvent::Signal() { | 34 | void WritableEvent::Signal() { |
| 41 | readable->Signal(); | 35 | readable->Signal(); |
| 42 | } | 36 | } |
diff --git a/src/core/hle/kernel/writable_event.h b/src/core/hle/kernel/writable_event.h index d00c92a6b..f46cf1dd8 100644 --- a/src/core/hle/kernel/writable_event.h +++ b/src/core/hle/kernel/writable_event.h | |||
| @@ -24,11 +24,9 @@ public: | |||
| 24 | /** | 24 | /** |
| 25 | * Creates an event | 25 | * Creates an event |
| 26 | * @param kernel The kernel instance to create this event under. | 26 | * @param kernel The kernel instance to create this event under. |
| 27 | * @param reset_type ResetType describing how to create event | ||
| 28 | * @param name Optional name of event | 27 | * @param name Optional name of event |
| 29 | */ | 28 | */ |
| 30 | static EventPair CreateEventPair(KernelCore& kernel, ResetType reset_type, | 29 | static EventPair CreateEventPair(KernelCore& kernel, std::string name = "Unknown"); |
| 31 | std::string name = "Unknown"); | ||
| 32 | 30 | ||
| 33 | std::string GetTypeName() const override { | 31 | std::string GetTypeName() const override { |
| 34 | return "WritableEvent"; | 32 | return "WritableEvent"; |
| @@ -44,8 +42,6 @@ public: | |||
| 44 | 42 | ||
| 45 | SharedPtr<ReadableEvent> GetReadableEvent() const; | 43 | SharedPtr<ReadableEvent> GetReadableEvent() const; |
| 46 | 44 | ||
| 47 | ResetType GetResetType() const; | ||
| 48 | |||
| 49 | void Signal(); | 45 | void Signal(); |
| 50 | void Clear(); | 46 | void Clear(); |
| 51 | bool IsSignaled() const; | 47 | bool IsSignaled() const; |
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 3d8a91d22..ba54b3040 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -289,8 +289,8 @@ ISelfController::ISelfController(Core::System& system, | |||
| 289 | RegisterHandlers(functions); | 289 | RegisterHandlers(functions); |
| 290 | 290 | ||
| 291 | auto& kernel = system.Kernel(); | 291 | auto& kernel = system.Kernel(); |
| 292 | launchable_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Manual, | 292 | launchable_event = |
| 293 | "ISelfController:LaunchableEvent"); | 293 | Kernel::WritableEvent::CreateEventPair(kernel, "ISelfController:LaunchableEvent"); |
| 294 | 294 | ||
| 295 | // This event is created by AM on the first time GetAccumulatedSuspendedTickChangedEvent() is | 295 | // This event is created by AM on the first time GetAccumulatedSuspendedTickChangedEvent() is |
| 296 | // called. Yuzu can just create it unconditionally, since it doesn't need to support multiple | 296 | // called. Yuzu can just create it unconditionally, since it doesn't need to support multiple |
| @@ -298,7 +298,7 @@ ISelfController::ISelfController(Core::System& system, | |||
| 298 | // suspended if the event has previously been created by a call to | 298 | // suspended if the event has previously been created by a call to |
| 299 | // GetAccumulatedSuspendedTickChangedEvent. | 299 | // GetAccumulatedSuspendedTickChangedEvent. |
| 300 | accumulated_suspended_tick_changed_event = Kernel::WritableEvent::CreateEventPair( | 300 | accumulated_suspended_tick_changed_event = Kernel::WritableEvent::CreateEventPair( |
| 301 | kernel, Kernel::ResetType::Manual, "ISelfController:AccumulatedSuspendedTickChangedEvent"); | 301 | kernel, "ISelfController:AccumulatedSuspendedTickChangedEvent"); |
| 302 | accumulated_suspended_tick_changed_event.writable->Signal(); | 302 | accumulated_suspended_tick_changed_event.writable->Signal(); |
| 303 | } | 303 | } |
| 304 | 304 | ||
| @@ -523,10 +523,10 @@ void ISelfController::GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequest | |||
| 523 | } | 523 | } |
| 524 | 524 | ||
| 525 | AppletMessageQueue::AppletMessageQueue(Kernel::KernelCore& kernel) { | 525 | AppletMessageQueue::AppletMessageQueue(Kernel::KernelCore& kernel) { |
| 526 | on_new_message = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Manual, | 526 | on_new_message = |
| 527 | "AMMessageQueue:OnMessageRecieved"); | 527 | Kernel::WritableEvent::CreateEventPair(kernel, "AMMessageQueue:OnMessageRecieved"); |
| 528 | on_operation_mode_changed = Kernel::WritableEvent::CreateEventPair( | 528 | on_operation_mode_changed = |
| 529 | kernel, Kernel::ResetType::Automatic, "AMMessageQueue:OperationModeChanged"); | 529 | Kernel::WritableEvent::CreateEventPair(kernel, "AMMessageQueue:OperationModeChanged"); |
| 530 | } | 530 | } |
| 531 | 531 | ||
| 532 | AppletMessageQueue::~AppletMessageQueue() = default; | 532 | AppletMessageQueue::~AppletMessageQueue() = default; |
| @@ -1091,7 +1091,7 @@ IApplicationFunctions::IApplicationFunctions(Core::System& system_) | |||
| 1091 | 1091 | ||
| 1092 | auto& kernel = system.Kernel(); | 1092 | auto& kernel = system.Kernel(); |
| 1093 | gpu_error_detected_event = Kernel::WritableEvent::CreateEventPair( | 1093 | gpu_error_detected_event = Kernel::WritableEvent::CreateEventPair( |
| 1094 | kernel, Kernel::ResetType::Manual, "IApplicationFunctions:GpuErrorDetectedSystemEvent"); | 1094 | kernel, "IApplicationFunctions:GpuErrorDetectedSystemEvent"); |
| 1095 | } | 1095 | } |
| 1096 | 1096 | ||
| 1097 | IApplicationFunctions::~IApplicationFunctions() = default; | 1097 | IApplicationFunctions::~IApplicationFunctions() = default; |
diff --git a/src/core/hle/service/am/applets/applets.cpp b/src/core/hle/service/am/applets/applets.cpp index 720fe766f..673ad1f7f 100644 --- a/src/core/hle/service/am/applets/applets.cpp +++ b/src/core/hle/service/am/applets/applets.cpp | |||
| @@ -24,12 +24,12 @@ | |||
| 24 | namespace Service::AM::Applets { | 24 | namespace Service::AM::Applets { |
| 25 | 25 | ||
| 26 | AppletDataBroker::AppletDataBroker(Kernel::KernelCore& kernel) { | 26 | AppletDataBroker::AppletDataBroker(Kernel::KernelCore& kernel) { |
| 27 | state_changed_event = Kernel::WritableEvent::CreateEventPair( | 27 | state_changed_event = |
| 28 | kernel, Kernel::ResetType::Manual, "ILibraryAppletAccessor:StateChangedEvent"); | 28 | Kernel::WritableEvent::CreateEventPair(kernel, "ILibraryAppletAccessor:StateChangedEvent"); |
| 29 | pop_out_data_event = Kernel::WritableEvent::CreateEventPair( | 29 | pop_out_data_event = |
| 30 | kernel, Kernel::ResetType::Manual, "ILibraryAppletAccessor:PopDataOutEvent"); | 30 | Kernel::WritableEvent::CreateEventPair(kernel, "ILibraryAppletAccessor:PopDataOutEvent"); |
| 31 | pop_interactive_out_data_event = Kernel::WritableEvent::CreateEventPair( | 31 | pop_interactive_out_data_event = Kernel::WritableEvent::CreateEventPair( |
| 32 | kernel, Kernel::ResetType::Manual, "ILibraryAppletAccessor:PopInteractiveDataOutEvent"); | 32 | kernel, "ILibraryAppletAccessor:PopInteractiveDataOutEvent"); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | AppletDataBroker::~AppletDataBroker() = default; | 35 | AppletDataBroker::~AppletDataBroker() = default; |
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index e9cf1e840..f36ccbc49 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp | |||
| @@ -67,8 +67,8 @@ AOC_U::AOC_U(Core::System& system) | |||
| 67 | RegisterHandlers(functions); | 67 | RegisterHandlers(functions); |
| 68 | 68 | ||
| 69 | auto& kernel = system.Kernel(); | 69 | auto& kernel = system.Kernel(); |
| 70 | aoc_change_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Manual, | 70 | aoc_change_event = |
| 71 | "GetAddOnContentListChanged:Event"); | 71 | Kernel::WritableEvent::CreateEventPair(kernel, "GetAddOnContentListChanged:Event"); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | AOC_U::~AOC_U() = default; | 74 | AOC_U::~AOC_U() = default; |
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 9afefb5c6..6a29377e3 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp | |||
| @@ -65,8 +65,8 @@ public: | |||
| 65 | RegisterHandlers(functions); | 65 | RegisterHandlers(functions); |
| 66 | 66 | ||
| 67 | // This is the event handle used to check if the audio buffer was released | 67 | // This is the event handle used to check if the audio buffer was released |
| 68 | buffer_event = Kernel::WritableEvent::CreateEventPair( | 68 | buffer_event = |
| 69 | system.Kernel(), Kernel::ResetType::Manual, "IAudioOutBufferReleased"); | 69 | Kernel::WritableEvent::CreateEventPair(system.Kernel(), "IAudioOutBufferReleased"); |
| 70 | 70 | ||
| 71 | stream = audio_core.OpenStream(system.CoreTiming(), audio_params.sample_rate, | 71 | stream = audio_core.OpenStream(system.CoreTiming(), audio_params.sample_rate, |
| 72 | audio_params.channel_count, std::move(unique_name), | 72 | audio_params.channel_count, std::move(unique_name), |
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index f162249ed..4ea7ade6e 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp | |||
| @@ -47,8 +47,8 @@ public: | |||
| 47 | // clang-format on | 47 | // clang-format on |
| 48 | RegisterHandlers(functions); | 48 | RegisterHandlers(functions); |
| 49 | 49 | ||
| 50 | system_event = Kernel::WritableEvent::CreateEventPair( | 50 | system_event = |
| 51 | system.Kernel(), Kernel::ResetType::Manual, "IAudioRenderer:SystemEvent"); | 51 | Kernel::WritableEvent::CreateEventPair(system.Kernel(), "IAudioRenderer:SystemEvent"); |
| 52 | renderer = std::make_unique<AudioCore::AudioRenderer>( | 52 | renderer = std::make_unique<AudioCore::AudioRenderer>( |
| 53 | system.CoreTiming(), audren_params, system_event.writable, instance_number); | 53 | system.CoreTiming(), audren_params, system_event.writable, instance_number); |
| 54 | } | 54 | } |
| @@ -180,17 +180,17 @@ public: | |||
| 180 | RegisterHandlers(functions); | 180 | RegisterHandlers(functions); |
| 181 | 181 | ||
| 182 | auto& kernel = system.Kernel(); | 182 | auto& kernel = system.Kernel(); |
| 183 | buffer_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, | 183 | buffer_event = |
| 184 | "IAudioOutBufferReleasedEvent"); | 184 | Kernel::WritableEvent::CreateEventPair(kernel, "IAudioOutBufferReleasedEvent"); |
| 185 | 185 | ||
| 186 | // Should be similar to audio_output_device_switch_event | 186 | // Should be similar to audio_output_device_switch_event |
| 187 | audio_input_device_switch_event = Kernel::WritableEvent::CreateEventPair( | 187 | audio_input_device_switch_event = Kernel::WritableEvent::CreateEventPair( |
| 188 | kernel, Kernel::ResetType::Automatic, "IAudioDevice:AudioInputDeviceSwitchedEvent"); | 188 | kernel, "IAudioDevice:AudioInputDeviceSwitchedEvent"); |
| 189 | 189 | ||
| 190 | // Should only be signalled when an audio output device has been changed, example: speaker | 190 | // Should only be signalled when an audio output device has been changed, example: speaker |
| 191 | // to headset | 191 | // to headset |
| 192 | audio_output_device_switch_event = Kernel::WritableEvent::CreateEventPair( | 192 | audio_output_device_switch_event = Kernel::WritableEvent::CreateEventPair( |
| 193 | kernel, Kernel::ResetType::Automatic, "IAudioDevice:AudioOutputDeviceSwitchedEvent"); | 193 | kernel, "IAudioDevice:AudioOutputDeviceSwitchedEvent"); |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | private: | 196 | private: |
diff --git a/src/core/hle/service/bcat/backend/backend.cpp b/src/core/hle/service/bcat/backend/backend.cpp index b86fda29a..dec0849b8 100644 --- a/src/core/hle/service/bcat/backend/backend.cpp +++ b/src/core/hle/service/bcat/backend/backend.cpp | |||
| @@ -13,8 +13,7 @@ namespace Service::BCAT { | |||
| 13 | ProgressServiceBackend::ProgressServiceBackend(Kernel::KernelCore& kernel, | 13 | ProgressServiceBackend::ProgressServiceBackend(Kernel::KernelCore& kernel, |
| 14 | std::string_view event_name) { | 14 | std::string_view event_name) { |
| 15 | event = Kernel::WritableEvent::CreateEventPair( | 15 | event = Kernel::WritableEvent::CreateEventPair( |
| 16 | kernel, Kernel::ResetType::Automatic, | 16 | kernel, std::string("ProgressServiceBackend:UpdateEvent:").append(event_name)); |
| 17 | std::string("ProgressServiceBackend:UpdateEvent:").append(event_name)); | ||
| 18 | } | 17 | } |
| 19 | 18 | ||
| 20 | Kernel::SharedPtr<Kernel::ReadableEvent> ProgressServiceBackend::GetEvent() const { | 19 | Kernel::SharedPtr<Kernel::ReadableEvent> ProgressServiceBackend::GetEvent() const { |
diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp index afce581e5..4574d9572 100644 --- a/src/core/hle/service/btdrv/btdrv.cpp +++ b/src/core/hle/service/btdrv/btdrv.cpp | |||
| @@ -34,8 +34,7 @@ public: | |||
| 34 | RegisterHandlers(functions); | 34 | RegisterHandlers(functions); |
| 35 | 35 | ||
| 36 | auto& kernel = system.Kernel(); | 36 | auto& kernel = system.Kernel(); |
| 37 | register_event = Kernel::WritableEvent::CreateEventPair( | 37 | register_event = Kernel::WritableEvent::CreateEventPair(kernel, "BT:RegisterEvent"); |
| 38 | kernel, Kernel::ResetType::Automatic, "BT:RegisterEvent"); | ||
| 39 | } | 38 | } |
| 40 | 39 | ||
| 41 | private: | 40 | private: |
diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp index 920fc6ff7..251b3c9df 100644 --- a/src/core/hle/service/btm/btm.cpp +++ b/src/core/hle/service/btm/btm.cpp | |||
| @@ -57,14 +57,12 @@ public: | |||
| 57 | RegisterHandlers(functions); | 57 | RegisterHandlers(functions); |
| 58 | 58 | ||
| 59 | auto& kernel = system.Kernel(); | 59 | auto& kernel = system.Kernel(); |
| 60 | scan_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, | 60 | scan_event = Kernel::WritableEvent::CreateEventPair(kernel, "IBtmUserCore:ScanEvent"); |
| 61 | "IBtmUserCore:ScanEvent"); | 61 | connection_event = |
| 62 | connection_event = Kernel::WritableEvent::CreateEventPair( | 62 | Kernel::WritableEvent::CreateEventPair(kernel, "IBtmUserCore:ConnectionEvent"); |
| 63 | kernel, Kernel::ResetType::Automatic, "IBtmUserCore:ConnectionEvent"); | 63 | service_discovery = |
| 64 | service_discovery = Kernel::WritableEvent::CreateEventPair( | 64 | Kernel::WritableEvent::CreateEventPair(kernel, "IBtmUserCore:Discovery"); |
| 65 | kernel, Kernel::ResetType::Automatic, "IBtmUserCore:Discovery"); | 65 | config_event = Kernel::WritableEvent::CreateEventPair(kernel, "IBtmUserCore:ConfigEvent"); |
| 66 | config_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, | ||
| 67 | "IBtmUserCore:ConfigEvent"); | ||
| 68 | } | 66 | } |
| 69 | 67 | ||
| 70 | private: | 68 | private: |
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp index 75dd9043b..1a0214f08 100644 --- a/src/core/hle/service/friend/friend.cpp +++ b/src/core/hle/service/friend/friend.cpp | |||
| @@ -162,7 +162,7 @@ public: | |||
| 162 | RegisterHandlers(functions); | 162 | RegisterHandlers(functions); |
| 163 | 163 | ||
| 164 | notification_event = Kernel::WritableEvent::CreateEventPair( | 164 | notification_event = Kernel::WritableEvent::CreateEventPair( |
| 165 | system.Kernel(), Kernel::ResetType::Manual, "INotificationService:NotifyEvent"); | 165 | system.Kernel(), "INotificationService:NotifyEvent"); |
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | private: | 168 | private: |
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 81bd2f3cb..79fff517e 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -174,7 +174,7 @@ void Controller_NPad::OnInit() { | |||
| 174 | auto& kernel = system.Kernel(); | 174 | auto& kernel = system.Kernel(); |
| 175 | for (std::size_t i = 0; i < styleset_changed_events.size(); i++) { | 175 | for (std::size_t i = 0; i < styleset_changed_events.size(); i++) { |
| 176 | styleset_changed_events[i] = Kernel::WritableEvent::CreateEventPair( | 176 | styleset_changed_events[i] = Kernel::WritableEvent::CreateEventPair( |
| 177 | kernel, Kernel::ResetType::Manual, fmt::format("npad:NpadStyleSetChanged_{}", i)); | 177 | kernel, fmt::format("npad:NpadStyleSetChanged_{}", i)); |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | if (!IsControllerActivated()) { | 180 | if (!IsControllerActivated()) { |
diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index aa886cd3e..795d7b716 100644 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp | |||
| @@ -26,8 +26,7 @@ constexpr ResultCode ERR_NO_APPLICATION_AREA(ErrorModule::NFP, 152); | |||
| 26 | Module::Interface::Interface(std::shared_ptr<Module> module, Core::System& system, const char* name) | 26 | Module::Interface::Interface(std::shared_ptr<Module> module, Core::System& system, const char* name) |
| 27 | : ServiceFramework(name), module(std::move(module)), system(system) { | 27 | : ServiceFramework(name), module(std::move(module)), system(system) { |
| 28 | auto& kernel = system.Kernel(); | 28 | auto& kernel = system.Kernel(); |
| 29 | nfc_tag_load = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, | 29 | nfc_tag_load = Kernel::WritableEvent::CreateEventPair(kernel, "IUser:NFCTagDetected"); |
| 30 | "IUser:NFCTagDetected"); | ||
| 31 | } | 30 | } |
| 32 | 31 | ||
| 33 | Module::Interface::~Interface() = default; | 32 | Module::Interface::~Interface() = default; |
| @@ -66,10 +65,9 @@ public: | |||
| 66 | RegisterHandlers(functions); | 65 | RegisterHandlers(functions); |
| 67 | 66 | ||
| 68 | auto& kernel = system.Kernel(); | 67 | auto& kernel = system.Kernel(); |
| 69 | deactivate_event = Kernel::WritableEvent::CreateEventPair( | 68 | deactivate_event = Kernel::WritableEvent::CreateEventPair(kernel, "IUser:DeactivateEvent"); |
| 70 | kernel, Kernel::ResetType::Automatic, "IUser:DeactivateEvent"); | 69 | availability_change_event = |
| 71 | availability_change_event = Kernel::WritableEvent::CreateEventPair( | 70 | Kernel::WritableEvent::CreateEventPair(kernel, "IUser:AvailabilityChangeEvent"); |
| 72 | kernel, Kernel::ResetType::Automatic, "IUser:AvailabilityChangeEvent"); | ||
| 73 | } | 71 | } |
| 74 | 72 | ||
| 75 | private: | 73 | private: |
diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 756a2af57..01d557c7a 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp | |||
| @@ -69,10 +69,8 @@ public: | |||
| 69 | RegisterHandlers(functions); | 69 | RegisterHandlers(functions); |
| 70 | 70 | ||
| 71 | auto& kernel = system.Kernel(); | 71 | auto& kernel = system.Kernel(); |
| 72 | event1 = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, | 72 | event1 = Kernel::WritableEvent::CreateEventPair(kernel, "IRequest:Event1"); |
| 73 | "IRequest:Event1"); | 73 | event2 = Kernel::WritableEvent::CreateEventPair(kernel, "IRequest:Event2"); |
| 74 | event2 = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic, | ||
| 75 | "IRequest:Event2"); | ||
| 76 | } | 74 | } |
| 77 | 75 | ||
| 78 | private: | 76 | private: |
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index 75d414952..7d6cf2070 100644 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp | |||
| @@ -141,8 +141,7 @@ public: | |||
| 141 | 141 | ||
| 142 | auto& kernel = system.Kernel(); | 142 | auto& kernel = system.Kernel(); |
| 143 | finished_event = Kernel::WritableEvent::CreateEventPair( | 143 | finished_event = Kernel::WritableEvent::CreateEventPair( |
| 144 | kernel, Kernel::ResetType::Automatic, | 144 | kernel, "IEnsureNetworkClockAvailabilityService:FinishEvent"); |
| 145 | "IEnsureNetworkClockAvailabilityService:FinishEvent"); | ||
| 146 | } | 145 | } |
| 147 | 146 | ||
| 148 | private: | 147 | private: |
diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index 7bfb99e34..cc9cd3fd1 100644 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp | |||
| @@ -40,8 +40,7 @@ Module::Module(Core::System& system) { | |||
| 40 | auto& kernel = system.Kernel(); | 40 | auto& kernel = system.Kernel(); |
| 41 | for (u32 i = 0; i < MaxNvEvents; i++) { | 41 | for (u32 i = 0; i < MaxNvEvents; i++) { |
| 42 | std::string event_label = fmt::format("NVDRV::NvEvent_{}", i); | 42 | std::string event_label = fmt::format("NVDRV::NvEvent_{}", i); |
| 43 | events_interface.events[i] = | 43 | events_interface.events[i] = Kernel::WritableEvent::CreateEventPair(kernel, event_label); |
| 44 | Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Manual, event_label); | ||
| 45 | events_interface.status[i] = EventState::Free; | 44 | events_interface.status[i] = EventState::Free; |
| 46 | events_interface.registered[i] = false; | 45 | events_interface.registered[i] = false; |
| 47 | } | 46 | } |
diff --git a/src/core/hle/service/nvflinger/buffer_queue.cpp b/src/core/hle/service/nvflinger/buffer_queue.cpp index 55b68eb0c..1af11e80c 100644 --- a/src/core/hle/service/nvflinger/buffer_queue.cpp +++ b/src/core/hle/service/nvflinger/buffer_queue.cpp | |||
| @@ -16,8 +16,7 @@ namespace Service::NVFlinger { | |||
| 16 | 16 | ||
| 17 | BufferQueue::BufferQueue(Kernel::KernelCore& kernel, u32 id, u64 layer_id) | 17 | BufferQueue::BufferQueue(Kernel::KernelCore& kernel, u32 id, u64 layer_id) |
| 18 | : id(id), layer_id(layer_id) { | 18 | : id(id), layer_id(layer_id) { |
| 19 | buffer_wait_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Manual, | 19 | buffer_wait_event = Kernel::WritableEvent::CreateEventPair(kernel, "BufferQueue NativeHandle"); |
| 20 | "BufferQueue NativeHandle"); | ||
| 21 | } | 20 | } |
| 22 | 21 | ||
| 23 | BufferQueue::~BufferQueue() = default; | 22 | BufferQueue::~BufferQueue() = default; |
diff --git a/src/core/hle/service/vi/display/vi_display.cpp b/src/core/hle/service/vi/display/vi_display.cpp index 006a6d9ff..07033fb98 100644 --- a/src/core/hle/service/vi/display/vi_display.cpp +++ b/src/core/hle/service/vi/display/vi_display.cpp | |||
| @@ -17,8 +17,8 @@ namespace Service::VI { | |||
| 17 | 17 | ||
| 18 | Display::Display(u64 id, std::string name, Core::System& system) : id{id}, name{std::move(name)} { | 18 | Display::Display(u64 id, std::string name, Core::System& system) : id{id}, name{std::move(name)} { |
| 19 | auto& kernel = system.Kernel(); | 19 | auto& kernel = system.Kernel(); |
| 20 | vsync_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Manual, | 20 | vsync_event = |
| 21 | fmt::format("Display VSync Event {}", id)); | 21 | Kernel::WritableEvent::CreateEventPair(kernel, fmt::format("Display VSync Event {}", id)); |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | Display::~Display() = default; | 24 | Display::~Display() = default; |
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 2442ddfd6..4408b5001 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h | |||
| @@ -12,6 +12,10 @@ | |||
| 12 | #include <utility> | 12 | #include <utility> |
| 13 | #include <vector> | 13 | #include <vector> |
| 14 | 14 | ||
| 15 | #include <boost/icl/interval_map.hpp> | ||
| 16 | #include <boost/icl/interval_set.hpp> | ||
| 17 | #include <boost/range/iterator_range.hpp> | ||
| 18 | |||
| 15 | #include "common/alignment.h" | 19 | #include "common/alignment.h" |
| 16 | #include "common/common_types.h" | 20 | #include "common/common_types.h" |
| 17 | #include "core/core.h" | 21 | #include "core/core.h" |
| @@ -30,7 +34,7 @@ public: | |||
| 30 | using BufferInfo = std::pair<const TBufferType*, u64>; | 34 | using BufferInfo = std::pair<const TBufferType*, u64>; |
| 31 | 35 | ||
| 32 | BufferInfo UploadMemory(GPUVAddr gpu_addr, std::size_t size, std::size_t alignment = 4, | 36 | BufferInfo UploadMemory(GPUVAddr gpu_addr, std::size_t size, std::size_t alignment = 4, |
| 33 | bool is_written = false) { | 37 | bool is_written = false, bool use_fast_cbuf = false) { |
| 34 | std::lock_guard lock{mutex}; | 38 | std::lock_guard lock{mutex}; |
| 35 | 39 | ||
| 36 | auto& memory_manager = system.GPU().MemoryManager(); | 40 | auto& memory_manager = system.GPU().MemoryManager(); |
| @@ -43,9 +47,13 @@ public: | |||
| 43 | // Cache management is a big overhead, so only cache entries with a given size. | 47 | // Cache management is a big overhead, so only cache entries with a given size. |
| 44 | // TODO: Figure out which size is the best for given games. | 48 | // TODO: Figure out which size is the best for given games. |
| 45 | constexpr std::size_t max_stream_size = 0x800; | 49 | constexpr std::size_t max_stream_size = 0x800; |
| 46 | if (size < max_stream_size) { | 50 | if (use_fast_cbuf || size < max_stream_size) { |
| 47 | if (!is_written && !IsRegionWritten(cache_addr, cache_addr + size - 1)) { | 51 | if (!is_written && !IsRegionWritten(cache_addr, cache_addr + size - 1)) { |
| 48 | return StreamBufferUpload(host_ptr, size, alignment); | 52 | if (use_fast_cbuf) { |
| 53 | return ConstBufferUpload(host_ptr, size); | ||
| 54 | } else { | ||
| 55 | return StreamBufferUpload(host_ptr, size, alignment); | ||
| 56 | } | ||
| 49 | } | 57 | } |
| 50 | } | 58 | } |
| 51 | 59 | ||
| @@ -152,6 +160,10 @@ protected: | |||
| 152 | virtual void CopyBlock(const TBuffer& src, const TBuffer& dst, std::size_t src_offset, | 160 | virtual void CopyBlock(const TBuffer& src, const TBuffer& dst, std::size_t src_offset, |
| 153 | std::size_t dst_offset, std::size_t size) = 0; | 161 | std::size_t dst_offset, std::size_t size) = 0; |
| 154 | 162 | ||
| 163 | virtual BufferInfo ConstBufferUpload(const void* raw_pointer, std::size_t size) { | ||
| 164 | return {}; | ||
| 165 | } | ||
| 166 | |||
| 155 | /// Register an object into the cache | 167 | /// Register an object into the cache |
| 156 | void Register(const MapInterval& new_map, bool inherit_written = false) { | 168 | void Register(const MapInterval& new_map, bool inherit_written = false) { |
| 157 | const CacheAddr cache_ptr = new_map->GetStart(); | 169 | const CacheAddr cache_ptr = new_map->GetStart(); |
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.cpp b/src/video_core/renderer_opengl/gl_buffer_cache.cpp index f8a807c84..0375fca17 100644 --- a/src/video_core/renderer_opengl/gl_buffer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_buffer_cache.cpp | |||
| @@ -8,13 +8,17 @@ | |||
| 8 | 8 | ||
| 9 | #include "common/assert.h" | 9 | #include "common/assert.h" |
| 10 | #include "common/microprofile.h" | 10 | #include "common/microprofile.h" |
| 11 | #include "video_core/engines/maxwell_3d.h" | ||
| 11 | #include "video_core/rasterizer_interface.h" | 12 | #include "video_core/rasterizer_interface.h" |
| 12 | #include "video_core/renderer_opengl/gl_buffer_cache.h" | 13 | #include "video_core/renderer_opengl/gl_buffer_cache.h" |
| 14 | #include "video_core/renderer_opengl/gl_device.h" | ||
| 13 | #include "video_core/renderer_opengl/gl_rasterizer.h" | 15 | #include "video_core/renderer_opengl/gl_rasterizer.h" |
| 14 | #include "video_core/renderer_opengl/gl_resource_manager.h" | 16 | #include "video_core/renderer_opengl/gl_resource_manager.h" |
| 15 | 17 | ||
| 16 | namespace OpenGL { | 18 | namespace OpenGL { |
| 17 | 19 | ||
| 20 | using Maxwell = Tegra::Engines::Maxwell3D::Regs; | ||
| 21 | |||
| 18 | MICROPROFILE_DEFINE(OpenGL_Buffer_Download, "OpenGL", "Buffer Download", MP_RGB(192, 192, 128)); | 22 | MICROPROFILE_DEFINE(OpenGL_Buffer_Download, "OpenGL", "Buffer Download", MP_RGB(192, 192, 128)); |
| 19 | 23 | ||
| 20 | CachedBufferBlock::CachedBufferBlock(CacheAddr cache_addr, const std::size_t size) | 24 | CachedBufferBlock::CachedBufferBlock(CacheAddr cache_addr, const std::size_t size) |
| @@ -26,11 +30,22 @@ CachedBufferBlock::CachedBufferBlock(CacheAddr cache_addr, const std::size_t siz | |||
| 26 | CachedBufferBlock::~CachedBufferBlock() = default; | 30 | CachedBufferBlock::~CachedBufferBlock() = default; |
| 27 | 31 | ||
| 28 | OGLBufferCache::OGLBufferCache(RasterizerOpenGL& rasterizer, Core::System& system, | 32 | OGLBufferCache::OGLBufferCache(RasterizerOpenGL& rasterizer, Core::System& system, |
| 29 | std::size_t stream_size) | 33 | const Device& device, std::size_t stream_size) |
| 30 | : VideoCommon::BufferCache<Buffer, GLuint, OGLStreamBuffer>{ | 34 | : GenericBufferCache{rasterizer, system, std::make_unique<OGLStreamBuffer>(stream_size, true)} { |
| 31 | rasterizer, system, std::make_unique<OGLStreamBuffer>(stream_size, true)} {} | 35 | if (!device.HasFastBufferSubData()) { |
| 36 | return; | ||
| 37 | } | ||
| 38 | |||
| 39 | static constexpr auto size = static_cast<GLsizeiptr>(Maxwell::MaxConstBufferSize); | ||
| 40 | glCreateBuffers(static_cast<GLsizei>(std::size(cbufs)), std::data(cbufs)); | ||
| 41 | for (const GLuint cbuf : cbufs) { | ||
| 42 | glNamedBufferData(cbuf, size, nullptr, GL_STREAM_DRAW); | ||
| 43 | } | ||
| 44 | } | ||
| 32 | 45 | ||
| 33 | OGLBufferCache::~OGLBufferCache() = default; | 46 | OGLBufferCache::~OGLBufferCache() { |
| 47 | glDeleteBuffers(static_cast<GLsizei>(std::size(cbufs)), std::data(cbufs)); | ||
| 48 | } | ||
| 34 | 49 | ||
| 35 | Buffer OGLBufferCache::CreateBlock(CacheAddr cache_addr, std::size_t size) { | 50 | Buffer OGLBufferCache::CreateBlock(CacheAddr cache_addr, std::size_t size) { |
| 36 | return std::make_shared<CachedBufferBlock>(cache_addr, size); | 51 | return std::make_shared<CachedBufferBlock>(cache_addr, size); |
| @@ -69,4 +84,12 @@ void OGLBufferCache::CopyBlock(const Buffer& src, const Buffer& dst, std::size_t | |||
| 69 | static_cast<GLsizeiptr>(size)); | 84 | static_cast<GLsizeiptr>(size)); |
| 70 | } | 85 | } |
| 71 | 86 | ||
| 87 | OGLBufferCache::BufferInfo OGLBufferCache::ConstBufferUpload(const void* raw_pointer, | ||
| 88 | std::size_t size) { | ||
| 89 | DEBUG_ASSERT(cbuf_cursor < std::size(cbufs)); | ||
| 90 | const GLuint& cbuf = cbufs[cbuf_cursor++]; | ||
| 91 | glNamedBufferSubData(cbuf, 0, static_cast<GLsizeiptr>(size), raw_pointer); | ||
| 92 | return {&cbuf, 0}; | ||
| 93 | } | ||
| 94 | |||
| 72 | } // namespace OpenGL | 95 | } // namespace OpenGL |
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.h b/src/video_core/renderer_opengl/gl_buffer_cache.h index 022e7bfa9..8c7145443 100644 --- a/src/video_core/renderer_opengl/gl_buffer_cache.h +++ b/src/video_core/renderer_opengl/gl_buffer_cache.h | |||
| @@ -4,10 +4,12 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | ||
| 7 | #include <memory> | 8 | #include <memory> |
| 8 | 9 | ||
| 9 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 10 | #include "video_core/buffer_cache/buffer_cache.h" | 11 | #include "video_core/buffer_cache/buffer_cache.h" |
| 12 | #include "video_core/engines/maxwell_3d.h" | ||
| 11 | #include "video_core/rasterizer_cache.h" | 13 | #include "video_core/rasterizer_cache.h" |
| 12 | #include "video_core/renderer_opengl/gl_resource_manager.h" | 14 | #include "video_core/renderer_opengl/gl_resource_manager.h" |
| 13 | #include "video_core/renderer_opengl/gl_stream_buffer.h" | 15 | #include "video_core/renderer_opengl/gl_stream_buffer.h" |
| @@ -18,12 +20,14 @@ class System; | |||
| 18 | 20 | ||
| 19 | namespace OpenGL { | 21 | namespace OpenGL { |
| 20 | 22 | ||
| 23 | class Device; | ||
| 21 | class OGLStreamBuffer; | 24 | class OGLStreamBuffer; |
| 22 | class RasterizerOpenGL; | 25 | class RasterizerOpenGL; |
| 23 | 26 | ||
| 24 | class CachedBufferBlock; | 27 | class CachedBufferBlock; |
| 25 | 28 | ||
| 26 | using Buffer = std::shared_ptr<CachedBufferBlock>; | 29 | using Buffer = std::shared_ptr<CachedBufferBlock>; |
| 30 | using GenericBufferCache = VideoCommon::BufferCache<Buffer, GLuint, OGLStreamBuffer>; | ||
| 27 | 31 | ||
| 28 | class CachedBufferBlock : public VideoCommon::BufferBlock { | 32 | class CachedBufferBlock : public VideoCommon::BufferBlock { |
| 29 | public: | 33 | public: |
| @@ -38,14 +42,18 @@ private: | |||
| 38 | OGLBuffer gl_buffer{}; | 42 | OGLBuffer gl_buffer{}; |
| 39 | }; | 43 | }; |
| 40 | 44 | ||
| 41 | class OGLBufferCache final : public VideoCommon::BufferCache<Buffer, GLuint, OGLStreamBuffer> { | 45 | class OGLBufferCache final : public GenericBufferCache { |
| 42 | public: | 46 | public: |
| 43 | explicit OGLBufferCache(RasterizerOpenGL& rasterizer, Core::System& system, | 47 | explicit OGLBufferCache(RasterizerOpenGL& rasterizer, Core::System& system, |
| 44 | std::size_t stream_size); | 48 | const Device& device, std::size_t stream_size); |
| 45 | ~OGLBufferCache(); | 49 | ~OGLBufferCache(); |
| 46 | 50 | ||
| 47 | const GLuint* GetEmptyBuffer(std::size_t) override; | 51 | const GLuint* GetEmptyBuffer(std::size_t) override; |
| 48 | 52 | ||
| 53 | void Acquire() noexcept { | ||
| 54 | cbuf_cursor = 0; | ||
| 55 | } | ||
| 56 | |||
| 49 | protected: | 57 | protected: |
| 50 | Buffer CreateBlock(CacheAddr cache_addr, std::size_t size) override; | 58 | Buffer CreateBlock(CacheAddr cache_addr, std::size_t size) override; |
| 51 | 59 | ||
| @@ -61,6 +69,14 @@ protected: | |||
| 61 | 69 | ||
| 62 | void CopyBlock(const Buffer& src, const Buffer& dst, std::size_t src_offset, | 70 | void CopyBlock(const Buffer& src, const Buffer& dst, std::size_t src_offset, |
| 63 | std::size_t dst_offset, std::size_t size) override; | 71 | std::size_t dst_offset, std::size_t size) override; |
| 72 | |||
| 73 | BufferInfo ConstBufferUpload(const void* raw_pointer, std::size_t size) override; | ||
| 74 | |||
| 75 | private: | ||
| 76 | std::size_t cbuf_cursor = 0; | ||
| 77 | std::array<GLuint, Tegra::Engines::Maxwell3D::Regs::MaxConstBuffers * | ||
| 78 | Tegra::Engines::Maxwell3D::Regs::MaxShaderProgram> | ||
| 79 | cbufs; | ||
| 64 | }; | 80 | }; |
| 65 | 81 | ||
| 66 | } // namespace OpenGL | 82 | } // namespace OpenGL |
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index 64de7e425..c65b24c69 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp | |||
| @@ -51,8 +51,11 @@ bool HasExtension(const std::vector<std::string_view>& images, std::string_view | |||
| 51 | } // Anonymous namespace | 51 | } // Anonymous namespace |
| 52 | 52 | ||
| 53 | Device::Device() { | 53 | Device::Device() { |
| 54 | const std::string_view vendor = reinterpret_cast<const char*>(glGetString(GL_VENDOR)); | ||
| 54 | const std::vector extensions = GetExtensions(); | 55 | const std::vector extensions = GetExtensions(); |
| 55 | 56 | ||
| 57 | const bool is_nvidia = vendor == "NVIDIA Corporation"; | ||
| 58 | |||
| 56 | uniform_buffer_alignment = GetInteger<std::size_t>(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT); | 59 | uniform_buffer_alignment = GetInteger<std::size_t>(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT); |
| 57 | shader_storage_alignment = GetInteger<std::size_t>(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT); | 60 | shader_storage_alignment = GetInteger<std::size_t>(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT); |
| 58 | max_vertex_attributes = GetInteger<u32>(GL_MAX_VERTEX_ATTRIBS); | 61 | max_vertex_attributes = GetInteger<u32>(GL_MAX_VERTEX_ATTRIBS); |
| @@ -64,6 +67,7 @@ Device::Device() { | |||
| 64 | has_variable_aoffi = TestVariableAoffi(); | 67 | has_variable_aoffi = TestVariableAoffi(); |
| 65 | has_component_indexing_bug = TestComponentIndexingBug(); | 68 | has_component_indexing_bug = TestComponentIndexingBug(); |
| 66 | has_precise_bug = TestPreciseBug(); | 69 | has_precise_bug = TestPreciseBug(); |
| 70 | has_fast_buffer_sub_data = is_nvidia; | ||
| 67 | 71 | ||
| 68 | LOG_INFO(Render_OpenGL, "Renderer_VariableAOFFI: {}", has_variable_aoffi); | 72 | LOG_INFO(Render_OpenGL, "Renderer_VariableAOFFI: {}", has_variable_aoffi); |
| 69 | LOG_INFO(Render_OpenGL, "Renderer_ComponentIndexingBug: {}", has_component_indexing_bug); | 73 | LOG_INFO(Render_OpenGL, "Renderer_ComponentIndexingBug: {}", has_component_indexing_bug); |
diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h index bb273c3d6..bf35bd0b6 100644 --- a/src/video_core/renderer_opengl/gl_device.h +++ b/src/video_core/renderer_opengl/gl_device.h | |||
| @@ -54,6 +54,10 @@ public: | |||
| 54 | return has_precise_bug; | 54 | return has_precise_bug; |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | bool HasFastBufferSubData() const { | ||
| 58 | return has_fast_buffer_sub_data; | ||
| 59 | } | ||
| 60 | |||
| 57 | private: | 61 | private: |
| 58 | static bool TestVariableAoffi(); | 62 | static bool TestVariableAoffi(); |
| 59 | static bool TestComponentIndexingBug(); | 63 | static bool TestComponentIndexingBug(); |
| @@ -69,6 +73,7 @@ private: | |||
| 69 | bool has_variable_aoffi{}; | 73 | bool has_variable_aoffi{}; |
| 70 | bool has_component_indexing_bug{}; | 74 | bool has_component_indexing_bug{}; |
| 71 | bool has_precise_bug{}; | 75 | bool has_precise_bug{}; |
| 76 | bool has_fast_buffer_sub_data{}; | ||
| 72 | }; | 77 | }; |
| 73 | 78 | ||
| 74 | } // namespace OpenGL | 79 | } // namespace OpenGL |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index d1e147db8..e560d70d5 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -67,7 +67,7 @@ static std::size_t GetConstBufferSize(const Tegra::Engines::ConstBufferInfo& buf | |||
| 67 | RasterizerOpenGL::RasterizerOpenGL(Core::System& system, Core::Frontend::EmuWindow& emu_window, | 67 | RasterizerOpenGL::RasterizerOpenGL(Core::System& system, Core::Frontend::EmuWindow& emu_window, |
| 68 | ScreenInfo& info) | 68 | ScreenInfo& info) |
| 69 | : texture_cache{system, *this, device}, shader_cache{*this, system, emu_window, device}, | 69 | : texture_cache{system, *this, device}, shader_cache{*this, system, emu_window, device}, |
| 70 | system{system}, screen_info{info}, buffer_cache{*this, system, STREAM_BUFFER_SIZE} { | 70 | system{system}, screen_info{info}, buffer_cache{*this, system, device, STREAM_BUFFER_SIZE} { |
| 71 | shader_program_manager = std::make_unique<GLShader::ProgramManager>(); | 71 | shader_program_manager = std::make_unique<GLShader::ProgramManager>(); |
| 72 | state.draw.shader_program = 0; | 72 | state.draw.shader_program = 0; |
| 73 | state.Apply(); | 73 | state.Apply(); |
| @@ -558,6 +558,8 @@ void RasterizerOpenGL::DrawPrelude() { | |||
| 558 | SyncPolygonOffset(); | 558 | SyncPolygonOffset(); |
| 559 | SyncAlphaTest(); | 559 | SyncAlphaTest(); |
| 560 | 560 | ||
| 561 | buffer_cache.Acquire(); | ||
| 562 | |||
| 561 | // Draw the vertex batch | 563 | // Draw the vertex batch |
| 562 | const bool is_indexed = accelerate_draw == AccelDraw::Indexed; | 564 | const bool is_indexed = accelerate_draw == AccelDraw::Indexed; |
| 563 | 565 | ||
| @@ -879,7 +881,8 @@ void RasterizerOpenGL::SetupConstBuffer(const Tegra::Engines::ConstBufferInfo& b | |||
| 879 | const std::size_t size = Common::AlignUp(GetConstBufferSize(buffer, entry), sizeof(GLvec4)); | 881 | const std::size_t size = Common::AlignUp(GetConstBufferSize(buffer, entry), sizeof(GLvec4)); |
| 880 | 882 | ||
| 881 | const auto alignment = device.GetUniformBufferAlignment(); | 883 | const auto alignment = device.GetUniformBufferAlignment(); |
| 882 | const auto [cbuf, offset] = buffer_cache.UploadMemory(buffer.address, size, alignment); | 884 | const auto [cbuf, offset] = buffer_cache.UploadMemory(buffer.address, size, alignment, false, |
| 885 | device.HasFastBufferSubData()); | ||
| 883 | bind_ubo_pushbuffer.Push(cbuf, offset, size); | 886 | bind_ubo_pushbuffer.Push(cbuf, offset, size); |
| 884 | } | 887 | } |
| 885 | 888 | ||
diff --git a/src/video_core/shader/decode/arithmetic.cpp b/src/video_core/shader/decode/arithmetic.cpp index 1473c282a..fcedd2af6 100644 --- a/src/video_core/shader/decode/arithmetic.cpp +++ b/src/video_core/shader/decode/arithmetic.cpp | |||
| @@ -43,12 +43,12 @@ u32 ShaderIR::DecodeArithmetic(NodeBlock& bb, u32 pc) { | |||
| 43 | case OpCode::Id::FMUL_IMM: { | 43 | case OpCode::Id::FMUL_IMM: { |
| 44 | // FMUL does not have 'abs' bits and only the second operand has a 'neg' bit. | 44 | // FMUL does not have 'abs' bits and only the second operand has a 'neg' bit. |
| 45 | if (instr.fmul.tab5cb8_2 != 0) { | 45 | if (instr.fmul.tab5cb8_2 != 0) { |
| 46 | LOG_WARNING(HW_GPU, "FMUL tab5cb8_2({}) is not implemented", | 46 | LOG_DEBUG(HW_GPU, "FMUL tab5cb8_2({}) is not implemented", |
| 47 | instr.fmul.tab5cb8_2.Value()); | 47 | instr.fmul.tab5cb8_2.Value()); |
| 48 | } | 48 | } |
| 49 | if (instr.fmul.tab5c68_0 != 1) { | 49 | if (instr.fmul.tab5c68_0 != 1) { |
| 50 | LOG_WARNING(HW_GPU, "FMUL tab5cb8_0({}) is not implemented", | 50 | LOG_DEBUG(HW_GPU, "FMUL tab5cb8_0({}) is not implemented", |
| 51 | instr.fmul.tab5c68_0.Value()); | 51 | instr.fmul.tab5c68_0.Value()); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | op_b = GetOperandAbsNegFloat(op_b, false, instr.fmul.negate_b); | 54 | op_b = GetOperandAbsNegFloat(op_b, false, instr.fmul.negate_b); |
| @@ -144,10 +144,11 @@ u32 ShaderIR::DecodeArithmetic(NodeBlock& bb, u32 pc) { | |||
| 144 | case OpCode::Id::RRO_C: | 144 | case OpCode::Id::RRO_C: |
| 145 | case OpCode::Id::RRO_R: | 145 | case OpCode::Id::RRO_R: |
| 146 | case OpCode::Id::RRO_IMM: { | 146 | case OpCode::Id::RRO_IMM: { |
| 147 | LOG_DEBUG(HW_GPU, "(STUBBED) RRO used"); | ||
| 148 | |||
| 147 | // Currently RRO is only implemented as a register move. | 149 | // Currently RRO is only implemented as a register move. |
| 148 | op_b = GetOperandAbsNegFloat(op_b, instr.alu.abs_b, instr.alu.negate_b); | 150 | op_b = GetOperandAbsNegFloat(op_b, instr.alu.abs_b, instr.alu.negate_b); |
| 149 | SetRegister(bb, instr.gpr0, op_b); | 151 | SetRegister(bb, instr.gpr0, op_b); |
| 150 | LOG_WARNING(HW_GPU, "RRO instruction is incomplete"); | ||
| 151 | break; | 152 | break; |
| 152 | } | 153 | } |
| 153 | default: | 154 | default: |
diff --git a/src/video_core/shader/decode/arithmetic_half.cpp b/src/video_core/shader/decode/arithmetic_half.cpp index b06cbe441..ee7d9a29d 100644 --- a/src/video_core/shader/decode/arithmetic_half.cpp +++ b/src/video_core/shader/decode/arithmetic_half.cpp | |||
| @@ -21,8 +21,8 @@ u32 ShaderIR::DecodeArithmeticHalf(NodeBlock& bb, u32 pc) { | |||
| 21 | 21 | ||
| 22 | if (opcode->get().GetId() == OpCode::Id::HADD2_C || | 22 | if (opcode->get().GetId() == OpCode::Id::HADD2_C || |
| 23 | opcode->get().GetId() == OpCode::Id::HADD2_R) { | 23 | opcode->get().GetId() == OpCode::Id::HADD2_R) { |
| 24 | if (instr.alu_half.ftz != 0) { | 24 | if (instr.alu_half.ftz == 0) { |
| 25 | LOG_WARNING(HW_GPU, "{} FTZ not implemented", opcode->get().GetName()); | 25 | LOG_DEBUG(HW_GPU, "{} without FTZ is not implemented", opcode->get().GetName()); |
| 26 | } | 26 | } |
| 27 | } | 27 | } |
| 28 | 28 | ||
diff --git a/src/video_core/shader/decode/arithmetic_half_immediate.cpp b/src/video_core/shader/decode/arithmetic_half_immediate.cpp index 6466fc011..d179b9873 100644 --- a/src/video_core/shader/decode/arithmetic_half_immediate.cpp +++ b/src/video_core/shader/decode/arithmetic_half_immediate.cpp | |||
| @@ -19,12 +19,12 @@ u32 ShaderIR::DecodeArithmeticHalfImmediate(NodeBlock& bb, u32 pc) { | |||
| 19 | const auto opcode = OpCode::Decode(instr); | 19 | const auto opcode = OpCode::Decode(instr); |
| 20 | 20 | ||
| 21 | if (opcode->get().GetId() == OpCode::Id::HADD2_IMM) { | 21 | if (opcode->get().GetId() == OpCode::Id::HADD2_IMM) { |
| 22 | if (instr.alu_half_imm.ftz != 0) { | 22 | if (instr.alu_half_imm.ftz == 0) { |
| 23 | LOG_WARNING(HW_GPU, "{} FTZ not implemented", opcode->get().GetName()); | 23 | LOG_DEBUG(HW_GPU, "{} without FTZ is not implemented", opcode->get().GetName()); |
| 24 | } | 24 | } |
| 25 | } else { | 25 | } else { |
| 26 | if (instr.alu_half_imm.precision != Tegra::Shader::HalfPrecision::None) { | 26 | if (instr.alu_half_imm.precision != Tegra::Shader::HalfPrecision::FTZ) { |
| 27 | LOG_WARNING(HW_GPU, "{} FTZ not implemented", opcode->get().GetName()); | 27 | LOG_DEBUG(HW_GPU, "{} without FTZ is not implemented", opcode->get().GetName()); |
| 28 | } | 28 | } |
| 29 | } | 29 | } |
| 30 | 30 | ||
diff --git a/src/video_core/shader/decode/ffma.cpp b/src/video_core/shader/decode/ffma.cpp index ca2f39e8d..5973588d6 100644 --- a/src/video_core/shader/decode/ffma.cpp +++ b/src/video_core/shader/decode/ffma.cpp | |||
| @@ -19,10 +19,10 @@ u32 ShaderIR::DecodeFfma(NodeBlock& bb, u32 pc) { | |||
| 19 | 19 | ||
| 20 | UNIMPLEMENTED_IF_MSG(instr.ffma.cc != 0, "FFMA cc not implemented"); | 20 | UNIMPLEMENTED_IF_MSG(instr.ffma.cc != 0, "FFMA cc not implemented"); |
| 21 | if (instr.ffma.tab5980_0 != 1) { | 21 | if (instr.ffma.tab5980_0 != 1) { |
| 22 | LOG_WARNING(HW_GPU, "FFMA tab5980_0({}) not implemented", instr.ffma.tab5980_0.Value()); | 22 | LOG_DEBUG(HW_GPU, "FFMA tab5980_0({}) not implemented", instr.ffma.tab5980_0.Value()); |
| 23 | } | 23 | } |
| 24 | if (instr.ffma.tab5980_1 != 0) { | 24 | if (instr.ffma.tab5980_1 != 0) { |
| 25 | LOG_WARNING(HW_GPU, "FFMA tab5980_1({}) not implemented", instr.ffma.tab5980_1.Value()); | 25 | LOG_DEBUG(HW_GPU, "FFMA tab5980_1({}) not implemented", instr.ffma.tab5980_1.Value()); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | const Node op_a = GetRegister(instr.gpr8); | 28 | const Node op_a = GetRegister(instr.gpr8); |
diff --git a/src/video_core/shader/decode/half_set.cpp b/src/video_core/shader/decode/half_set.cpp index 48ca7a4af..848e46874 100644 --- a/src/video_core/shader/decode/half_set.cpp +++ b/src/video_core/shader/decode/half_set.cpp | |||
| @@ -20,8 +20,8 @@ u32 ShaderIR::DecodeHalfSet(NodeBlock& bb, u32 pc) { | |||
| 20 | const Instruction instr = {program_code[pc]}; | 20 | const Instruction instr = {program_code[pc]}; |
| 21 | const auto opcode = OpCode::Decode(instr); | 21 | const auto opcode = OpCode::Decode(instr); |
| 22 | 22 | ||
| 23 | if (instr.hset2.ftz != 0) { | 23 | if (instr.hset2.ftz == 0) { |
| 24 | LOG_WARNING(HW_GPU, "{} FTZ not implemented", opcode->get().GetName()); | 24 | LOG_DEBUG(HW_GPU, "{} without FTZ is not implemented", opcode->get().GetName()); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | Node op_a = UnpackHalfFloat(GetRegister(instr.gpr8), instr.hset2.type_a); | 27 | Node op_a = UnpackHalfFloat(GetRegister(instr.gpr8), instr.hset2.type_a); |
diff --git a/src/video_core/shader/decode/half_set_predicate.cpp b/src/video_core/shader/decode/half_set_predicate.cpp index fec8f2dbe..310655619 100644 --- a/src/video_core/shader/decode/half_set_predicate.cpp +++ b/src/video_core/shader/decode/half_set_predicate.cpp | |||
| @@ -19,7 +19,9 @@ u32 ShaderIR::DecodeHalfSetPredicate(NodeBlock& bb, u32 pc) { | |||
| 19 | const Instruction instr = {program_code[pc]}; | 19 | const Instruction instr = {program_code[pc]}; |
| 20 | const auto opcode = OpCode::Decode(instr); | 20 | const auto opcode = OpCode::Decode(instr); |
| 21 | 21 | ||
| 22 | LOG_DEBUG(HW_GPU, "ftz={}", static_cast<u32>(instr.hsetp2.ftz)); | 22 | if (instr.hsetp2.ftz != 0) { |
| 23 | LOG_DEBUG(HW_GPU, "{} without FTZ is not implemented", opcode->get().GetName()); | ||
| 24 | } | ||
| 23 | 25 | ||
| 24 | Node op_a = UnpackHalfFloat(GetRegister(instr.gpr8), instr.hsetp2.type_a); | 26 | Node op_a = UnpackHalfFloat(GetRegister(instr.gpr8), instr.hsetp2.type_a); |
| 25 | op_a = GetOperandAbsNegHalf(op_a, instr.hsetp2.abs_a, instr.hsetp2.negate_a); | 27 | op_a = GetOperandAbsNegHalf(op_a, instr.hsetp2.abs_a, instr.hsetp2.negate_a); |
diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp index ca690b58b..bb926a132 100644 --- a/src/video_core/shader/decode/texture.cpp +++ b/src/video_core/shader/decode/texture.cpp | |||
| @@ -44,10 +44,6 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 44 | bool is_bindless = false; | 44 | bool is_bindless = false; |
| 45 | switch (opcode->get().GetId()) { | 45 | switch (opcode->get().GetId()) { |
| 46 | case OpCode::Id::TEX: { | 46 | case OpCode::Id::TEX: { |
| 47 | if (instr.tex.UsesMiscMode(TextureMiscMode::NODEP)) { | ||
| 48 | LOG_WARNING(HW_GPU, "TEX.NODEP implementation is incomplete"); | ||
| 49 | } | ||
| 50 | |||
| 51 | const TextureType texture_type{instr.tex.texture_type}; | 47 | const TextureType texture_type{instr.tex.texture_type}; |
| 52 | const bool is_array = instr.tex.array != 0; | 48 | const bool is_array = instr.tex.array != 0; |
| 53 | const bool is_aoffi = instr.tex.UsesMiscMode(TextureMiscMode::AOFFI); | 49 | const bool is_aoffi = instr.tex.UsesMiscMode(TextureMiscMode::AOFFI); |
| @@ -62,10 +58,6 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 62 | UNIMPLEMENTED_IF_MSG(instr.tex.UsesMiscMode(TextureMiscMode::AOFFI), | 58 | UNIMPLEMENTED_IF_MSG(instr.tex.UsesMiscMode(TextureMiscMode::AOFFI), |
| 63 | "AOFFI is not implemented"); | 59 | "AOFFI is not implemented"); |
| 64 | 60 | ||
| 65 | if (instr.tex.UsesMiscMode(TextureMiscMode::NODEP)) { | ||
| 66 | LOG_WARNING(HW_GPU, "TEX.NODEP implementation is incomplete"); | ||
| 67 | } | ||
| 68 | |||
| 69 | const TextureType texture_type{instr.tex_b.texture_type}; | 61 | const TextureType texture_type{instr.tex_b.texture_type}; |
| 70 | const bool is_array = instr.tex_b.array != 0; | 62 | const bool is_array = instr.tex_b.array != 0; |
| 71 | const bool is_aoffi = instr.tex.UsesMiscMode(TextureMiscMode::AOFFI); | 63 | const bool is_aoffi = instr.tex.UsesMiscMode(TextureMiscMode::AOFFI); |
| @@ -82,10 +74,6 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 82 | const bool depth_compare = instr.texs.UsesMiscMode(TextureMiscMode::DC); | 74 | const bool depth_compare = instr.texs.UsesMiscMode(TextureMiscMode::DC); |
| 83 | const auto process_mode = instr.texs.GetTextureProcessMode(); | 75 | const auto process_mode = instr.texs.GetTextureProcessMode(); |
| 84 | 76 | ||
| 85 | if (instr.texs.UsesMiscMode(TextureMiscMode::NODEP)) { | ||
| 86 | LOG_WARNING(HW_GPU, "TEXS.NODEP implementation is incomplete"); | ||
| 87 | } | ||
| 88 | |||
| 89 | const Node4 components = | 77 | const Node4 components = |
| 90 | GetTexsCode(instr, texture_type, process_mode, depth_compare, is_array); | 78 | GetTexsCode(instr, texture_type, process_mode, depth_compare, is_array); |
| 91 | 79 | ||
| @@ -107,10 +95,6 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 107 | UNIMPLEMENTED_IF_MSG(instr.tld4.UsesMiscMode(TextureMiscMode::PTP), | 95 | UNIMPLEMENTED_IF_MSG(instr.tld4.UsesMiscMode(TextureMiscMode::PTP), |
| 108 | "PTP is not implemented"); | 96 | "PTP is not implemented"); |
| 109 | 97 | ||
| 110 | if (instr.tld4.UsesMiscMode(TextureMiscMode::NODEP)) { | ||
| 111 | LOG_WARNING(HW_GPU, "TLD4.NODEP implementation is incomplete"); | ||
| 112 | } | ||
| 113 | |||
| 114 | const auto texture_type = instr.tld4.texture_type.Value(); | 98 | const auto texture_type = instr.tld4.texture_type.Value(); |
| 115 | const bool depth_compare = is_bindless ? instr.tld4_b.UsesMiscMode(TextureMiscMode::DC) | 99 | const bool depth_compare = is_bindless ? instr.tld4_b.UsesMiscMode(TextureMiscMode::DC) |
| 116 | : instr.tld4.UsesMiscMode(TextureMiscMode::DC); | 100 | : instr.tld4.UsesMiscMode(TextureMiscMode::DC); |
| @@ -125,9 +109,6 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 125 | case OpCode::Id::TLD4S: { | 109 | case OpCode::Id::TLD4S: { |
| 126 | UNIMPLEMENTED_IF_MSG(instr.tld4s.UsesMiscMode(TextureMiscMode::AOFFI), | 110 | UNIMPLEMENTED_IF_MSG(instr.tld4s.UsesMiscMode(TextureMiscMode::AOFFI), |
| 127 | "AOFFI is not implemented"); | 111 | "AOFFI is not implemented"); |
| 128 | if (instr.tld4s.UsesMiscMode(TextureMiscMode::NODEP)) { | ||
| 129 | LOG_WARNING(HW_GPU, "TLD4S.NODEP implementation is incomplete"); | ||
| 130 | } | ||
| 131 | 112 | ||
| 132 | const bool depth_compare = instr.tld4s.UsesMiscMode(TextureMiscMode::DC); | 113 | const bool depth_compare = instr.tld4s.UsesMiscMode(TextureMiscMode::DC); |
| 133 | const Node op_a = GetRegister(instr.gpr8); | 114 | const Node op_a = GetRegister(instr.gpr8); |
| @@ -164,10 +145,6 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 164 | is_bindless = true; | 145 | is_bindless = true; |
| 165 | [[fallthrough]]; | 146 | [[fallthrough]]; |
| 166 | case OpCode::Id::TXQ: { | 147 | case OpCode::Id::TXQ: { |
| 167 | if (instr.txq.UsesMiscMode(TextureMiscMode::NODEP)) { | ||
| 168 | LOG_WARNING(HW_GPU, "TXQ.NODEP implementation is incomplete"); | ||
| 169 | } | ||
| 170 | |||
| 171 | // TODO: The new commits on the texture refactor, change the way samplers work. | 148 | // TODO: The new commits on the texture refactor, change the way samplers work. |
| 172 | // Sadly, not all texture instructions specify the type of texture their sampler | 149 | // Sadly, not all texture instructions specify the type of texture their sampler |
| 173 | // uses. This must be fixed at a later instance. | 150 | // uses. This must be fixed at a later instance. |
| @@ -205,10 +182,6 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 205 | UNIMPLEMENTED_IF_MSG(instr.tmml.UsesMiscMode(Tegra::Shader::TextureMiscMode::NDV), | 182 | UNIMPLEMENTED_IF_MSG(instr.tmml.UsesMiscMode(Tegra::Shader::TextureMiscMode::NDV), |
| 206 | "NDV is not implemented"); | 183 | "NDV is not implemented"); |
| 207 | 184 | ||
| 208 | if (instr.tmml.UsesMiscMode(TextureMiscMode::NODEP)) { | ||
| 209 | LOG_WARNING(HW_GPU, "TMML.NODEP implementation is incomplete"); | ||
| 210 | } | ||
| 211 | |||
| 212 | auto texture_type = instr.tmml.texture_type.Value(); | 185 | auto texture_type = instr.tmml.texture_type.Value(); |
| 213 | const bool is_array = instr.tmml.array != 0; | 186 | const bool is_array = instr.tmml.array != 0; |
| 214 | const auto& sampler = | 187 | const auto& sampler = |
| @@ -254,10 +227,6 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 254 | UNIMPLEMENTED_IF_MSG(instr.tld.ms, "MS is not implemented"); | 227 | UNIMPLEMENTED_IF_MSG(instr.tld.ms, "MS is not implemented"); |
| 255 | UNIMPLEMENTED_IF_MSG(instr.tld.cl, "CL is not implemented"); | 228 | UNIMPLEMENTED_IF_MSG(instr.tld.cl, "CL is not implemented"); |
| 256 | 229 | ||
| 257 | if (instr.tld.nodep_flag) { | ||
| 258 | LOG_WARNING(HW_GPU, "TLD.NODEP implementation is incomplete"); | ||
| 259 | } | ||
| 260 | |||
| 261 | WriteTexInstructionFloat(bb, instr, GetTldCode(instr)); | 230 | WriteTexInstructionFloat(bb, instr, GetTldCode(instr)); |
| 262 | break; | 231 | break; |
| 263 | } | 232 | } |
| @@ -269,10 +238,6 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 269 | "AOFFI is not implemented"); | 238 | "AOFFI is not implemented"); |
| 270 | UNIMPLEMENTED_IF_MSG(instr.tlds.UsesMiscMode(TextureMiscMode::MZ), "MZ is not implemented"); | 239 | UNIMPLEMENTED_IF_MSG(instr.tlds.UsesMiscMode(TextureMiscMode::MZ), "MZ is not implemented"); |
| 271 | 240 | ||
| 272 | if (instr.tlds.UsesMiscMode(TextureMiscMode::NODEP)) { | ||
| 273 | LOG_WARNING(HW_GPU, "TLDS.NODEP implementation is incomplete"); | ||
| 274 | } | ||
| 275 | |||
| 276 | const Node4 components = GetTldsCode(instr, texture_type, is_array); | 241 | const Node4 components = GetTldsCode(instr, texture_type, is_array); |
| 277 | 242 | ||
| 278 | if (instr.tlds.fp32_flag) { | 243 | if (instr.tlds.fp32_flag) { |
diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp index c5b9aa08f..188f798c0 100644 --- a/src/yuzu/debugger/wait_tree.cpp +++ b/src/yuzu/debugger/wait_tree.cpp | |||
| @@ -172,17 +172,6 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeWaitObject::GetChildren() con | |||
| 172 | return list; | 172 | return list; |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | QString WaitTreeWaitObject::GetResetTypeQString(Kernel::ResetType reset_type) { | ||
| 176 | switch (reset_type) { | ||
| 177 | case Kernel::ResetType::Automatic: | ||
| 178 | return tr("automatic reset"); | ||
| 179 | case Kernel::ResetType::Manual: | ||
| 180 | return tr("manual reset"); | ||
| 181 | } | ||
| 182 | UNREACHABLE(); | ||
| 183 | return {}; | ||
| 184 | } | ||
| 185 | |||
| 186 | WaitTreeObjectList::WaitTreeObjectList( | 175 | WaitTreeObjectList::WaitTreeObjectList( |
| 187 | const std::vector<Kernel::SharedPtr<Kernel::WaitObject>>& list, bool w_all) | 176 | const std::vector<Kernel::SharedPtr<Kernel::WaitObject>>& list, bool w_all) |
| 188 | : object_list(list), wait_all(w_all) {} | 177 | : object_list(list), wait_all(w_all) {} |
| @@ -336,16 +325,6 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const { | |||
| 336 | WaitTreeEvent::WaitTreeEvent(const Kernel::ReadableEvent& object) : WaitTreeWaitObject(object) {} | 325 | WaitTreeEvent::WaitTreeEvent(const Kernel::ReadableEvent& object) : WaitTreeWaitObject(object) {} |
| 337 | WaitTreeEvent::~WaitTreeEvent() = default; | 326 | WaitTreeEvent::~WaitTreeEvent() = default; |
| 338 | 327 | ||
| 339 | std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeEvent::GetChildren() const { | ||
| 340 | std::vector<std::unique_ptr<WaitTreeItem>> list(WaitTreeWaitObject::GetChildren()); | ||
| 341 | |||
| 342 | list.push_back(std::make_unique<WaitTreeText>( | ||
| 343 | tr("reset type = %1") | ||
| 344 | .arg(GetResetTypeQString( | ||
| 345 | static_cast<const Kernel::ReadableEvent&>(object).GetResetType())))); | ||
| 346 | return list; | ||
| 347 | } | ||
| 348 | |||
| 349 | WaitTreeThreadList::WaitTreeThreadList(const std::vector<Kernel::SharedPtr<Kernel::Thread>>& list) | 328 | WaitTreeThreadList::WaitTreeThreadList(const std::vector<Kernel::SharedPtr<Kernel::Thread>>& list) |
| 350 | : thread_list(list) {} | 329 | : thread_list(list) {} |
| 351 | WaitTreeThreadList::~WaitTreeThreadList() = default; | 330 | WaitTreeThreadList::~WaitTreeThreadList() = default; |
diff --git a/src/yuzu/debugger/wait_tree.h b/src/yuzu/debugger/wait_tree.h index 62886609d..f2b13be24 100644 --- a/src/yuzu/debugger/wait_tree.h +++ b/src/yuzu/debugger/wait_tree.h | |||
| @@ -111,8 +111,6 @@ public: | |||
| 111 | 111 | ||
| 112 | protected: | 112 | protected: |
| 113 | const Kernel::WaitObject& object; | 113 | const Kernel::WaitObject& object; |
| 114 | |||
| 115 | static QString GetResetTypeQString(Kernel::ResetType reset_type); | ||
| 116 | }; | 114 | }; |
| 117 | 115 | ||
| 118 | class WaitTreeObjectList : public WaitTreeExpandableItem { | 116 | class WaitTreeObjectList : public WaitTreeExpandableItem { |
| @@ -146,8 +144,6 @@ class WaitTreeEvent : public WaitTreeWaitObject { | |||
| 146 | public: | 144 | public: |
| 147 | explicit WaitTreeEvent(const Kernel::ReadableEvent& object); | 145 | explicit WaitTreeEvent(const Kernel::ReadableEvent& object); |
| 148 | ~WaitTreeEvent() override; | 146 | ~WaitTreeEvent() override; |
| 149 | |||
| 150 | std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; | ||
| 151 | }; | 147 | }; |
| 152 | 148 | ||
| 153 | class WaitTreeThreadList : public WaitTreeExpandableItem { | 149 | class WaitTreeThreadList : public WaitTreeExpandableItem { |