Commit ddc7446d by Geoff Lang

Move RendererGL caps generation to renderergl_utils.

Change-Id: Ia385fc9739174472d698367e2c6093ba1963b1fe Reviewed-on: https://chromium-review.googlesource.com/253634Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent c92fa1ee
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "libANGLE/renderer/gl/TextureGL.h" #include "libANGLE/renderer/gl/TextureGL.h"
#include "libANGLE/renderer/gl/TransformFeedbackGL.h" #include "libANGLE/renderer/gl/TransformFeedbackGL.h"
#include "libANGLE/renderer/gl/VertexArrayGL.h" #include "libANGLE/renderer/gl/VertexArrayGL.h"
#include "libANGLE/renderer/gl/renderergl_utils.h"
namespace rx namespace rx
{ {
...@@ -187,68 +188,7 @@ std::string RendererGL::getRendererDescription() const ...@@ -187,68 +188,7 @@ std::string RendererGL::getRendererDescription() const
void RendererGL::generateCaps(gl::Caps *outCaps, gl::TextureCapsMap* outTextureCaps, gl::Extensions *outExtensions) const void RendererGL::generateCaps(gl::Caps *outCaps, gl::TextureCapsMap* outTextureCaps, gl::Extensions *outExtensions) const
{ {
// Set some minimum GLES2 caps, TODO: query for real GL caps nativegl_gl::GenerateCaps(mFunctions, outCaps, outTextureCaps, outExtensions);
outCaps->maxElementIndex = static_cast<GLint64>(std::numeric_limits<unsigned int>::max());
outCaps->max3DTextureSize = 0;
outCaps->max2DTextureSize = 1024;
outCaps->maxCubeMapTextureSize = outCaps->max2DTextureSize;
outCaps->maxArrayTextureLayers = 1;
outCaps->maxLODBias = 0.0f;
outCaps->maxRenderbufferSize = outCaps->max2DTextureSize;
outCaps->maxDrawBuffers = 1;
outCaps->maxColorAttachments = 1;
outCaps->maxViewportWidth = outCaps->max2DTextureSize;
outCaps->maxViewportHeight = outCaps->maxViewportWidth;
outCaps->minAliasedPointSize = 1.0f;
outCaps->maxAliasedPointSize = 1.0f;
outCaps->minAliasedLineWidth = 1.0f;
outCaps->maxAliasedLineWidth = 1.0f;
outCaps->maxElementsIndices = 0;
outCaps->maxElementsVertices = 0;
outCaps->maxServerWaitTimeout = 0;
outCaps->maxVertexAttributes = 16;
outCaps->maxVertexUniformVectors = 256;
outCaps->maxVertexUniformVectors = outCaps->maxVertexUniformVectors * 4;
outCaps->maxVertexUniformBlocks = 0;
outCaps->maxVertexOutputComponents = 16;
outCaps->maxVertexTextureImageUnits = outCaps->maxTextureImageUnits;
outCaps->maxFragmentUniformVectors = 256;
outCaps->maxFragmentUniformComponents = outCaps->maxFragmentUniformVectors * 4;
outCaps->maxFragmentUniformBlocks = 0;
outCaps->maxFragmentInputComponents = outCaps->maxVertexOutputComponents;
outCaps->maxTextureImageUnits = 16;
outCaps->minProgramTexelOffset = 0;
outCaps->maxProgramTexelOffset = 0;
outCaps->maxUniformBufferBindings = 0;
outCaps->maxUniformBlockSize = 0;
outCaps->uniformBufferOffsetAlignment = 0;
outCaps->maxCombinedUniformBlocks = 0;
outCaps->maxCombinedVertexUniformComponents = 0;
outCaps->maxCombinedFragmentUniformComponents = 0;
outCaps->maxVaryingComponents = 0;
outCaps->maxVaryingVectors = outCaps->maxVertexOutputComponents / 4;
outCaps->maxCombinedTextureImageUnits = outCaps->maxVertexTextureImageUnits + outCaps->maxTextureImageUnits;
outCaps->maxTransformFeedbackInterleavedComponents = 0;
outCaps->maxTransformFeedbackSeparateAttributes = 0;
outCaps->maxTransformFeedbackSeparateComponents = 0;
gl::TextureCaps supportedTextureFormat;
supportedTextureFormat.texturable = true;
supportedTextureFormat.filterable = true;
supportedTextureFormat.renderable = true;
outTextureCaps->insert(GL_RGB565, supportedTextureFormat);
outTextureCaps->insert(GL_RGBA4, supportedTextureFormat);
outTextureCaps->insert(GL_RGB5_A1, supportedTextureFormat);
outTextureCaps->insert(GL_RGB8_OES, supportedTextureFormat);
outTextureCaps->insert(GL_RGBA8_OES, supportedTextureFormat);
outTextureCaps->insert(GL_DEPTH_COMPONENT16, supportedTextureFormat);
outTextureCaps->insert(GL_STENCIL_INDEX8, supportedTextureFormat);
outExtensions->setTextureExtensionSupport(*outTextureCaps);
outExtensions->textureNPOT = true;
outExtensions->textureStorage = true;
} }
Workarounds RendererGL::generateWorkarounds() const Workarounds RendererGL::generateWorkarounds() const
......
//
// Copyright (c) 2012-2014 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.
//
// renderer11_utils.cpp: Conversion functions and other utility routines
// specific to the OpenGL renderer.
#include "libANGLE/renderer/gl/renderergl_utils.h"
#include "libANGLE/Caps.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
namespace rx
{
namespace nativegl_gl
{
void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsMap *textureCapsMap,
gl::Extensions *extensions)
{
// Set some minimum GLES2 caps, TODO: query for real GL caps
// Table 6.28, implementation dependent values
caps->maxElementIndex = static_cast<GLint64>(std::numeric_limits<unsigned int>::max());
caps->max3DTextureSize = 256;
caps->max2DTextureSize = 2048;
caps->maxCubeMapTextureSize = 2048;
caps->maxArrayTextureLayers = 256;
caps->maxLODBias = 2.0f;
caps->maxRenderbufferSize = 2048;
caps->maxDrawBuffers = 4;
caps->maxColorAttachments = 4;
caps->maxViewportWidth = caps->max2DTextureSize;
caps->maxViewportHeight = caps->maxViewportWidth;
caps->minAliasedPointSize = 1.0f;
caps->maxAliasedPointSize = 1.0f;
caps->minAliasedLineWidth = 1.0f;
caps->maxAliasedLineWidth = 1.0f;
// Table 6.29, implementation dependent values (cont.)
caps->maxElementsIndices = 0;
caps->maxElementsVertices = 0;
caps->vertexHighpFloat.setIEEEFloat();
caps->vertexMediumpFloat.setIEEEFloat();
caps->vertexLowpFloat.setIEEEFloat();
caps->fragmentHighpFloat.setIEEEFloat();
caps->fragmentMediumpFloat.setIEEEFloat();
caps->fragmentLowpFloat.setIEEEFloat();
caps->vertexHighpInt.setTwosComplementInt(32);
caps->vertexMediumpInt.setTwosComplementInt(32);
caps->vertexLowpInt.setTwosComplementInt(32);
caps->fragmentHighpInt.setTwosComplementInt(32);
caps->fragmentMediumpInt.setTwosComplementInt(32);
caps->fragmentLowpInt.setTwosComplementInt(32);
caps->maxServerWaitTimeout = 0;
// Table 6.31, implementation dependent vertex shader limits
caps->maxVertexAttributes = 16;
caps->maxVertexUniformVectors = 1024;
caps->maxVertexUniformVectors = 256;
caps->maxVertexUniformBlocks = 12;
caps->maxVertexOutputComponents = 64;
caps->maxVertexTextureImageUnits = 16;
// Table 6.32, implementation dependent fragment shader limits
caps->maxFragmentUniformComponents = 896;
caps->maxFragmentUniformVectors = 224;
caps->maxFragmentUniformBlocks = 12;
caps->maxFragmentInputComponents = 60;
caps->maxTextureImageUnits = 16;
caps->minProgramTexelOffset = -8;
caps->maxProgramTexelOffset = 7;
// Table 6.33, implementation dependent aggregate shader limits
caps->maxUniformBufferBindings = 24;
caps->maxUniformBlockSize = 16384;
caps->uniformBufferOffsetAlignment = 1;
caps->maxCombinedUniformBlocks = 24;
caps->maxCombinedVertexUniformComponents = (caps->maxVertexUniformBlocks * (caps->maxUniformBlockSize / 4)) + caps->maxVertexUniformComponents;
caps->maxCombinedFragmentUniformComponents = (caps->maxFragmentUniformBlocks * (caps->maxUniformBlockSize / 4)) + caps->maxFragmentUniformComponents;
caps->maxVaryingComponents = 60;
caps->maxVaryingVectors = 15;
caps->maxCombinedTextureImageUnits = 32;
// Table 6.34, implementation dependent transform feedback limits
caps->maxTransformFeedbackInterleavedComponents = 64;
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;
extensions->textureStorage = true;
}
}
}
//
// Copyright (c) 2012-2014 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.
//
// renderer11_utils.h: Conversion functions and other utility routines
// specific to the OpenGL renderer.
#ifndef LIBANGLE_RENDERER_GL_RENDERERGLUTILS_H_
#define LIBANGLE_RENDERER_GL_RENDERERGLUTILS_H_
namespace gl
{
struct Caps;
class TextureCapsMap;
struct Extensions;
}
namespace rx
{
class FunctionsGL;
namespace nativegl_gl
{
void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsMap *textureCapsMap,
gl::Extensions *extensions);
}
}
#endif // LIBANGLE_RENDERER_GL_RENDERERGLUTILS_H_
...@@ -402,6 +402,8 @@ ...@@ -402,6 +402,8 @@
'libANGLE/renderer/gl/VertexArrayGL.h', 'libANGLE/renderer/gl/VertexArrayGL.h',
'libANGLE/renderer/gl/functionsgl_enums.h', 'libANGLE/renderer/gl/functionsgl_enums.h',
'libANGLE/renderer/gl/functionsgl_typedefs.h', 'libANGLE/renderer/gl/functionsgl_typedefs.h',
'libANGLE/renderer/gl/renderergl_utils.cpp',
'libANGLE/renderer/gl/renderergl_utils.h',
], ],
'libangle_gl_wgl_sources': 'libangle_gl_wgl_sources':
[ [
......
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