Commit f59ad06e by Nicolas Capens

Fix strict ordering of EGL configs.

Change-Id: I51c1774a35706639481c030b4365ee2e5d7ccd4d Reviewed-on: https://swiftshader-review.googlesource.com/4255Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 6efe2d09
...@@ -36,7 +36,8 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, ...@@ -36,7 +36,8 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval,
mBindToTextureRGB = EGL_FALSE; mBindToTextureRGB = EGL_FALSE;
mBindToTextureRGBA = EGL_FALSE; mBindToTextureRGBA = EGL_FALSE;
mNativeVisualID = 0; // Initialize to a high value to lower the preference of formats for which there's no native support
mNativeVisualID = 0x7FFFFFFF;
switch(renderTargetFormat) switch(renderTargetFormat)
{ {
...@@ -60,6 +61,8 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, ...@@ -60,6 +61,8 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval,
mBindToTextureRGBA = EGL_TRUE; mBindToTextureRGBA = EGL_TRUE;
#ifdef __ANDROID__ #ifdef __ANDROID__
mNativeVisualID = HAL_PIXEL_FORMAT_BGRA_8888; mNativeVisualID = HAL_PIXEL_FORMAT_BGRA_8888;
#else
mNativeVisualID = 2; // Arbitrary; prefer over ABGR
#endif #endif
break; break;
case sw::FORMAT_A8B8G8R8: case sw::FORMAT_A8B8G8R8:
...@@ -88,7 +91,9 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, ...@@ -88,7 +91,9 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval,
mAlphaSize = 0; mAlphaSize = 0;
mBindToTextureRGB = EGL_TRUE; mBindToTextureRGB = EGL_TRUE;
#ifdef __ANDROID__ #ifdef __ANDROID__
mNativeVisualID = HAL_PIXEL_FORMAT_BGRA_8888; mNativeVisualID = 0x1FF; // HAL_PIXEL_FORMAT_BGRX_8888
#else
mNativeVisualID = 1; // Arbitrary; prefer over XBGR
#endif #endif
break; break;
case sw::FORMAT_X8B8G8R8: case sw::FORMAT_X8B8G8R8:
...@@ -102,7 +107,7 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, ...@@ -102,7 +107,7 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval,
#endif #endif
break; break;
default: default:
UNREACHABLE(renderTargetFormat); // Other formats should not be valid UNREACHABLE(renderTargetFormat);
} }
mLuminanceSize = 0; mLuminanceSize = 0;
...@@ -221,6 +226,7 @@ bool CompareConfig::operator()(const Config &x, const Config &y) const ...@@ -221,6 +226,7 @@ bool CompareConfig::operator()(const Config &x, const Config &y) const
SORT_SMALLER(mStencilSize); SORT_SMALLER(mStencilSize);
SORT_SMALLER(mAlphaMaskSize); SORT_SMALLER(mAlphaMaskSize);
SORT_SMALLER(mNativeVisualType); SORT_SMALLER(mNativeVisualType);
SORT_SMALLER(mNativeVisualID);
#undef SORT_SMALLER #undef SORT_SMALLER
......
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