OSDN Git Service

Enumerate RGB config formats.
authorNicolas Capens <capn@google.com>
Fri, 30 Oct 2015 17:54:24 +0000 (13:54 -0400)
committerNicolas Capens <capn@google.com>
Fri, 30 Oct 2015 19:11:08 +0000 (19:11 +0000)
Bug 25390254

Change-Id: Ibd8fc3a957f9ecf5480490e9504fa7041c7c9fa2
Reviewed-on: https://swiftshader-review.googlesource.com/4186
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/OpenGL/libEGL/Config.cpp
src/OpenGL/libEGL/Display.cpp

index 060c70a..3f290b5 100644 (file)
@@ -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;
index ce452fc..231d22c 100644 (file)
@@ -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[] =