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)
|
||||
static int toWindowsPriority(Thread::Priority priority) {
|
||||
switch (priority) {
|
||||
case Thread::Priority::Idle:
|
||||
return THREAD_PRIORITY_IDLE;
|
||||
case Thread::Priority::Lowest:
|
||||
return THREAD_PRIORITY_LOWEST;
|
||||
case Thread::Priority::Low:
|
||||
|
@ -10,6 +10,7 @@
|
||||
namespace RT64 {
|
||||
struct Thread {
|
||||
enum class Priority {
|
||||
Idle,
|
||||
Lowest,
|
||||
Low,
|
||||
Normal,
|
||||
|
@ -141,8 +141,8 @@ namespace RT64 {
|
||||
void RasterShaderCache::CompilationThread::loop() {
|
||||
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.
|
||||
Thread::setCurrentThreadPriority(Thread::Priority::Lowest);
|
||||
// The shader compilation thread should have idle priority by default as the application can use the ubershader in the meantime.
|
||||
Thread::setCurrentThreadPriority(Thread::Priority::Idle);
|
||||
|
||||
threadRunning = true;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user