Skip to content

Commit

Permalink
Merge pull request #18715 from hrydgard/more-beta-fixes
Browse files Browse the repository at this point in the history
More beta fixes
  • Loading branch information
hrydgard committed Jan 17, 2024
2 parents 9333c75 + cbb4236 commit 6b20fdf
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 150 deletions.
10 changes: 5 additions & 5 deletions Common/GPU/OpenGL/GLRenderManager.cpp
Expand Up @@ -43,7 +43,7 @@ GLRenderManager::GLRenderManager(HistoryBuffer<FrameTimeData, FRAME_TIME_HISTORY
}

GLRenderManager::~GLRenderManager() {
_dbg_assert_(!run_);
_dbg_assert_(!runCompileThread_);

for (int i = 0; i < MAX_INFLIGHT_FRAMES; i++) {
_assert_(frameData_[i].deleter.IsEmpty());
Expand Down Expand Up @@ -125,7 +125,7 @@ void GLRenderManager::ThreadEnd() {
//
// NOTE: If run_ is true, we WILL run a task!
bool GLRenderManager::ThreadFrame() {
if (!run_) {
if (!runCompileThread_) {
return false;
}

Expand Down Expand Up @@ -172,8 +172,8 @@ bool GLRenderManager::ThreadFrame() {
void GLRenderManager::StopThread() {
// There's not really a lot to do here anymore.
INFO_LOG(G3D, "GLRenderManager::StopThread()");
if (run_) {
run_ = false;
if (runCompileThread_) {
runCompileThread_ = false;

std::unique_lock<std::mutex> lock(pushMutex_);
renderThreadQueue_.push(new GLRRenderThreadTask(GLRRunType::EXIT));
Expand Down Expand Up @@ -368,7 +368,7 @@ void GLRenderManager::BeginFrame(bool enableProfiling) {
frameData.readyForFence = false;
}

if (!run_) {
if (!runCompileThread_) {
WARN_LOG(G3D, "BeginFrame while !run_!");
}

Expand Down
2 changes: 1 addition & 1 deletion Common/GPU/OpenGL/GLRenderManager.h
Expand Up @@ -874,7 +874,7 @@ class GLRenderManager {
FastVec<GLRInitStep> initSteps_;

// Execution time state
bool run_ = true;
bool runCompileThread_ = true;

// Thread is managed elsewhere, and should call ThreadFrame.
GLQueueRunner queueRunner_;
Expand Down
13 changes: 0 additions & 13 deletions Common/GPU/Vulkan/VulkanQueueRunner.h
Expand Up @@ -266,15 +266,6 @@ class VulkanQueueRunner {
hacksEnabled_ = hacks;
}

void NotifyCompileDone() {
compileDone_.notify_all();
}

void WaitForCompileNotification() {
std::unique_lock<std::mutex> lock(compileDoneMutex_);
compileDone_.wait(lock);
}

private:
bool InitBackbufferFramebuffers(int width, int height);
bool InitDepthStencilBuffer(VkCommandBuffer cmd, VulkanBarrierBatch *barriers); // Used for non-buffered rendering.
Expand Down Expand Up @@ -321,10 +312,6 @@ class VulkanQueueRunner {
// TODO: Enable based on compat.ini.
uint32_t hacksEnabled_ = 0;

// Compile done notifications.
std::mutex compileDoneMutex_;
std::condition_variable compileDone_;

// Image barrier helper used during command buffer record (PerformRenderPass etc).
// Stored here to help reuse the allocation.

Expand Down

0 comments on commit 6b20fdf

Please sign in to comment.