Commit 0808b4f0 by Nicolas Capens

Only support main thread rendering in debug builds.

Rendering on the main thread can cause segmentation faults on Windows due to uncommitted stack memory, since Subzero does not currently call __chkstk. In practice this would have mainly been an issue on VMs with a single virtual CPU. Bug swiftshader:25 Change-Id: Ic3be7e5a41ef09b7e056d3c3df2983c225101fe4 Reviewed-on: https://swiftshader-review.googlesource.com/8934Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent ebf1e015
...@@ -657,7 +657,16 @@ namespace sw ...@@ -657,7 +657,16 @@ namespace sw
nextDraw++; nextDraw++;
schedulerMutex.unlock(); schedulerMutex.unlock();
if(threadCount > 1) #ifndef NDEBUG
if(threadCount == 1) // Use main thread for draw execution
{
threadsAwake = 1;
task[0].type = Task::RESUME;
taskLoop(0);
}
else
#endif
{ {
if(!threadsAwake) if(!threadsAwake)
{ {
...@@ -669,13 +678,6 @@ namespace sw ...@@ -669,13 +678,6 @@ namespace sw
resume[0]->signal(); resume[0]->signal();
} }
} }
else // Use main thread for draw execution
{
threadsAwake = 1;
task[0].type = Task::RESUME;
taskLoop(0);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment