From 355a5dc1b228bc57a5ffe932b0b9b69d8726b63a Mon Sep 17 00:00:00 2001 From: Alexis Hetu Date: Mon, 2 Oct 2017 15:27:03 -0400 Subject: [PATCH] Adding support for more format/internalformat combinations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit OpenGLES 3.0 allows for more combinations of format/internalformat for floating point types. These types were already supported, just not using the combinations added here. Bug chromium:763384 Change-Id: I146548c2920799c7ea0d5d537d556ba562708147 Reviewed-on: https://swiftshader-review.googlesource.com/12928 Tested-by: Alexis Hétu Reviewed-by: Nicolas Capens --- src/OpenGL/common/Image.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/OpenGL/common/Image.cpp b/src/OpenGL/common/Image.cpp index f75f92f3c..79b186efd 100644 --- a/src/OpenGL/common/Image.cpp +++ b/src/OpenGL/common/Image.cpp @@ -663,10 +663,19 @@ namespace egl return sw::FORMAT_G32R32F; case GL_RGB: case GL_RGB32F: + case GL_R11F_G11F_B10F: + case GL_RGB9_E5: return sw::FORMAT_X32B32G32R32F; case GL_RGBA: case GL_RGBA32F: return sw::FORMAT_A32B32G32R32F; + case GL_R16F: + return sw::FORMAT_R16F; + case GL_RG16F: + return sw::FORMAT_G16R16F; + case GL_RGB16F: + case GL_RGBA16F: + return sw::FORMAT_A16B16G16R16F; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT32F: return sw::FORMAT_D32F; @@ -697,6 +706,9 @@ namespace egl case GL_RGBA: case GL_RGBA16F: return sw::FORMAT_A16B16G16R16F; + case GL_R11F_G11F_B10F: + case GL_RGB9_E5: + return sw::FORMAT_X32B32G32R32F; default: UNREACHABLE(format); } @@ -1062,6 +1074,8 @@ namespace egl case GL_RGB32F: return sizeof(float) * 3; case GL_RGBA: return sizeof(float) * 4; case GL_RGBA32F: return sizeof(float) * 4; + case GL_R11F_G11F_B10F: return sizeof(int); + case GL_RGB9_E5: return sizeof(int); default: UNREACHABLE(format); } break; @@ -1083,6 +1097,8 @@ namespace egl case GL_RGB16F: return sizeof(unsigned short) * 3; case GL_RGBA: return sizeof(unsigned short) * 4; case GL_RGBA16F: return sizeof(unsigned short) * 4; + case GL_R11F_G11F_B10F: return sizeof(int); + case GL_RGB9_E5: return sizeof(int); default: UNREACHABLE(format); } break; @@ -1494,6 +1510,12 @@ namespace egl case GL_RGBA32F: LoadImageData(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer); break; + case GL_R11F_G11F_B10F: + LoadImageData(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer); + break; + case GL_RGB9_E5: + LoadImageData(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer); + break; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT32F: LoadImageData(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer); @@ -1533,6 +1555,12 @@ namespace egl case GL_RGBA16F: LoadImageData(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer); break; + case GL_R11F_G11F_B10F: + LoadImageData(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer); + break; + case GL_RGB9_E5: + LoadImageData(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer); + break; default: UNREACHABLE(format); } break; -- 2.11.0