Remove the Radiance compiler copy and use OpenGL's instead. Bug 18591036 Change-Id: I17158acfa126490e28076052e5937d1deafd96c1 Reviewed-on: https://swiftshader-review.googlesource.com/1691 Reviewed-by: Nicolas Capens <capn@google.com> Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/compiler/AnalyzeCallDepth.cpp b/src/OpenGL/compiler/AnalyzeCallDepth.cpp index 9039916..fedd552 100644 --- a/src/OpenGL/compiler/AnalyzeCallDepth.cpp +++ b/src/OpenGL/compiler/AnalyzeCallDepth.cpp
@@ -4,7 +4,7 @@ // found in the LICENSE file. // -#include "compiler/AnalyzeCallDepth.h" +#include "AnalyzeCallDepth.h" AnalyzeCallDepth::FunctionNode::FunctionNode(TIntermAggregate *node) : node(node) {
diff --git a/src/OpenGL/compiler/AnalyzeCallDepth.h b/src/OpenGL/compiler/AnalyzeCallDepth.h index a754bff..f0621e9 100644 --- a/src/OpenGL/compiler/AnalyzeCallDepth.h +++ b/src/OpenGL/compiler/AnalyzeCallDepth.h
@@ -7,7 +7,7 @@ #ifndef COMPILER_ANALYZE_CALL_DEPTH_H_ #define COMPILER_ANALYZE_CALL_DEPTH_H_ -#include "compiler/intermediate.h" +#include "intermediate.h" #include <set> #include <limits.h>
diff --git a/src/OpenGL/compiler/Common.h b/src/OpenGL/compiler/Common.h index 1dc5eeb..af29b2f 100644 --- a/src/OpenGL/compiler/Common.h +++ b/src/OpenGL/compiler/Common.h
@@ -12,7 +12,7 @@ #include <string> #include <vector> -#include "compiler/PoolAlloc.h" +#include "PoolAlloc.h" // We need two pieces of information to report errors/warnings - string and // line number. We encode these into a single int so that it can be easily
diff --git a/src/OpenGL/compiler/Compiler.cpp b/src/OpenGL/compiler/Compiler.cpp index 26e685b..0086577 100644 --- a/src/OpenGL/compiler/Compiler.cpp +++ b/src/OpenGL/compiler/Compiler.cpp
@@ -4,12 +4,12 @@ // found in the LICENSE file. // -#include "compiler/AnalyzeCallDepth.h" -#include "compiler/Initialize.h" -#include "compiler/InitializeParseContext.h" -#include "compiler/ParseHelper.h" -#include "compiler/ShHandle.h" -#include "compiler/ValidateLimitations.h" +#include "AnalyzeCallDepth.h" +#include "Initialize.h" +#include "InitializeParseContext.h" +#include "ParseHelper.h" +#include "ShHandle.h" +#include "ValidateLimitations.h" namespace {
diff --git a/src/OpenGL/compiler/Diagnostics.cpp b/src/OpenGL/compiler/Diagnostics.cpp index 166a4a8..b56016e 100644 --- a/src/OpenGL/compiler/Diagnostics.cpp +++ b/src/OpenGL/compiler/Diagnostics.cpp
@@ -4,11 +4,11 @@ // found in the LICENSE file. // -#include "compiler/Diagnostics.h" +#include "Diagnostics.h" -#include "compiler/debug.h" -#include "compiler/InfoSink.h" -#include "compiler/preprocessor/SourceLocation.h" +#include "debug.h" +#include "InfoSink.h" +#include "preprocessor/SourceLocation.h" TDiagnostics::TDiagnostics(TInfoSink& infoSink) : mInfoSink(infoSink),
diff --git a/src/OpenGL/compiler/Diagnostics.h b/src/OpenGL/compiler/Diagnostics.h index 43dfcb7..44c7186 100644 --- a/src/OpenGL/compiler/Diagnostics.h +++ b/src/OpenGL/compiler/Diagnostics.h
@@ -7,7 +7,7 @@ #ifndef COMPILER_DIAGNOSTICS_H_ #define COMPILER_DIAGNOSTICS_H_ -#include "compiler/preprocessor/Diagnostics.h" +#include "preprocessor/Diagnostics.h" class TInfoSink;
diff --git a/src/OpenGL/compiler/DirectiveHandler.cpp b/src/OpenGL/compiler/DirectiveHandler.cpp index f6a9a93..1c76ced 100644 --- a/src/OpenGL/compiler/DirectiveHandler.cpp +++ b/src/OpenGL/compiler/DirectiveHandler.cpp
@@ -4,12 +4,12 @@ // found in the LICENSE file. // -#include "compiler/DirectiveHandler.h" +#include "DirectiveHandler.h" #include <sstream> -#include "compiler/debug.h" -#include "compiler/Diagnostics.h" +#include "debug.h" +#include "Diagnostics.h" static TBehavior getBehavior(const std::string& str) {
diff --git a/src/OpenGL/compiler/DirectiveHandler.h b/src/OpenGL/compiler/DirectiveHandler.h index a08b7a8..d70ff1c 100644 --- a/src/OpenGL/compiler/DirectiveHandler.h +++ b/src/OpenGL/compiler/DirectiveHandler.h
@@ -7,9 +7,9 @@ #ifndef COMPILER_DIRECTIVE_HANDLER_H_ #define COMPILER_DIRECTIVE_HANDLER_H_ -#include "compiler/ExtensionBehavior.h" -#include "compiler/Pragma.h" -#include "compiler/preprocessor/DirectiveHandler.h" +#include "ExtensionBehavior.h" +#include "Pragma.h" +#include "preprocessor/DirectiveHandler.h" class TDiagnostics;
diff --git a/src/OpenGL/compiler/InfoSink.cpp b/src/OpenGL/compiler/InfoSink.cpp index ba32f78..15c8ac7 100644 --- a/src/OpenGL/compiler/InfoSink.cpp +++ b/src/OpenGL/compiler/InfoSink.cpp
@@ -4,7 +4,7 @@ // found in the LICENSE file. // -#include "compiler/InfoSink.h" +#include "InfoSink.h" void TInfoSinkBase::prefix(TPrefixType message) { switch(message) {
diff --git a/src/OpenGL/compiler/InfoSink.h b/src/OpenGL/compiler/InfoSink.h index e2224e918..d626e3f 100644 --- a/src/OpenGL/compiler/InfoSink.h +++ b/src/OpenGL/compiler/InfoSink.h
@@ -8,7 +8,7 @@ #define _INFOSINK_INCLUDED_ #include <math.h> -#include "compiler/Common.h" +#include "Common.h" // Returns the fractional part of the given floating-point number. inline float fractionalPart(float f) {
diff --git a/src/OpenGL/compiler/Initialize.cpp b/src/OpenGL/compiler/Initialize.cpp index f92ee02..9350fbd 100644 --- a/src/OpenGL/compiler/Initialize.cpp +++ b/src/OpenGL/compiler/Initialize.cpp
@@ -10,9 +10,9 @@ // built-in functions and operators. // -#include "compiler/Initialize.h" +#include "Initialize.h" -#include "compiler/intermediate.h" +#include "intermediate.h" void InsertBuiltInFunctions(ShShaderType type, const ShBuiltInResources &resources, TSymbolTable &symbolTable) {
diff --git a/src/OpenGL/compiler/Initialize.h b/src/OpenGL/compiler/Initialize.h index 7bc007a..fc7cc30 100644 --- a/src/OpenGL/compiler/Initialize.h +++ b/src/OpenGL/compiler/Initialize.h
@@ -7,9 +7,9 @@ #ifndef _INITIALIZE_INCLUDED_ #define _INITIALIZE_INCLUDED_ -#include "compiler/Common.h" -#include "compiler/ShHandle.h" -#include "compiler/SymbolTable.h" +#include "Common.h" +#include "ShHandle.h" +#include "SymbolTable.h" void InsertBuiltInFunctions(ShShaderType type, const ShBuiltInResources &resources, TSymbolTable &table);
diff --git a/src/OpenGL/compiler/InitializeDll.cpp b/src/OpenGL/compiler/InitializeDll.cpp index 6c7f27f..c1db1d4 100644 --- a/src/OpenGL/compiler/InitializeDll.cpp +++ b/src/OpenGL/compiler/InitializeDll.cpp
@@ -4,11 +4,11 @@ // found in the LICENSE file. // -#include "compiler/InitializeDll.h" +#include "InitializeDll.h" -#include "compiler/InitializeGlobals.h" -#include "compiler/InitializeParseContext.h" -#include "compiler/osinclude.h" +#include "InitializeGlobals.h" +#include "InitializeParseContext.h" +#include "osinclude.h" bool InitProcess() {
diff --git a/src/OpenGL/compiler/InitializeParseContext.cpp b/src/OpenGL/compiler/InitializeParseContext.cpp index dfab027..70116bd 100644 --- a/src/OpenGL/compiler/InitializeParseContext.cpp +++ b/src/OpenGL/compiler/InitializeParseContext.cpp
@@ -4,9 +4,9 @@ // found in the LICENSE file. // -#include "compiler/InitializeParseContext.h" +#include "InitializeParseContext.h" -#include "compiler/osinclude.h" +#include "osinclude.h" OS_TLSIndex GlobalParseContextIndex = OS_INVALID_TLS_INDEX;
diff --git a/src/OpenGL/compiler/IntermTraverse.cpp b/src/OpenGL/compiler/IntermTraverse.cpp index a13877f..c79e1fcf 100644 --- a/src/OpenGL/compiler/IntermTraverse.cpp +++ b/src/OpenGL/compiler/IntermTraverse.cpp
@@ -4,7 +4,7 @@ // found in the LICENSE file. // -#include "compiler/intermediate.h" +#include "intermediate.h" // // Traverse the intermediate representation tree, and
diff --git a/src/OpenGL/compiler/Intermediate.cpp b/src/OpenGL/compiler/Intermediate.cpp index 0676e23..a5d9c8d 100644 --- a/src/OpenGL/compiler/Intermediate.cpp +++ b/src/OpenGL/compiler/Intermediate.cpp
@@ -12,8 +12,8 @@ #include <limits.h> #include <algorithm> -#include "compiler/localintermediate.h" -#include "compiler/SymbolTable.h" +#include "localintermediate.h" +#include "SymbolTable.h" bool CompareStructure(const TType& leftNodeType, ConstantUnion* rightUnionArray, ConstantUnion* leftUnionArray);
diff --git a/src/OpenGL/compiler/OutputASM.cpp b/src/OpenGL/compiler/OutputASM.cpp index 6597507..7a8462d 100644 --- a/src/OpenGL/compiler/OutputASM.cpp +++ b/src/OpenGL/compiler/OutputASM.cpp
@@ -9,10 +9,10 @@ // or implied, including but not limited to any patent rights, are granted to you. // -#include "compiler/OutputASM.h" +#include "OutputASM.h" #include "common/debug.h" -#include "compiler/InfoSink.h" +#include "InfoSink.h" #include "libGLESv2/Shader.h"
diff --git a/src/OpenGL/compiler/ParseHelper.cpp b/src/OpenGL/compiler/ParseHelper.cpp index daf0da7..0aaa76d 100644 --- a/src/OpenGL/compiler/ParseHelper.cpp +++ b/src/OpenGL/compiler/ParseHelper.cpp
@@ -4,13 +4,13 @@ // found in the LICENSE file. // -#include "compiler/ParseHelper.h" +#include "ParseHelper.h" #include <stdarg.h> #include <stdio.h> -#include "compiler/glslang.h" -#include "compiler/preprocessor/SourceLocation.h" +#include "glslang.h" +#include "preprocessor/SourceLocation.h" /////////////////////////////////////////////////////////////////////// //
diff --git a/src/OpenGL/compiler/ParseHelper.h b/src/OpenGL/compiler/ParseHelper.h index 86c9aca..12f9dfb 100644 --- a/src/OpenGL/compiler/ParseHelper.h +++ b/src/OpenGL/compiler/ParseHelper.h
@@ -6,12 +6,12 @@ #ifndef _PARSER_HELPER_INCLUDED_ #define _PARSER_HELPER_INCLUDED_ -#include "compiler/Diagnostics.h" -#include "compiler/DirectiveHandler.h" -#include "compiler/localintermediate.h" -#include "compiler/preprocessor/Preprocessor.h" -#include "compiler/ShHandle.h" -#include "compiler/SymbolTable.h" +#include "Diagnostics.h" +#include "DirectiveHandler.h" +#include "localintermediate.h" +#include "preprocessor/Preprocessor.h" +#include "ShHandle.h" +#include "SymbolTable.h" struct TMatrixFields { bool wholeRow;
diff --git a/src/OpenGL/compiler/PoolAlloc.cpp b/src/OpenGL/compiler/PoolAlloc.cpp index 6ec3c40..a8347c2 100644 --- a/src/OpenGL/compiler/PoolAlloc.cpp +++ b/src/OpenGL/compiler/PoolAlloc.cpp
@@ -4,15 +4,15 @@ // found in the LICENSE file. // -#include "compiler/PoolAlloc.h" +#include "PoolAlloc.h" #ifndef _MSC_VER #include <stdint.h> #endif #include <stdio.h> -#include "compiler/InitializeGlobals.h" -#include "compiler/osinclude.h" +#include "InitializeGlobals.h" +#include "osinclude.h" OS_TLSIndex PoolIndex = OS_INVALID_TLS_INDEX;
diff --git a/src/OpenGL/compiler/ShHandle.h b/src/OpenGL/compiler/ShHandle.h index 6859706..d37a2e9 100644 --- a/src/OpenGL/compiler/ShHandle.h +++ b/src/OpenGL/compiler/ShHandle.h
@@ -16,9 +16,9 @@ #include "GLSLANG/ShaderLang.h" -#include "compiler/ExtensionBehavior.h" -#include "compiler/InfoSink.h" -#include "compiler/SymbolTable.h" +#include "ExtensionBehavior.h" +#include "InfoSink.h" +#include "SymbolTable.h" class TCompiler;
diff --git a/src/OpenGL/compiler/ShaderLang.cpp b/src/OpenGL/compiler/ShaderLang.cpp index cd4e9ad..2e6a430 100644 --- a/src/OpenGL/compiler/ShaderLang.cpp +++ b/src/OpenGL/compiler/ShaderLang.cpp
@@ -11,9 +11,9 @@ #include "GLSLANG/ShaderLang.h" -#include "compiler/InitializeDll.h" -#include "compiler/preprocessor/length_limits.h" -#include "compiler/ShHandle.h" +#include "InitializeDll.h" +#include "preprocessor/length_limits.h" +#include "ShHandle.h" #include <limits.h>
diff --git a/src/OpenGL/compiler/SymbolTable.cpp b/src/OpenGL/compiler/SymbolTable.cpp index 93937af..2502332 100644 --- a/src/OpenGL/compiler/SymbolTable.cpp +++ b/src/OpenGL/compiler/SymbolTable.cpp
@@ -13,7 +13,7 @@ #pragma warning(disable: 4718) #endif -#include "compiler/SymbolTable.h" +#include "SymbolTable.h" #include <stdio.h> #include <algorithm>
diff --git a/src/OpenGL/compiler/SymbolTable.h b/src/OpenGL/compiler/SymbolTable.h index 739b7ad..1a96951 100644 --- a/src/OpenGL/compiler/SymbolTable.h +++ b/src/OpenGL/compiler/SymbolTable.h
@@ -32,8 +32,8 @@ #include <assert.h> -#include "compiler/InfoSink.h" -#include "compiler/intermediate.h" +#include "InfoSink.h" +#include "intermediate.h" // // Symbol base class. (Can build functions or variables out of these...)
diff --git a/src/OpenGL/compiler/Types.h b/src/OpenGL/compiler/Types.h index 8b6f07c..7411f72 100644 --- a/src/OpenGL/compiler/Types.h +++ b/src/OpenGL/compiler/Types.h
@@ -7,9 +7,9 @@ #ifndef _TYPES_INCLUDED #define _TYPES_INCLUDED -#include "compiler/BaseTypes.h" -#include "compiler/Common.h" -#include "compiler/debug.h" +#include "BaseTypes.h" +#include "Common.h" +#include "debug.h" #include <algorithm>
diff --git a/src/OpenGL/compiler/ValidateLimitations.cpp b/src/OpenGL/compiler/ValidateLimitations.cpp index 9219cd1..8c93171 100644 --- a/src/OpenGL/compiler/ValidateLimitations.cpp +++ b/src/OpenGL/compiler/ValidateLimitations.cpp
@@ -4,10 +4,10 @@ // found in the LICENSE file. // -#include "compiler/ValidateLimitations.h" -#include "compiler/InfoSink.h" -#include "compiler/InitializeParseContext.h" -#include "compiler/ParseHelper.h" +#include "ValidateLimitations.h" +#include "InfoSink.h" +#include "InitializeParseContext.h" +#include "ParseHelper.h" namespace { bool IsLoopIndex(const TIntermSymbol* symbol, const TLoopStack& stack) {
diff --git a/src/OpenGL/compiler/ValidateLimitations.h b/src/OpenGL/compiler/ValidateLimitations.h index a835cb3..ebb2f2e 100644 --- a/src/OpenGL/compiler/ValidateLimitations.h +++ b/src/OpenGL/compiler/ValidateLimitations.h
@@ -5,7 +5,7 @@ // #include "GLSLANG/ShaderLang.h" -#include "compiler/intermediate.h" +#include "intermediate.h" class TInfoSinkBase;
diff --git a/src/OpenGL/compiler/debug.cpp b/src/OpenGL/compiler/debug.cpp index 53778bd..e507ff6 100644 --- a/src/OpenGL/compiler/debug.cpp +++ b/src/OpenGL/compiler/debug.cpp
@@ -6,13 +6,13 @@ // debug.cpp: Debugging utilities. -#include "compiler/debug.h" +#include "debug.h" #include <stdarg.h> #include <stdio.h> -#include "compiler/InitializeParseContext.h" -#include "compiler/ParseHelper.h" +#include "InitializeParseContext.h" +#include "ParseHelper.h" static const int kTraceBufferLen = 1024;
diff --git a/src/OpenGL/compiler/glslang.l b/src/OpenGL/compiler/glslang.l index bf9f157..0aa4e89 100644 --- a/src/OpenGL/compiler/glslang.l +++ b/src/OpenGL/compiler/glslang.l
@@ -36,10 +36,10 @@ } %{ -#include "compiler/glslang.h" -#include "compiler/ParseHelper.h" -#include "compiler/preprocessor/Token.h" -#include "compiler/util.h" +#include "glslang.h" +#include "ParseHelper.h" +#include "preprocessor/Token.h" +#include "util.h" #include "glslang_tab.h" /* windows only pragma */
diff --git a/src/OpenGL/compiler/glslang.y b/src/OpenGL/compiler/glslang.y index 9d307dd..77a0e1b 100644 --- a/src/OpenGL/compiler/glslang.y +++ b/src/OpenGL/compiler/glslang.y
@@ -34,8 +34,8 @@ #pragma warning(disable: 4701) #endif -#include "compiler/SymbolTable.h" -#include "compiler/ParseHelper.h" +#include "SymbolTable.h" +#include "ParseHelper.h" #include "GLSLANG/ShaderLang.h" #define YYENABLE_NLS 0
diff --git a/src/OpenGL/compiler/glslang_lex.cpp b/src/OpenGL/compiler/glslang_lex.cpp index bbb2a9f..ef0a9a6 100644 --- a/src/OpenGL/compiler/glslang_lex.cpp +++ b/src/OpenGL/compiler/glslang_lex.cpp
@@ -814,10 +814,10 @@ WHICH GENERATES THE GLSL ES LEXER (glslang_lex.cpp). */ -#include "compiler/glslang.h" -#include "compiler/ParseHelper.h" -#include "compiler/preprocessor/Token.h" -#include "compiler/util.h" +#include "glslang.h" +#include "ParseHelper.h" +#include "preprocessor/Token.h" +#include "util.h" #include "glslang_tab.h" /* windows only pragma */
diff --git a/src/OpenGL/compiler/glslang_tab.cpp b/src/OpenGL/compiler/glslang_tab.cpp index d4c09b4..f2f061b 100644 --- a/src/OpenGL/compiler/glslang_tab.cpp +++ b/src/OpenGL/compiler/glslang_tab.cpp
@@ -88,8 +88,8 @@ #pragma warning(disable: 4701) #endif -#include "compiler/SymbolTable.h" -#include "compiler/ParseHelper.h" +#include "SymbolTable.h" +#include "ParseHelper.h" #include "GLSLANG/ShaderLang.h" #define YYENABLE_NLS 0
diff --git a/src/OpenGL/compiler/intermOut.cpp b/src/OpenGL/compiler/intermOut.cpp index a0ca60c..c88564b 100644 --- a/src/OpenGL/compiler/intermOut.cpp +++ b/src/OpenGL/compiler/intermOut.cpp
@@ -4,8 +4,8 @@ // found in the LICENSE file. // -#include "compiler/localintermediate.h" -#include "compiler/SymbolTable.h" +#include "localintermediate.h" +#include "SymbolTable.h" // // Two purposes:
diff --git a/src/OpenGL/compiler/intermediate.h b/src/OpenGL/compiler/intermediate.h index 18b889f..d060cf3 100644 --- a/src/OpenGL/compiler/intermediate.h +++ b/src/OpenGL/compiler/intermediate.h
@@ -16,9 +16,9 @@ #ifndef __INTERMEDIATE_H #define __INTERMEDIATE_H -#include "compiler/Common.h" -#include "compiler/Types.h" -#include "compiler/ConstantUnion.h" +#include "Common.h" +#include "Types.h" +#include "ConstantUnion.h" // // Operators used by the high-level (parse tree) representation.
diff --git a/src/OpenGL/compiler/localintermediate.h b/src/OpenGL/compiler/localintermediate.h index 1a1c7dc..53caec1 100644 --- a/src/OpenGL/compiler/localintermediate.h +++ b/src/OpenGL/compiler/localintermediate.h
@@ -8,7 +8,7 @@ #define _LOCAL_INTERMEDIATE_INCLUDED_ #include "GLSLANG/ShaderLang.h" -#include "compiler/intermediate.h" +#include "intermediate.h" struct TVectorFields { int offsets[4];
diff --git a/src/OpenGL/compiler/osinclude.h b/src/OpenGL/compiler/osinclude.h index 1c965fb..8349a4a 100644 --- a/src/OpenGL/compiler/osinclude.h +++ b/src/OpenGL/compiler/osinclude.h
@@ -35,7 +35,7 @@ #endif // ANGLE_OS_WIN -#include "compiler/debug.h" +#include "debug.h" // // Thread Local Storage Operations
diff --git a/src/OpenGL/compiler/ossource_posix.cpp b/src/OpenGL/compiler/ossource_posix.cpp index 1e1e699..f8ed83b 100644 --- a/src/OpenGL/compiler/ossource_posix.cpp +++ b/src/OpenGL/compiler/ossource_posix.cpp
@@ -7,7 +7,7 @@ // // This file contains the posix specific functions // -#include "compiler/osinclude.h" +#include "osinclude.h" #if !defined(ANGLE_OS_POSIX) #error Trying to build a posix specific file in a non-posix build.
diff --git a/src/OpenGL/compiler/ossource_win.cpp b/src/OpenGL/compiler/ossource_win.cpp index 89922fe..71fda7a 100644 --- a/src/OpenGL/compiler/ossource_win.cpp +++ b/src/OpenGL/compiler/ossource_win.cpp
@@ -4,7 +4,7 @@ // found in the LICENSE file. // -#include "compiler/osinclude.h" +#include "osinclude.h" // // This file contains contains the window's specific functions //
diff --git a/src/OpenGL/compiler/parseConst.cpp b/src/OpenGL/compiler/parseConst.cpp index c864836..d14babf 100644 --- a/src/OpenGL/compiler/parseConst.cpp +++ b/src/OpenGL/compiler/parseConst.cpp
@@ -4,7 +4,7 @@ // found in the LICENSE file. // -#include "compiler/ParseHelper.h" +#include "ParseHelper.h" // // Use this class to carry along data from node to node in
diff --git a/src/OpenGL/libGLES_CM/Framebuffer.cpp b/src/OpenGL/libGLES_CM/Framebuffer.cpp index 3ca7665..624a4b9 100644 --- a/src/OpenGL/libGLES_CM/Framebuffer.cpp +++ b/src/OpenGL/libGLES_CM/Framebuffer.cpp
@@ -400,41 +400,41 @@ return GL_FRAMEBUFFER_COMPLETE_OES; } -GLenum Framebuffer::getImplementationColorReadFormat() -{ - Renderbuffer *colorbuffer = mColorbufferPointer.get(); - - if(colorbuffer) - { - switch(colorbuffer->getInternalFormat()) - { - case sw::FORMAT_A8R8G8B8: return GL_BGRA_EXT; - case sw::FORMAT_X8R8G8B8: return GL_BGRA_EXT; - case sw::FORMAT_A1R5G5B5: return GL_BGRA_EXT; - case sw::FORMAT_R5G6B5: return 0x80E0; // GL_BGR_EXT - default: - UNREACHABLE(); - } - } - - return GL_RGBA; -} - +GLenum Framebuffer::getImplementationColorReadFormat() +{ + Renderbuffer *colorbuffer = mColorbufferPointer.get(); + + if(colorbuffer) + { + switch(colorbuffer->getInternalFormat()) + { + case sw::FORMAT_A8R8G8B8: return GL_BGRA_EXT; + case sw::FORMAT_X8R8G8B8: return GL_BGRA_EXT; + case sw::FORMAT_A1R5G5B5: return GL_BGRA_EXT; + case sw::FORMAT_R5G6B5: return 0x80E0; // GL_BGR_EXT + default: + UNREACHABLE(); + } + } + + return GL_RGBA; +} + GLenum Framebuffer::getImplementationColorReadType() { - Renderbuffer *colorbuffer = mColorbufferPointer.get(); - - if(colorbuffer) - { - switch(colorbuffer->getInternalFormat()) - { - case sw::FORMAT_A8R8G8B8: return GL_UNSIGNED_BYTE; - case sw::FORMAT_X8R8G8B8: return GL_UNSIGNED_BYTE; - case sw::FORMAT_A1R5G5B5: return GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT; - case sw::FORMAT_R5G6B5: return GL_UNSIGNED_SHORT_5_6_5; - default: - UNREACHABLE(); - } + Renderbuffer *colorbuffer = mColorbufferPointer.get(); + + if(colorbuffer) + { + switch(colorbuffer->getInternalFormat()) + { + case sw::FORMAT_A8R8G8B8: return GL_UNSIGNED_BYTE; + case sw::FORMAT_X8R8G8B8: return GL_UNSIGNED_BYTE; + case sw::FORMAT_A1R5G5B5: return GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT; + case sw::FORMAT_R5G6B5: return GL_UNSIGNED_SHORT_5_6_5; + default: + UNREACHABLE(); + } } return GL_UNSIGNED_BYTE;