mirror of
https://github.com/rt64/rt64.git
synced 2025-02-06 09:40:07 +00:00
Add idle thread priority option, use it in shader compilation threads.
This commit is contained in:
parent
66057e8d51
commit
95fa9cbbd8
@ -18,6 +18,8 @@ namespace RT64 {
|
|||||||
# if defined(_WIN32)
|
# if defined(_WIN32)
|
||||||
static int toWindowsPriority(Thread::Priority priority) {
|
static int toWindowsPriority(Thread::Priority priority) {
|
||||||
switch (priority) {
|
switch (priority) {
|
||||||
|
case Thread::Priority::Idle:
|
||||||
|
return THREAD_PRIORITY_IDLE;
|
||||||
case Thread::Priority::Lowest:
|
case Thread::Priority::Lowest:
|
||||||
return THREAD_PRIORITY_LOWEST;
|
return THREAD_PRIORITY_LOWEST;
|
||||||
case Thread::Priority::Low:
|
case Thread::Priority::Low:
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
namespace RT64 {
|
namespace RT64 {
|
||||||
struct Thread {
|
struct Thread {
|
||||||
enum class Priority {
|
enum class Priority {
|
||||||
|
Idle,
|
||||||
Lowest,
|
Lowest,
|
||||||
Low,
|
Low,
|
||||||
Normal,
|
Normal,
|
||||||
|
@ -141,8 +141,8 @@ namespace RT64 {
|
|||||||
void RasterShaderCache::CompilationThread::loop() {
|
void RasterShaderCache::CompilationThread::loop() {
|
||||||
Thread::setCurrentThreadName("RT64 Shader");
|
Thread::setCurrentThreadName("RT64 Shader");
|
||||||
|
|
||||||
// The shader compilation thread should have the lowest priority by default as the application can use the ubershader in the meantime.
|
// The shader compilation thread should have idle priority by default as the application can use the ubershader in the meantime.
|
||||||
Thread::setCurrentThreadPriority(Thread::Priority::Lowest);
|
Thread::setCurrentThreadPriority(Thread::Priority::Idle);
|
||||||
|
|
||||||
threadRunning = true;
|
threadRunning = true;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user