Switch back to std:: muteces. mutices. mutexen.
This commit is contained in:
@@ -587,7 +587,7 @@ void CommandProcessor::IssueSwap(uint32_t frontbuffer_ptr,
|
||||
// If we skip a lot then we may need to buffer more, but as the display
|
||||
// thread should be fairly idle that shouldn't happen.
|
||||
if (!FLAGS_vsync) {
|
||||
std::lock_guard<xe::mutex> lock(swap_state_.mutex);
|
||||
std::lock_guard<std::mutex> lock(swap_state_.mutex);
|
||||
if (swap_state_.pending) {
|
||||
swap_state_.pending = false;
|
||||
// TODO(benvanik): frame skip counter.
|
||||
@@ -597,7 +597,7 @@ void CommandProcessor::IssueSwap(uint32_t frontbuffer_ptr,
|
||||
// Spin until no more pending swap.
|
||||
while (true) {
|
||||
{
|
||||
std::lock_guard<xe::mutex> lock(swap_state_.mutex);
|
||||
std::lock_guard<std::mutex> lock(swap_state_.mutex);
|
||||
if (!swap_state_.pending) {
|
||||
break;
|
||||
}
|
||||
@@ -609,7 +609,7 @@ void CommandProcessor::IssueSwap(uint32_t frontbuffer_ptr,
|
||||
// One-time initialization.
|
||||
// TODO(benvanik): move someplace more sane?
|
||||
if (!swap_state_.front_buffer_texture) {
|
||||
std::lock_guard<xe::mutex> lock(swap_state_.mutex);
|
||||
std::lock_guard<std::mutex> lock(swap_state_.mutex);
|
||||
swap_state_.width = frontbuffer_width;
|
||||
swap_state_.height = frontbuffer_height;
|
||||
glCreateTextures(GL_TEXTURE_2D, 1, &swap_state_.front_buffer_texture);
|
||||
@@ -647,7 +647,7 @@ void CommandProcessor::IssueSwap(uint32_t frontbuffer_ptr,
|
||||
|
||||
{
|
||||
// Set pending so that the display will swap the next time it can.
|
||||
std::lock_guard<xe::mutex> lock(swap_state_.mutex);
|
||||
std::lock_guard<std::mutex> lock(swap_state_.mutex);
|
||||
swap_state_.pending = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <cstring>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
@@ -46,7 +47,7 @@ class GL4GraphicsSystem;
|
||||
|
||||
struct SwapState {
|
||||
// Lock must be held when changing data in this structure.
|
||||
xe::mutex mutex;
|
||||
std::mutex mutex;
|
||||
// Dimensions of the framebuffer textures. Should match window size.
|
||||
uint32_t width = 0;
|
||||
uint32_t height = 0;
|
||||
|
||||
@@ -295,7 +295,7 @@ void GL4GraphicsSystem::Swap(xe::ui::UIEvent* e) {
|
||||
// Check for pending swap.
|
||||
auto& swap_state = command_processor_->swap_state();
|
||||
{
|
||||
std::lock_guard<xe::mutex> lock(swap_state.mutex);
|
||||
std::lock_guard<std::mutex> lock(swap_state.mutex);
|
||||
if (swap_state.pending) {
|
||||
swap_state.pending = false;
|
||||
std::swap(swap_state.front_buffer_texture,
|
||||
|
||||
@@ -196,7 +196,7 @@ void TextureCache::EvictAllTextures() {
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<xe::mutex> lock(invalidated_textures_mutex_);
|
||||
std::lock_guard<std::mutex> lock(invalidated_textures_mutex_);
|
||||
invalidated_textures_sets_[0].clear();
|
||||
invalidated_textures_sets_[1].clear();
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
#ifndef XENIA_GPU_GL4_TEXTURE_CACHE_H_
|
||||
#define XENIA_GPU_GL4_TEXTURE_CACHE_H_
|
||||
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "xenia/base/mutex.h"
|
||||
#include "xenia/gpu/sampler_info.h"
|
||||
#include "xenia/gpu/texture_info.h"
|
||||
#include "xenia/memory.h"
|
||||
@@ -104,7 +104,7 @@ class TextureCache {
|
||||
|
||||
std::vector<ReadBufferTexture*> read_buffer_textures_;
|
||||
|
||||
xe::mutex invalidated_textures_mutex_;
|
||||
std::mutex invalidated_textures_mutex_;
|
||||
std::vector<TextureEntry*>* invalidated_textures_;
|
||||
std::vector<TextureEntry*> invalidated_textures_sets_[2];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user