mirror of
https://github.com/RPCS3/rpcs3
synced 2024-07-05 17:18:51 +00:00
Compare commits
3 Commits
e8c2b95342
...
292a83f842
Author | SHA1 | Date | |
---|---|---|---|
|
292a83f842 | ||
|
71524271e9 | ||
|
0ca8649b50 |
|
@ -557,29 +557,6 @@ void cpu_thread::operator()()
|
||||||
// Register thread in g_cpu_array
|
// Register thread in g_cpu_array
|
||||||
s_cpu_counter++;
|
s_cpu_counter++;
|
||||||
|
|
||||||
atomic_wait_engine::set_notify_callback(g_use_rtm || get_class() != thread_class::ppu ? nullptr : +[](const void*, u64 progress)
|
|
||||||
{
|
|
||||||
static thread_local bool wait_set = false;
|
|
||||||
|
|
||||||
cpu_thread* _cpu = get_current_cpu_thread();
|
|
||||||
|
|
||||||
// Wait flag isn't set asynchronously so this should be thread-safe
|
|
||||||
if (progress == 0 && _cpu->state.none_of(cpu_flag::wait + cpu_flag::temp))
|
|
||||||
{
|
|
||||||
// Operation just started and syscall is imminent
|
|
||||||
_cpu->state += cpu_flag::wait + cpu_flag::temp;
|
|
||||||
wait_set = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (progress == umax && std::exchange(wait_set, false))
|
|
||||||
{
|
|
||||||
// Operation finished: need to clean wait flag
|
|
||||||
ensure(!_cpu->check_state());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
static thread_local struct thread_cleanup_t
|
static thread_local struct thread_cleanup_t
|
||||||
{
|
{
|
||||||
cpu_thread* _this = nullptr;
|
cpu_thread* _this = nullptr;
|
||||||
|
@ -598,8 +575,6 @@ void cpu_thread::operator()()
|
||||||
ptr->compare_and_swap(_this, nullptr);
|
ptr->compare_and_swap(_this, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
atomic_wait_engine::set_notify_callback(nullptr);
|
|
||||||
|
|
||||||
g_tls_log_control = [](const char*, u64){};
|
g_tls_log_control = [](const char*, u64){};
|
||||||
|
|
||||||
if (s_tls_thread_slot != umax)
|
if (s_tls_thread_slot != umax)
|
||||||
|
|
|
@ -27,4 +27,16 @@ vec3 compute2x2DownsampleWeights(const in float coord, const in float uv_step, c
|
||||||
return vec3(1.0 - (computed_weights.x + computed_weights.y), computed_weights.xy);
|
return vec3(1.0 - (computed_weights.x + computed_weights.y), computed_weights.xy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vec2 texture2DMSCoord(const in vec2 coords, const in uint flags)
|
||||||
|
{
|
||||||
|
if (0u == (flags & (WRAP_S_MASK | WRAP_T_MASK)))
|
||||||
|
{
|
||||||
|
return coords;
|
||||||
|
}
|
||||||
|
|
||||||
|
const vec2 wrapped_coords = mod(coords, vec2(1.0));
|
||||||
|
const bvec2 wrap_control_mask = bvec2(uvec2(flags) & uvec2(WRAP_S_MASK, WRAP_T_MASK));
|
||||||
|
return _select(coords, wrapped_coords, wrap_control_mask);
|
||||||
|
}
|
||||||
|
|
||||||
)"
|
)"
|
||||||
|
|
|
@ -1,16 +1,4 @@
|
||||||
R"(
|
R"(
|
||||||
vec2 texture2DMSCoord(const in vec2 coords, const in uint flags)
|
|
||||||
{
|
|
||||||
if (0u == (flags & (WRAP_S_MASK | WRAP_T_MASK)))
|
|
||||||
{
|
|
||||||
return coords;
|
|
||||||
}
|
|
||||||
|
|
||||||
const vec2 wrapped_coords = mod(coords, vec2(1.0));
|
|
||||||
const bvec2 wrap_control_mask = bvec2(uvec2(flags) & uvec2(WRAP_S_MASK, WRAP_T_MASK));
|
|
||||||
return _select(coords, wrapped_coords, wrap_control_mask);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec4 texelFetch2DMS(in _MSAA_SAMPLER_TYPE_ tex, const in vec2 sample_count, const in ivec2 icoords, const in int index, const in ivec2 offset)
|
vec4 texelFetch2DMS(in _MSAA_SAMPLER_TYPE_ tex, const in vec2 sample_count, const in ivec2 icoords, const in int index, const in ivec2 offset)
|
||||||
{
|
{
|
||||||
const vec2 resolve_coords = vec2(icoords + offset);
|
const vec2 resolve_coords = vec2(icoords + offset);
|
||||||
|
|
|
@ -81,7 +81,7 @@ struct gui_listener : logs::listener
|
||||||
|
|
||||||
_new->msg += text;
|
_new->msg += text;
|
||||||
|
|
||||||
queue.push(std::move(p));
|
queue.push<false>(std::move(p));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,9 +67,6 @@ static thread_local bool(*s_tls_wait_cb)(const void* data, u64 attempts, u64 sta
|
||||||
// Callback for wait() function for a second custon condition, commonly passed with timeout
|
// Callback for wait() function for a second custon condition, commonly passed with timeout
|
||||||
static thread_local bool(*s_tls_one_time_wait_cb)(u64 attempts) = nullptr;
|
static thread_local bool(*s_tls_one_time_wait_cb)(u64 attempts) = nullptr;
|
||||||
|
|
||||||
// Callback for notification functions for optimizations
|
|
||||||
static thread_local void(*s_tls_notify_cb)(const void* data, u64 progress) = nullptr;
|
|
||||||
|
|
||||||
// Compare data in memory with old value, and return true if they are equal
|
// Compare data in memory with old value, and return true if they are equal
|
||||||
static NEVER_INLINE bool ptr_cmp(const void* data, u32 old, atomic_wait::info* ext = nullptr)
|
static NEVER_INLINE bool ptr_cmp(const void* data, u32 old, atomic_wait::info* ext = nullptr)
|
||||||
{
|
{
|
||||||
|
@ -1247,22 +1244,12 @@ void atomic_wait_engine::set_one_time_use_wait_callback(bool(*cb)(u64 progress))
|
||||||
s_tls_one_time_wait_cb = cb;
|
s_tls_one_time_wait_cb = cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
void atomic_wait_engine::set_notify_callback(void(*cb)(const void*, u64))
|
|
||||||
{
|
|
||||||
s_tls_notify_cb = cb;
|
|
||||||
}
|
|
||||||
|
|
||||||
void atomic_wait_engine::notify_one(const void* data)
|
void atomic_wait_engine::notify_one(const void* data)
|
||||||
{
|
{
|
||||||
if (s_tls_notify_cb)
|
|
||||||
s_tls_notify_cb(data, 0);
|
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
if (has_waitv())
|
if (has_waitv())
|
||||||
{
|
{
|
||||||
futex(const_cast<void*>(data), FUTEX_WAKE_PRIVATE, 1);
|
futex(const_cast<void*>(data), FUTEX_WAKE_PRIVATE, 1);
|
||||||
if (s_tls_notify_cb)
|
|
||||||
s_tls_notify_cb(data, -1);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1277,23 +1264,15 @@ void atomic_wait_engine::notify_one(const void* data)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (s_tls_notify_cb)
|
|
||||||
s_tls_notify_cb(data, -1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SAFE_BUFFERS(void)
|
SAFE_BUFFERS(void)
|
||||||
atomic_wait_engine::notify_all(const void* data)
|
atomic_wait_engine::notify_all(const void* data)
|
||||||
{
|
{
|
||||||
if (s_tls_notify_cb)
|
|
||||||
s_tls_notify_cb(data, 0);
|
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
if (has_waitv())
|
if (has_waitv())
|
||||||
{
|
{
|
||||||
futex(const_cast<void*>(data), FUTEX_WAKE_PRIVATE, INT_MAX);
|
futex(const_cast<void*>(data), FUTEX_WAKE_PRIVATE, INT_MAX);
|
||||||
if (s_tls_notify_cb)
|
|
||||||
s_tls_notify_cb(data, -1);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1369,9 +1348,6 @@ atomic_wait_engine::notify_all(const void* data)
|
||||||
{
|
{
|
||||||
cond_free(~*(std::end(cond_ids) - i - 1));
|
cond_free(~*(std::end(cond_ids) - i - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s_tls_notify_cb)
|
|
||||||
s_tls_notify_cb(data, -1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace atomic_wait
|
namespace atomic_wait
|
||||||
|
|
|
@ -257,7 +257,6 @@ public:
|
||||||
static void notify_all(const void* data);
|
static void notify_all(const void* data);
|
||||||
|
|
||||||
static void set_wait_callback(bool(*cb)(const void* data, u64 attempts, u64 stamp0));
|
static void set_wait_callback(bool(*cb)(const void* data, u64 attempts, u64 stamp0));
|
||||||
static void set_notify_callback(void(*cb)(const void* data, u64 progress));
|
|
||||||
static void set_one_time_use_wait_callback(bool (*cb)(u64 progress));
|
static void set_one_time_use_wait_callback(bool (*cb)(u64 progress));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user