Commit 69bde01a by Geoff Lang

Add texture format utilities for GL and generate GL texture caps.

BUG=angleproject:884 Change-Id: Iba0108b22e6a404842ec1013d22c00d206c865d3 Reviewed-on: https://chromium-review.googlesource.com/255512Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 8c25cdec
//
// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// formatutilsgl.cpp: Queries for GL image formats and their translations to native
// GL formats.
#include "libANGLE/renderer/gl/formatutilsgl.h"
#include <map>
namespace rx
{
namespace nativegl
{
// Information about internal formats
static bool AlwaysSupported(GLuint, GLuint, const std::vector<std::string> &)
{
return true;
}
static bool UnimplementedSupport(GLuint, GLuint, const std::vector<std::string> &)
{
return false;
}
static bool NeverSupported(GLuint, GLuint, const std::vector<std::string> &)
{
return false;
}
template <GLuint minMajorVersion, GLuint minMinorVersion>
static bool RequireGL(GLuint major, GLuint minor, const std::vector<std::string> &)
{
return major > minMajorVersion || (major == minMajorVersion && minor >= minMinorVersion);
}
InternalFormat::InternalFormat()
: textureSupport(NeverSupported),
renderSupport(NeverSupported),
filterSupport(NeverSupported)
{
}
typedef std::pair<GLenum, InternalFormat> InternalFormatInfoPair;
typedef std::map<GLenum, InternalFormat> InternalFormatInfoMap;
// A helper function to insert data into the format map with fewer characters.
static inline void InsertFormatMapping(InternalFormatInfoMap *map, GLenum internalFormat,
InternalFormat::SupportCheckFunction textureSupport,
InternalFormat::SupportCheckFunction renderSupport,
InternalFormat::SupportCheckFunction filterSupport)
{
InternalFormat formatInfo;
formatInfo.textureSupport = textureSupport;
formatInfo.renderSupport = renderSupport;
formatInfo.filterSupport = filterSupport;
map->insert(std::make_pair(internalFormat, formatInfo));
}
static InternalFormatInfoMap BuildInternalFormatInfoMap()
{
InternalFormatInfoMap map;
// From ES 3.0.1 spec, table 3.12
InsertFormatMapping(&map, GL_NONE, NeverSupported, NeverSupported, NeverSupported);
// | Internal format | Texture support | Render support | Filter support |
InsertFormatMapping(&map, GL_R8, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_R8_SNORM, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RG8, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RG8_SNORM, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB8, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB8_SNORM, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB565, AlwaysSupported, AlwaysSupported, AlwaysSupported );
InsertFormatMapping(&map, GL_RGBA4, AlwaysSupported, AlwaysSupported, AlwaysSupported );
InsertFormatMapping(&map, GL_RGB5_A1, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGBA8, AlwaysSupported, AlwaysSupported, AlwaysSupported );
InsertFormatMapping(&map, GL_RGBA8_SNORM, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB10_A2, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB10_A2UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_SRGB8, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_SRGB8_ALPHA8, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_R11F_G11F_B10F, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB9_E5, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_R8I, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_R8UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_R16I, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_R16UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_R32I, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_R32UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RG8I, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RG8UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RG16I, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RG16UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RG32I, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RG32UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB8I, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB8UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB16I, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB16UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB32I, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB32UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGBA8I, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGBA8UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGBA16I, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGBA16UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGBA32I, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGBA32UI, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_BGRA8_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
// Floating point formats
// | Internal format | Texture support | Render support | Filter support |
InsertFormatMapping(&map, GL_R16F, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RG16F, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB16F, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGBA16F, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_R32F, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RG32F, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB32F, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGBA32F, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
// Depth stencil formats
// | Internal format | Texture support | Render support | Filter support |
InsertFormatMapping(&map, GL_DEPTH_COMPONENT16, AlwaysSupported, AlwaysSupported, NeverSupported );
InsertFormatMapping(&map, GL_DEPTH_COMPONENT24, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_DEPTH_COMPONENT32F, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_DEPTH_COMPONENT32_OES, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_DEPTH24_STENCIL8, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_DEPTH32F_STENCIL8, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_STENCIL_INDEX8, AlwaysSupported, AlwaysSupported, NeverSupported );
// Luminance alpha formats
// | Internal format | Texture support | Render support | Filter support |
InsertFormatMapping(&map, GL_ALPHA8_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_LUMINANCE8_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_ALPHA32F_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_LUMINANCE32F_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_ALPHA16F_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_LUMINANCE16F_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_LUMINANCE8_ALPHA8_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_LUMINANCE_ALPHA32F_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_LUMINANCE_ALPHA16F_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
// Unsized formats
// | Internal format | Texture support | Render support | Filter support |
InsertFormatMapping(&map, GL_ALPHA, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_LUMINANCE, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_LUMINANCE_ALPHA, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RED, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RG, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGBA, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RED_INTEGER, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RG_INTEGER, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGB_INTEGER, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_RGBA_INTEGER, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_BGRA_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_DEPTH_COMPONENT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_DEPTH_STENCIL, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_SRGB_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_SRGB_ALPHA_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
// Compressed formats, From ES 3.0.1 spec, table 3.16
// | Internal format | Texture support | Render support | Filter support |
InsertFormatMapping(&map, GL_COMPRESSED_R11_EAC, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_COMPRESSED_SIGNED_R11_EAC, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_COMPRESSED_RG11_EAC, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_COMPRESSED_SIGNED_RG11_EAC, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_COMPRESSED_RGB8_ETC2, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ETC2, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_COMPRESSED_RGBA8_ETC2_EAC, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
// From GL_EXT_texture_compression_dxt1
// | Internal format | Texture support | Render support | Filter support |
InsertFormatMapping(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
// From GL_ANGLE_texture_compression_dxt3
InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
// From GL_ANGLE_texture_compression_dxt5
InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, UnimplementedSupport, UnimplementedSupport, UnimplementedSupport);
return map;
}
static const InternalFormatInfoMap &GetInternalFormatMap()
{
static const InternalFormatInfoMap formatMap = BuildInternalFormatInfoMap();
return formatMap;
}
const InternalFormat &GetInternalFormatInfo(GLenum internalFormat)
{
const InternalFormatInfoMap &formatMap = GetInternalFormatMap();
InternalFormatInfoMap::const_iterator iter = formatMap.find(internalFormat);
if (iter != formatMap.end())
{
return iter->second;
}
else
{
static const InternalFormat defaultInternalFormat;
return defaultInternalFormat;
}
}
}
}
//
// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// formatutilsgl.h: Queries for GL image formats and their translations to native
// GL formats.
#ifndef LIBANGLE_RENDERER_GL_FORMATUTILSGL_H_
#define LIBANGLE_RENDERER_GL_FORMATUTILSGL_H_
#include <string>
#include <vector>
#include "angle_gl.h"
namespace rx
{
namespace nativegl
{
struct InternalFormat
{
InternalFormat();
typedef bool(*SupportCheckFunction)(GLuint majorVersion, GLuint minorVersion,
const std::vector<std::string> &extensions);
SupportCheckFunction textureSupport;
SupportCheckFunction renderSupport;
SupportCheckFunction filterSupport;
};
const InternalFormat &GetInternalFormatInfo(GLenum internalFormat);
}
}
#endif // LIBANGLE_RENDERER_GL_FORMATUTILSGL_H_
......@@ -12,14 +12,75 @@
#include <limits>
#include "libANGLE/Caps.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
#include "libANGLE/renderer/gl/formatutilsgl.h"
#include <algorithm>
namespace rx
{
namespace nativegl
{
void GetGLVersion(PFNGLGETSTRINGPROC getStringFunction, GLuint *outMajorVersion, GLuint *outMinorVersion,
bool *outIsES)
{
const std::string version = reinterpret_cast<const char*>(getStringFunction(GL_VERSION));
if (version.find("OpenGL ES") == std::string::npos)
{
// ES spec states that the GL_VERSION string will be in the following format:
// "OpenGL ES N.M vendor-specific information"
*outIsES = false;
*outMajorVersion = version[0] - '0';
*outMinorVersion = version[2] - '0';
}
else
{
// OpenGL spec states the GL_VERSION string will be in the following format:
// <version number><space><vendor-specific information>
// The version number is either of the form major number.minor number or major
// number.minor number.release number, where the numbers all have one or more
// digits
*outIsES = true;
*outMajorVersion = version[10] - '0';
*outMinorVersion = version[12] - '0';
}
}
std::vector<std::string> GetGLExtensions(PFNGLGETSTRINGPROC getStringFunction)
{
std::vector<std::string> result;
std::istringstream stream(reinterpret_cast<const char*>(getStringFunction(GL_EXTENSIONS)));
std::string extension;
while (std::getline(stream, extension, ' '))
{
result.push_back(extension);
}
return result;
}
}
namespace nativegl_gl
{
static gl::TextureCaps GenerateTextureFormatCaps(const FunctionsGL *functions, GLenum internalFormat, GLuint majorVersion, GLuint minorVersion,
const std::vector<std::string> &extensions)
{
gl::TextureCaps textureCaps;
const nativegl::InternalFormat &formatInfo = nativegl::GetInternalFormatInfo(internalFormat);
textureCaps.texturable = formatInfo.textureSupport(majorVersion, minorVersion, extensions);
textureCaps.renderable = formatInfo.renderSupport(majorVersion, minorVersion, extensions);
textureCaps.filterable = formatInfo.filterSupport(majorVersion, minorVersion, extensions);
return textureCaps;
}
static GLint QuerySingleGLInt(const FunctionsGL *functions, GLenum name)
{
GLint result;
......@@ -30,6 +91,29 @@ static GLint QuerySingleGLInt(const FunctionsGL *functions, GLenum name)
void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsMap *textureCapsMap,
gl::Extensions *extensions)
{
GLuint majorVersion = 0;
GLuint minorVersion = 0;
bool isES = false;
nativegl::GetGLVersion(functions->getString, &majorVersion, &minorVersion, &isES);
std::vector<std::string> nativeExtensions = nativegl::GetGLExtensions(functions->getString);
// Texture format support checks
GLuint maxSamples = 0;
const gl::FormatSet &allFormats = gl::GetAllSizedInternalFormats();
for (GLenum internalFormat : allFormats)
{
gl::TextureCaps textureCaps = GenerateTextureFormatCaps(functions, internalFormat, majorVersion, minorVersion, nativeExtensions);
textureCapsMap->insert(internalFormat, textureCaps);
maxSamples = std::max(maxSamples, textureCaps.getMaxSamples());
if (gl::GetInternalFormatInfo(internalFormat).compressed)
{
caps->compressedTextureFormats.push_back(internalFormat);
}
}
// Set some minimum GLES2 caps, TODO: query for real GL caps
// Table 6.28, implementation dependent values
......@@ -99,21 +183,6 @@ void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsM
caps->maxTransformFeedbackSeparateAttributes = 4;
caps->maxTransformFeedbackSeparateComponents = 4;
// Texture Caps
gl::TextureCaps supportedTextureFormat;
supportedTextureFormat.texturable = true;
supportedTextureFormat.filterable = true;
supportedTextureFormat.renderable = true;
textureCapsMap->insert(GL_RGB565, supportedTextureFormat);
textureCapsMap->insert(GL_RGBA4, supportedTextureFormat);
textureCapsMap->insert(GL_RGB5_A1, supportedTextureFormat);
textureCapsMap->insert(GL_RGB8_OES, supportedTextureFormat);
textureCapsMap->insert(GL_RGBA8_OES, supportedTextureFormat);
textureCapsMap->insert(GL_DEPTH_COMPONENT16, supportedTextureFormat);
textureCapsMap->insert(GL_STENCIL_INDEX8, supportedTextureFormat);
// Extension support
extensions->setTextureExtensionSupport(*textureCapsMap);
extensions->textureNPOT = true;
......
......@@ -10,6 +10,10 @@
#ifndef LIBANGLE_RENDERER_GL_RENDERERGLUTILS_H_
#define LIBANGLE_RENDERER_GL_RENDERERGLUTILS_H_
#include "libANGLE/renderer/gl/functionsgl_typedefs.h"
#include <vector>
namespace gl
{
struct Caps;
......@@ -21,6 +25,14 @@ namespace rx
{
class FunctionsGL;
namespace nativegl
{
void GetGLVersion(PFNGLGETSTRINGPROC getStringFunction, GLuint *outMajorVersion, GLuint *outMinorVersion, bool *outIsES);
std::vector<std::string> GetGLExtensions(PFNGLGETSTRINGPROC getStringFunction);
}
namespace nativegl_gl
{
......
......@@ -12,6 +12,7 @@
#include "libANGLE/Config.h"
#include "libANGLE/Display.h"
#include "libANGLE/Surface.h"
#include "libANGLE/renderer/gl/renderergl_utils.h"
#include "libANGLE/renderer/gl/wgl/FunctionsWGL.h"
#include "libANGLE/renderer/gl/wgl/WindowSurfaceWGL.h"
#include "libANGLE/renderer/gl/wgl/wgl_utils.h"
......@@ -184,14 +185,11 @@ egl::Error DisplayWGL::initialize(egl::Display *display)
return egl::Error(EGL_NOT_INITIALIZED, "Failed to get glGetString pointer.");
}
const char *dummyGLVersionString = reinterpret_cast<const char*>(getString(GL_VERSION));
if (!dummyGLVersionString)
{
return egl::Error(EGL_NOT_INITIALIZED, "Failed to get OpenGL version string.");
}
GLuint maxGLVersionMajor = dummyGLVersionString[0] - '0';
GLuint maxGLVersionMinor = dummyGLVersionString[2] - '0';
GLuint maxGLVersionMajor = 0;
GLuint maxGLVersionMinor = 0;
bool isES = false;
nativegl::GetGLVersion(getString, &maxGLVersionMajor, &maxGLVersionMinor, &isES);
ASSERT(!isES);
// Reinitialize the wgl functions to grab the extensions
mFunctionsWGL->intialize(mOpenGLModule, dummyDeviceContext);
......@@ -300,9 +298,8 @@ egl::Error DisplayWGL::initialize(egl::Display *display)
return egl::Error(EGL_NOT_INITIALIZED, "Failed to make the intermediate WGL context current.");
}
const char *versionString = reinterpret_cast<const char*>(getString(GL_VERSION));
mGLVersionMajor = versionString[0] - '0';
mGLVersionMinor = versionString[2] - '0';
nativegl::GetGLVersion(getString, &mGLVersionMajor, &mGLVersionMinor, &isES);
ASSERT(!isES);
mFunctionsGL = new FunctionsGLWindows(mOpenGLModule, mFunctionsWGL->getProcAddress);
mFunctionsGL->initialize(mGLVersionMajor, mGLVersionMinor);
......
......@@ -404,6 +404,8 @@
'libANGLE/renderer/gl/TransformFeedbackGL.h',
'libANGLE/renderer/gl/VertexArrayGL.cpp',
'libANGLE/renderer/gl/VertexArrayGL.h',
'libANGLE/renderer/gl/formatutilsgl.cpp',
'libANGLE/renderer/gl/formatutilsgl.h',
'libANGLE/renderer/gl/functionsgl_enums.h',
'libANGLE/renderer/gl/functionsgl_typedefs.h',
'libANGLE/renderer/gl/renderergl_utils.cpp',
......
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