mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-06 02:09:55 +03:00
Add SetLowPriorityProcess to utils and use it in dEQP support
This provides a cross-platform way to make sure dEQP runs in a low priority process. BUG=angleproject:892 Change-Id: I0d12f1eacb78be43edcdb6622f945734c0b377ff Reviewed-on: https://chromium-review.googlesource.com/273595 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
@@ -1056,6 +1056,7 @@
|
||||
'dependencies':
|
||||
[
|
||||
'angle_deqp_libtester',
|
||||
'<(angle_path)/util/util.gyp:angle_util',
|
||||
],
|
||||
'defines':
|
||||
[
|
||||
@@ -1075,6 +1076,7 @@
|
||||
'dependencies':
|
||||
[
|
||||
'angle_deqp_libtester',
|
||||
'<(angle_path)/util/util.gyp:angle_util',
|
||||
],
|
||||
'defines':
|
||||
[
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <EGL/eglext.h>
|
||||
|
||||
#include "egluGLContextFactory.hpp"
|
||||
#include "system_utils.h"
|
||||
#include "tcuANGLEWin32NativeDisplayFactory.h"
|
||||
#include "tcuNullContextFactory.hpp"
|
||||
|
||||
@@ -32,9 +33,7 @@ namespace tcu
|
||||
|
||||
ANGLEWin32Platform::ANGLEWin32Platform()
|
||||
{
|
||||
// Set process priority to lower.
|
||||
// TODO(cwallez): add this to utils
|
||||
SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS);
|
||||
angle::SetLowPriorityProcess();
|
||||
|
||||
#if defined(ANGLE_DEQP_GLES2_TESTS) || defined(ANGLE_DEQP_GLES3_TESTS)
|
||||
std::vector<eglw::EGLAttrib> d3d11Attribs;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "tcuDefs.hpp"
|
||||
#include "tcuPlatform.hpp"
|
||||
#include "gluPlatform.hpp"
|
||||
#include "tcuWin32API.h"
|
||||
|
||||
#ifndef _EGLUPLATFORM_HPP
|
||||
# include "egluPlatform.hpp"
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
|
||||
#include "system_utils.h"
|
||||
|
||||
#include <sys/resource.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <array>
|
||||
|
||||
@@ -38,4 +41,9 @@ std::string GetExecutableDirectory()
|
||||
return (lastPathSepLoc != std::string::npos) ? executablePath.substr(0, lastPathSepLoc) : "";
|
||||
}
|
||||
|
||||
void SetLowPriorityProcess()
|
||||
{
|
||||
setpriority(PRIO_PROCESS, getpid(), 10);
|
||||
}
|
||||
|
||||
} // namespace angle
|
||||
|
||||
@@ -20,6 +20,8 @@ std::string GetExecutableDirectory();
|
||||
// Cross platform equivalent of the Windows Sleep function
|
||||
void Sleep(unsigned int milliseconds);
|
||||
|
||||
void SetLowPriorityProcess();
|
||||
|
||||
} // namespace angle
|
||||
|
||||
#endif // SAMPLE_UTIL_PATH_UTILS_H
|
||||
|
||||
@@ -33,4 +33,9 @@ void Sleep(unsigned int milliseconds)
|
||||
::Sleep(static_cast<DWORD>(milliseconds));
|
||||
}
|
||||
|
||||
void SetLowPriorityProcess()
|
||||
{
|
||||
SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS);
|
||||
}
|
||||
|
||||
} // namespace angle
|
||||
|
||||
Reference in New Issue
Block a user