Hash :
e703c606
Author :
Date :
2018-02-20T10:21:48
Add gl::RenderbufferState shared state helper. This shared state will be read-only visible in the RenderbufferImpl class. It mirrors existing structs for Textures, Buffers, and other classes. It allows the implementation class to have a read-only view as to the current GL state of an object. This will be useful to the Vulkan back-end, which would like to know the current Renderbuffer state before having to redefine the storage. If the current parameters match, it might not have to redefine the storage at all. The solution involves passing around the gl::RenderbufferState through various factory methods. Also name the Renderbuffer implementation pointer consistently and make it use std::unique_ptr. Bug: angleproject:2347 Change-Id: Ied6e0358e24e74a7fedbe4aea692edee909b5838 Reviewed-on: https://chromium-review.googlesource.com/922457 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-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
//
// 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.
//
// GLImplFactory.h:
// Factory interface for OpenGL ES Impl objects.
//
#ifndef LIBANGLE_RENDERER_GLIMPLFACTORY_H_
#define LIBANGLE_RENDERER_GLIMPLFACTORY_H_
#include <vector>
#include "angle_gl.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/Program.h"
#include "libANGLE/ProgramPipeline.h"
#include "libANGLE/Shader.h"
#include "libANGLE/TransformFeedback.h"
#include "libANGLE/VertexArray.h"
namespace gl
{
class ContextState;
}
namespace rx
{
class BufferImpl;
class CompilerImpl;
class ContextImpl;
class FenceNVImpl;
class SyncImpl;
class FramebufferImpl;
class PathImpl;
class ProgramImpl;
class ProgramPipelineImpl;
class QueryImpl;
class RenderbufferImpl;
class SamplerImpl;
class ShaderImpl;
class TextureImpl;
class TransformFeedbackImpl;
class VertexArrayImpl;
class GLImplFactory : angle::NonCopyable
{
public:
GLImplFactory() {}
virtual ~GLImplFactory() {}
// Shader creation
virtual CompilerImpl *createCompiler() = 0;
virtual ShaderImpl *createShader(const gl::ShaderState &data) = 0;
virtual ProgramImpl *createProgram(const gl::ProgramState &data) = 0;
// Framebuffer creation
virtual FramebufferImpl *createFramebuffer(const gl::FramebufferState &data) = 0;
// Texture creation
virtual TextureImpl *createTexture(const gl::TextureState &state) = 0;
// Renderbuffer creation
virtual RenderbufferImpl *createRenderbuffer(const gl::RenderbufferState &state) = 0;
// Buffer creation
virtual BufferImpl *createBuffer(const gl::BufferState &state) = 0;
// Vertex Array creation
virtual VertexArrayImpl *createVertexArray(const gl::VertexArrayState &data) = 0;
// Query and Fence creation
virtual QueryImpl *createQuery(GLenum type) = 0;
virtual FenceNVImpl *createFenceNV() = 0;
virtual SyncImpl *createSync() = 0;
// Transform Feedback creation
virtual TransformFeedbackImpl *createTransformFeedback(
const gl::TransformFeedbackState &state) = 0;
// Sampler object creation
virtual SamplerImpl *createSampler(const gl::SamplerState &state) = 0;
// Program Pipeline object creation
virtual ProgramPipelineImpl *createProgramPipeline(const gl::ProgramPipelineState &data) = 0;
virtual std::vector<PathImpl *> createPaths(GLsizei range) = 0;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_GLIMPLFACTORY_H_