mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-06 02:09:55 +03:00
PerfTests: Replay EGL color spaces.
Add EGL_GL_COLORSPACE_KHR to the EGLWindow's surface attributes if EGL_KHR_gl_colorspace is available. Require the extension to be available if the color space differs from the default EGL_COLORSPACE_LINEAR value. Bug: angleproject:5857 Change-Id: Ib33cbed7d4b115979bd847418cb5cd2b96f4f173 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3056374 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
This commit is contained in:
committed by
Angle LUCI CQ
parent
89dbbb2ac6
commit
4a841e6aff
@@ -32,7 +32,8 @@ ConfigParameters::ConfigParameters()
|
||||
clientArraysEnabled(true),
|
||||
robustAccess(false),
|
||||
samples(-1),
|
||||
resetStrategy(EGL_NO_RESET_NOTIFICATION_EXT)
|
||||
resetStrategy(EGL_NO_RESET_NOTIFICATION_EXT),
|
||||
colorSpace(EGL_COLORSPACE_LINEAR)
|
||||
{}
|
||||
|
||||
ConfigParameters::~ConfigParameters() = default;
|
||||
@@ -418,6 +419,19 @@ bool EGLWindow::initializeSurface(OSWindow *osWindow,
|
||||
: EGL_FALSE);
|
||||
}
|
||||
|
||||
bool hasGLColorSpace = strstr(displayExtensions, "EGL_KHR_gl_colorspace") != nullptr;
|
||||
if (!hasGLColorSpace && mConfigParams.colorSpace != EGL_COLORSPACE_LINEAR)
|
||||
{
|
||||
fprintf(stderr, "Mising EGL_KHR_gl_colorspace.\n");
|
||||
destroyGL();
|
||||
return false;
|
||||
}
|
||||
if (hasGLColorSpace)
|
||||
{
|
||||
surfaceAttributes.push_back(EGL_GL_COLORSPACE_KHR);
|
||||
surfaceAttributes.push_back(mConfigParams.colorSpace);
|
||||
}
|
||||
|
||||
surfaceAttributes.push_back(EGL_NONE);
|
||||
|
||||
osWindow->resetNativeWindow();
|
||||
|
||||
Reference in New Issue
Block a user