Hash :
56cf9af2
Author :
Date :
2015-02-17T10:16:49
Add a FunctionsGL class for loading GL entry points. BUG=angle:879 Change-Id: I35384f078d2ed86a6c72cc243753b56bc58617b0 Reviewed-on: https://chromium-review.googlesource.com/250390 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
//
// Copyright 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.
//
// RendererGL.cpp: Implements the class methods for RendererGL.
#include "libANGLE/renderer/gl/RendererGL.h"
#include "common/debug.h"
#include "libANGLE/renderer/gl/BufferGL.h"
#include "libANGLE/renderer/gl/CompilerGL.h"
#include "libANGLE/renderer/gl/DefaultAttachmentGL.h"
#include "libANGLE/renderer/gl/FenceNVGL.h"
#include "libANGLE/renderer/gl/FenceSyncGL.h"
#include "libANGLE/renderer/gl/FramebufferGL.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
#include "libANGLE/renderer/gl/ProgramGL.h"
#include "libANGLE/renderer/gl/QueryGL.h"
#include "libANGLE/renderer/gl/RenderbufferGL.h"
#include "libANGLE/renderer/gl/ShaderGL.h"
#include "libANGLE/renderer/gl/TextureGL.h"
#include "libANGLE/renderer/gl/TransformFeedbackGL.h"
#include "libANGLE/renderer/gl/VertexArrayGL.h"
namespace rx
{
RendererGL::RendererGL(const FunctionsGL *functions)
: Renderer(),
mFunctions(functions)
{
ASSERT(mFunctions);
}
RendererGL::~RendererGL()
{}
gl::Error RendererGL::flush()
{
UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION);
}
gl::Error RendererGL::finish()
{
UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION);
}
gl::Error RendererGL::drawArrays(const gl::Data &data, GLenum mode,
GLint first, GLsizei count, GLsizei instances)
{
UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION);
}
gl::Error RendererGL::drawElements(const gl::Data &data, GLenum mode, GLsizei count, GLenum type,
const GLvoid *indices, GLsizei instances,
const RangeUI &indexRange)
{
UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION);
}
CompilerImpl *RendererGL::createCompiler(const gl::Data &data)
{
return new CompilerGL();
}
ShaderImpl *RendererGL::createShader(GLenum type)
{
return new ShaderGL();
}
ProgramImpl *RendererGL::createProgram()
{
return new ProgramGL();
}
DefaultAttachmentImpl *RendererGL::createDefaultAttachment(GLenum type, egl::Surface *surface)
{
return new DefaultAttachmentGL();
}
FramebufferImpl *RendererGL::createFramebuffer()
{
return new FramebufferGL();
}
TextureImpl *RendererGL::createTexture(GLenum target)
{
return new TextureGL();
}
RenderbufferImpl *RendererGL::createRenderbuffer()
{
return new RenderbufferGL();
}
BufferImpl *RendererGL::createBuffer()
{
return new BufferGL();
}
VertexArrayImpl *RendererGL::createVertexArray()
{
return new VertexArrayGL();
}
QueryImpl *RendererGL::createQuery(GLenum type)
{
return new QueryGL(type);
}
FenceNVImpl *RendererGL::createFenceNV()
{
return new FenceNVGL();
}
FenceSyncImpl *RendererGL::createFenceSync()
{
return new FenceSyncGL();
}
TransformFeedbackImpl *RendererGL::createTransformFeedback()
{
return new TransformFeedbackGL();
}
void RendererGL::notifyDeviceLost()
{
UNIMPLEMENTED();
}
bool RendererGL::isDeviceLost() const
{
UNIMPLEMENTED();
return bool();
}
bool RendererGL::testDeviceLost()
{
UNIMPLEMENTED();
return bool();
}
bool RendererGL::testDeviceResettable()
{
UNIMPLEMENTED();
return bool();
}
VendorID RendererGL::getVendorId() const
{
UNIMPLEMENTED();
return VendorID();
}
std::string RendererGL::getVendorString() const
{
UNIMPLEMENTED();
return std::string();
}
std::string RendererGL::getRendererDescription() const
{
UNIMPLEMENTED();
return std::string();
}
void RendererGL::generateCaps(gl::Caps *outCaps, gl::TextureCapsMap* outTextureCaps, gl::Extensions *outExtensions) const
{
// Set some minimum GLES2 caps, TODO: query for real GL caps
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 workarounds;
return workarounds;
}
}