Commit c52a4360 by Nicolas Capens

Clean up GL header includes.

Change-Id: I6dcaac900eaae54d2ec0265d656fdc9c38371b8a Reviewed-on: https://swiftshader-review.googlesource.com/4449Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent f3898617
......@@ -17,7 +17,6 @@
#include "Common/Math.hpp"
#include "Common/Thread.hpp"
#include <GLES/glext.h>
#include <GLES2/gl2ext.h>
#include <GLES3/gl3.h>
......
......@@ -4,7 +4,6 @@
#include "libEGL/Texture.hpp"
#include "Renderer/Surface.hpp"
#include <GLES/gl.h>
#include <GLES2/gl2.h>
#if defined(__ANDROID__)
......@@ -26,11 +25,6 @@
namespace egl
{
// Types common between gl.h and gl2.h
// We can't include either header in EGL
typedef unsigned int GLenum;
typedef int GLint;
typedef int GLsizei;
sw::Format SelectInternalFormat(GLenum format, GLenum type);
GLsizei ComputePitch(GLsizei width, GLenum format, GLenum type, GLint alignment);
......
......@@ -341,7 +341,7 @@ void BindBuffer(GLenum target, GLuint buffer)
if(context)
{
egl::GLint clientVersion = egl::getClientVersion();
GLint clientVersion = egl::getClientVersion();
switch(target)
{
......@@ -460,7 +460,7 @@ void BindTexture(GLenum target, GLuint texture)
return error(GL_INVALID_OPERATION);
}
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(target)
{
......@@ -553,7 +553,7 @@ void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dst
TRACE("(GLenum srcRGB = 0x%X, GLenum dstRGB = 0x%X, GLenum srcAlpha = 0x%X, GLenum dstAlpha = 0x%X)",
srcRGB, dstRGB, srcAlpha, dstAlpha);
egl::GLint clientVersion = egl::getClientVersion();
GLint clientVersion = egl::getClientVersion();
switch(srcRGB)
{
......@@ -673,7 +673,7 @@ void BufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage
return error(GL_INVALID_VALUE);
}
egl::GLint clientVersion = egl::getClientVersion();
GLint clientVersion = egl::getClientVersion();
switch(usage)
{
......@@ -2082,7 +2082,7 @@ void FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuff
}
}
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(attachment)
{
......@@ -2233,7 +2233,7 @@ void FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GL
return error(GL_INVALID_OPERATION);
}
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(attachment)
{
......@@ -2340,7 +2340,7 @@ void GenerateMipmap(GLenum target)
{
es2::Texture *texture = nullptr;
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(target)
{
......@@ -2694,7 +2694,7 @@ void GetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
return error(GL_INVALID_OPERATION);
}
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(pname)
{
......@@ -2838,7 +2838,7 @@ void GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenu
return error(GL_INVALID_ENUM);
}
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
es2::Framebuffer *framebuffer = NULL;
if(target == GL_READ_FRAMEBUFFER_ANGLE)
......@@ -3257,7 +3257,7 @@ void GetProgramiv(GLuint program, GLenum pname, GLint* params)
return error(GL_INVALID_VALUE);
}
egl::GLint clientVersion = egl::getClientVersion();
GLint clientVersion = egl::getClientVersion();
switch(pname)
{
......@@ -3638,7 +3638,7 @@ void GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
{
es2::Texture *texture;
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(target)
{
......@@ -3784,7 +3784,7 @@ void GetTexParameteriv(GLenum target, GLenum pname, GLint* params)
{
es2::Texture *texture;
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(target)
{
......@@ -4103,7 +4103,7 @@ void GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
const es2::VertexAttribute &attribState = context->getVertexAttribState(index);
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(pname)
{
......@@ -4176,7 +4176,7 @@ void GetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
const es2::VertexAttribute &attribState = context->getVertexAttribState(index);
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(pname)
{
......@@ -4312,7 +4312,7 @@ GLboolean IsEnabled(GLenum cap)
if(context)
{
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(cap)
{
......@@ -4536,7 +4536,7 @@ void PixelStorei(GLenum pname, GLint param)
if(context)
{
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(pname)
{
......@@ -4740,7 +4740,7 @@ void RenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum
return error(GL_INVALID_OPERATION);
}
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(internalformat)
{
case GL_DEPTH_COMPONENT32F:
......@@ -5118,7 +5118,7 @@ void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width,
if(context)
{
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
if(clientVersion < 3)
{
if(internalformat != format)
......@@ -5884,7 +5884,7 @@ void TexParameterf(GLenum target, GLenum pname, GLfloat param)
{
es2::Texture *texture;
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(target)
{
......@@ -6039,7 +6039,7 @@ void TexParameteri(GLenum target, GLenum pname, GLint param)
{
es2::Texture *texture;
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(target)
{
......@@ -6900,7 +6900,7 @@ void VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normal
return error(GL_INVALID_VALUE);
}
egl::GLint clientVersion = egl::getClientVersion();
GLint clientVersion = egl::getClientVersion();
switch(type)
{
......@@ -7352,7 +7352,7 @@ void FramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget,
return error(GL_INVALID_OPERATION);
}
egl::GLint clientVersion = context->getClientVersion();
GLint clientVersion = context->getClientVersion();
switch(attachment)
{
......
......@@ -465,59 +465,59 @@ namespace es2
return static_cast<GLint>((static_cast<GLfloat>(0xFFFFFFFF) * value - 1.0f) * 0.5f);
}
bool IsCompressed(GLenum format, egl::GLint clientVersion)
bool IsCompressed(GLenum format, GLint clientVersion)
{
return ValidateCompressedFormat(format, clientVersion, true) == GL_NONE;
}
GLenum ValidateCompressedFormat(GLenum format, egl::GLint clientVersion, bool expectCompressedFormats)
GLenum ValidateCompressedFormat(GLenum format, GLint clientVersion, bool expectCompressedFormats)
{
switch(format)
{
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
return S3TC_SUPPORT ? (expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION) : GL_INVALID_ENUM;
case GL_ETC1_RGB8_OES:
return expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION;
case GL_COMPRESSED_R11_EAC:
case GL_COMPRESSED_SIGNED_R11_EAC:
case GL_COMPRESSED_RG11_EAC:
case GL_COMPRESSED_SIGNED_RG11_EAC:
case GL_COMPRESSED_RGB8_ETC2:
case GL_COMPRESSED_SRGB8_ETC2:
case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
case GL_COMPRESSED_RGBA8_ETC2_EAC:
case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
case GL_COMPRESSED_RGBA_ASTC_4x4_KHR:
case GL_COMPRESSED_RGBA_ASTC_5x4_KHR:
case GL_COMPRESSED_RGBA_ASTC_5x5_KHR:
case GL_COMPRESSED_RGBA_ASTC_6x5_KHR:
case GL_COMPRESSED_RGBA_ASTC_6x6_KHR:
case GL_COMPRESSED_RGBA_ASTC_8x5_KHR:
case GL_COMPRESSED_RGBA_ASTC_8x6_KHR:
case GL_COMPRESSED_RGBA_ASTC_8x8_KHR:
case GL_COMPRESSED_RGBA_ASTC_10x5_KHR:
case GL_COMPRESSED_RGBA_ASTC_10x6_KHR:
case GL_COMPRESSED_RGBA_ASTC_10x8_KHR:
case GL_COMPRESSED_RGBA_ASTC_10x10_KHR:
case GL_COMPRESSED_RGBA_ASTC_12x10_KHR:
case GL_COMPRESSED_RGBA_ASTC_12x12_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
return S3TC_SUPPORT ? (expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION) : GL_INVALID_ENUM;
case GL_ETC1_RGB8_OES:
return expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION;
case GL_COMPRESSED_R11_EAC:
case GL_COMPRESSED_SIGNED_R11_EAC:
case GL_COMPRESSED_RG11_EAC:
case GL_COMPRESSED_SIGNED_RG11_EAC:
case GL_COMPRESSED_RGB8_ETC2:
case GL_COMPRESSED_SRGB8_ETC2:
case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
case GL_COMPRESSED_RGBA8_ETC2_EAC:
case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
case GL_COMPRESSED_RGBA_ASTC_4x4_KHR:
case GL_COMPRESSED_RGBA_ASTC_5x4_KHR:
case GL_COMPRESSED_RGBA_ASTC_5x5_KHR:
case GL_COMPRESSED_RGBA_ASTC_6x5_KHR:
case GL_COMPRESSED_RGBA_ASTC_6x6_KHR:
case GL_COMPRESSED_RGBA_ASTC_8x5_KHR:
case GL_COMPRESSED_RGBA_ASTC_8x6_KHR:
case GL_COMPRESSED_RGBA_ASTC_8x8_KHR:
case GL_COMPRESSED_RGBA_ASTC_10x5_KHR:
case GL_COMPRESSED_RGBA_ASTC_10x6_KHR:
case GL_COMPRESSED_RGBA_ASTC_10x8_KHR:
case GL_COMPRESSED_RGBA_ASTC_10x10_KHR:
case GL_COMPRESSED_RGBA_ASTC_12x10_KHR:
case GL_COMPRESSED_RGBA_ASTC_12x12_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
return (clientVersion >= 3) ? (expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION) : GL_INVALID_ENUM;
default:
......@@ -597,7 +597,7 @@ namespace es2
return GL_NONE;
}
bool ValidReadPixelsFormatType(GLenum internalFormat, GLenum internalType, GLenum format, GLenum type, egl::GLint clientVersion)
bool ValidReadPixelsFormatType(GLenum internalFormat, GLenum internalType, GLenum format, GLenum type, GLint clientVersion)
{
switch(format)
{
......@@ -703,7 +703,7 @@ namespace es2
}
// Verify that format/type are one of the combinations from table 3.4.
bool CheckTextureFormatType(GLenum format, GLenum type, egl::GLint clientVersion)
bool CheckTextureFormatType(GLenum format, GLenum type, GLint clientVersion)
{
switch(type)
{
......@@ -823,7 +823,7 @@ namespace es2
}
}
bool IsColorRenderable(GLenum internalformat, egl::GLint clientVersion)
bool IsColorRenderable(GLenum internalformat, GLint clientVersion)
{
switch(internalformat)
{
......
......@@ -40,20 +40,20 @@ namespace es2
GLint floatToInt(GLfloat value);
bool IsCompressed(GLenum format, egl::GLint clientVersion);
bool IsCompressed(GLenum format, GLint clientVersion);
GLenum GetSizedInternalFormat(GLenum internalFormat, GLenum type);
GLenum ValidateCompressedFormat(GLenum format, egl::GLint clientVersion, bool expectCompressedFormats);
GLenum ValidateCompressedFormat(GLenum format, GLint clientVersion, bool expectCompressedFormats);
GLenum ValidateSubImageParams(bool compressed, GLsizei width, GLsizei height, GLint xoffset, GLint yoffset, GLenum target, GLint level, GLenum sizedInternalFormat, Texture *texture);
GLenum ValidateSubImageParams(bool compressed, GLsizei width, GLsizei height, GLsizei depth, GLint xoffset, GLint yoffset, GLint zoffset, GLenum target, GLint level, GLenum sizedInternalFormat, Texture *texture);
bool ValidReadPixelsFormatType(GLenum internalFormat, GLenum internalType, GLenum format, GLenum type, egl::GLint clientVersion);
bool ValidReadPixelsFormatType(GLenum internalFormat, GLenum internalType, GLenum format, GLenum type, GLint clientVersion);
bool IsDepthTexture(GLenum format);
bool IsStencilTexture(GLenum format);
bool IsCubemapTextureTarget(GLenum target);
int CubeFaceIndex(GLenum cubeTarget);
bool IsTextureTarget(GLenum target);
bool CheckTextureFormatType(GLenum format, GLenum type, egl::GLint clientVersion);
bool CheckTextureFormatType(GLenum format, GLenum type, GLint clientVersion);
bool IsColorRenderable(GLenum internalformat, egl::GLint clientVersion);
bool IsColorRenderable(GLenum internalformat, GLint clientVersion);
bool IsDepthRenderable(GLenum internalformat);
bool IsStencilRenderable(GLenum internalformat);
......
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