early-access version 2161

This commit is contained in:
pineappleEA
2021-10-27 05:22:08 +02:00
parent 9ddc4e31b1
commit 4350036d17
18 changed files with 72 additions and 72 deletions

View File

@@ -32,10 +32,7 @@ static void RunThread(std::stop_token stop_token, Core::System& system,
VideoCore::RasterizerInterface* const rasterizer = renderer.ReadRasterizer();
while (!stop_token.stop_requested()) {
CommandDataContainer next;
if (!state.queue.try_pop(next)) {
continue;
}
CommandDataContainer next = state.queue.PopWait(stop_token);
if (stop_token.stop_requested()) {
break;
}
@@ -122,7 +119,7 @@ u64 ThreadManager::PushCommand(CommandData&& command_data, bool block) {
std::unique_lock lk(state.write_lock);
const u64 fence{++state.last_fence};
state.queue.push(CommandDataContainer(std::move(command_data), fence, block));
state.queue.Push(CommandDataContainer(std::move(command_data), fence, block));
if (block) {
state.cv.wait(lk, thread.get_stop_token(), [this, fence] {

View File

@@ -11,7 +11,7 @@
#include <thread>
#include <variant>
#include "common/atomic_threadsafe_queue.h"
#include "common/threadsafe_queue.h"
#include "video_core/framebuffer_config.h"
namespace Tegra {
@@ -97,9 +97,9 @@ struct CommandDataContainer {
/// Struct used to synchronize the GPU thread
struct SynchState final {
using CommandQueue = Common::MPMCQueue<CommandDataContainer>;
using CommandQueue = Common::SPSCQueue<CommandDataContainer, true>;
std::mutex write_lock;
CommandQueue queue{100000};
CommandQueue queue;
u64 last_fence{};
std::atomic<u64> signaled_fence{};
std::condition_variable_any cv;