From 5716cf0328806cc6617727643881f1a3ae14ac26 Mon Sep 17 00:00:00 2001 From: Nicolas Capens Date: Fri, 30 Oct 2015 13:54:24 -0400 Subject: [PATCH] Enumerate RGB config formats. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bug 25390254 Change-Id: Ibd8fc3a957f9ecf5480490e9504fa7041c7c9fa2 Reviewed-on: https://swiftshader-review.googlesource.com/4186 Reviewed-by: Alexis Hétu Tested-by: Nicolas Capens Reviewed-by: Nicolas Capens --- src/OpenGL/libEGL/Config.cpp | 18 ++++++++++++++++-- src/OpenGL/libEGL/Display.cpp | 4 +++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/OpenGL/libEGL/Config.cpp b/src/OpenGL/libEGL/Config.cpp index 060c70a30..3f290b55c 100644 --- a/src/OpenGL/libEGL/Config.cpp +++ b/src/OpenGL/libEGL/Config.cpp @@ -33,7 +33,7 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, mBindToTextureRGB = EGL_FALSE; mBindToTextureRGBA = EGL_FALSE; - switch (renderTargetFormat) + switch(renderTargetFormat) { case sw::FORMAT_A1R5G5B5: mRedSize = 5; @@ -54,6 +54,13 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, mAlphaSize = 8; mBindToTextureRGBA = EGL_TRUE; break; + case sw::FORMAT_A8B8G8R8: + mRedSize = 8; + mGreenSize = 8; + mBlueSize = 8; + mAlphaSize = 8; + mBindToTextureRGBA = EGL_TRUE; + break; case sw::FORMAT_R5G6B5: mRedSize = 5; mGreenSize = 6; @@ -67,6 +74,13 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, mAlphaSize = 0; mBindToTextureRGB = EGL_TRUE; break; + case sw::FORMAT_X8B8G8R8: + mRedSize = 8; + mGreenSize = 8; + mBlueSize = 8; + mAlphaSize = 0; + mBindToTextureRGBA = EGL_TRUE; + break; default: UNREACHABLE(renderTargetFormat); // Other formats should not be valid } @@ -83,7 +97,7 @@ Config::Config(sw::Format displayFormat, EGLint minInterval, EGLint maxInterval, #endif ; - switch (depthStencilFormat) + switch(depthStencilFormat) { case sw::FORMAT_NULL: mDepthSize = 0; diff --git a/src/OpenGL/libEGL/Display.cpp b/src/OpenGL/libEGL/Display.cpp index ce452fc97..231d22c9a 100644 --- a/src/OpenGL/libEGL/Display.cpp +++ b/src/OpenGL/libEGL/Display.cpp @@ -148,9 +148,11 @@ bool Display::initialize() sw::FORMAT_A1R5G5B5, // sw::FORMAT_A2R10G10B10, // The color_ramp conformance test uses ReadPixels with UNSIGNED_BYTE causing it to think that rendering skipped a colour value. sw::FORMAT_A8R8G8B8, + sw::FORMAT_A8B8G8R8, sw::FORMAT_R5G6B5, // sw::FORMAT_X1R5G5B5, // Has no compatible OpenGL ES renderbuffer format - sw::FORMAT_X8R8G8B8 + sw::FORMAT_X8R8G8B8, + sw::FORMAT_X8B8G8R8 }; const sw::Format depthStencilFormats[] = -- 2.11.0