Hash :
62fcf62a
Author :
Date :
2017-11-30T16:16:12
ES31: Add DispatchComputeIndirect suport for OpenGL backend BUG=angleproject:2270 TEST=dEQP-GLES31.functional.compute.indirect_dispatch.* Change-Id: Id062a80188b2a37f28833aaae8e6d31bac382276 Reviewed-on: https://chromium-review.googlesource.com/802763 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@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
//
// 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.h: Defines the class interface for RendererGL.
#ifndef LIBANGLE_RENDERER_GL_RENDERERGL_H_
#define LIBANGLE_RENDERER_GL_RENDERERGL_H_
#include "libANGLE/Caps.h"
#include "libANGLE/Error.h"
#include "libANGLE/Version.h"
#include "libANGLE/renderer/gl/WorkaroundsGL.h"
#include "libANGLE/renderer/gl/renderergl_utils.h"
namespace gl
{
class ContextState;
struct IndexRange;
class Path;
struct Workarounds;
}
namespace egl
{
class AttributeMap;
}
namespace sh
{
struct BlockMemberInfo;
}
namespace rx
{
class BlitGL;
class ClearMultiviewGL;
class ContextImpl;
class FunctionsGL;
class StateManagerGL;
class RendererGL : angle::NonCopyable
{
public:
RendererGL(const FunctionsGL *functions, const egl::AttributeMap &attribMap);
~RendererGL();
ContextImpl *createContext(const gl::ContextState &state);
gl::Error flush();
gl::Error finish();
gl::Error drawArrays(const gl::Context *context, GLenum mode, GLint first, GLsizei count);
gl::Error drawArraysInstanced(const gl::Context *context,
GLenum mode,
GLint first,
GLsizei count,
GLsizei instanceCount);
gl::Error drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices);
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances);
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const void *indices);
gl::Error drawArraysIndirect(const gl::Context *context, GLenum mode, const void *indirect);
gl::Error drawElementsIndirect(const gl::Context *context,
GLenum mode,
GLenum type,
const void *indirect);
// CHROMIUM_path_rendering implementation
void stencilFillPath(const gl::ContextState &state,
const gl::Path *path,
GLenum fillMode,
GLuint mask);
void stencilStrokePath(const gl::ContextState &state,
const gl::Path *path,
GLint reference,
GLuint mask);
void coverFillPath(const gl::ContextState &state, const gl::Path *path, GLenum coverMode);
void coverStrokePath(const gl::ContextState &state, const gl::Path *path, GLenum coverMode);
void stencilThenCoverFillPath(const gl::ContextState &state,
const gl::Path *path,
GLenum fillMode,
GLuint mask,
GLenum coverMode);
void stencilThenCoverStrokePath(const gl::ContextState &state,
const gl::Path *path,
GLint reference,
GLuint mask,
GLenum coverMode);
void coverFillPathInstanced(const gl::ContextState &state,
const std::vector<gl::Path *> &paths,
GLenum coverMode,
GLenum transformType,
const GLfloat *transformValues);
void coverStrokePathInstanced(const gl::ContextState &state,
const std::vector<gl::Path *> &paths,
GLenum coverMode,
GLenum transformType,
const GLfloat *transformValues);
void stencilFillPathInstanced(const gl::ContextState &state,
const std::vector<gl::Path *> &paths,
GLenum fillMode,
GLuint mask,
GLenum transformType,
const GLfloat *transformValues);
void stencilStrokePathInstanced(const gl::ContextState &state,
const std::vector<gl::Path *> &paths,
GLint reference,
GLuint mask,
GLenum transformType,
const GLfloat *transformValues);
void stencilThenCoverFillPathInstanced(const gl::ContextState &state,
const std::vector<gl::Path *> &paths,
GLenum coverMode,
GLenum fillMode,
GLuint mask,
GLenum transformType,
const GLfloat *transformValues);
void stencilThenCoverStrokePathInstanced(const gl::ContextState &state,
const std::vector<gl::Path *> &paths,
GLenum coverMode,
GLint reference,
GLuint mask,
GLenum transformType,
const GLfloat *transformValues);
GLenum getResetStatus();
// EXT_debug_marker
void insertEventMarker(GLsizei length, const char *marker);
void pushGroupMarker(GLsizei length, const char *marker);
void popGroupMarker();
// KHR_debug
void pushDebugGroup(GLenum source, GLuint id, GLsizei length, const char *message);
void popDebugGroup();
std::string getVendorString() const;
std::string getRendererDescription() const;
GLint getGPUDisjoint();
GLint64 getTimestamp();
const gl::Version &getMaxSupportedESVersion() const;
const FunctionsGL *getFunctions() const { return mFunctions; }
StateManagerGL *getStateManager() const { return mStateManager; }
const WorkaroundsGL &getWorkarounds() const { return mWorkarounds; }
BlitGL *getBlitter() const { return mBlitter; }
ClearMultiviewGL *getMultiviewClearer() const { return mMultiviewClearer; }
MultiviewImplementationTypeGL getMultiviewImplementationType() const;
const gl::Caps &getNativeCaps() const;
const gl::TextureCapsMap &getNativeTextureCaps() const;
const gl::Extensions &getNativeExtensions() const;
const gl::Limitations &getNativeLimitations() const;
void applyNativeWorkarounds(gl::Workarounds *workarounds) const;
gl::Error dispatchCompute(const gl::Context *context,
GLuint numGroupsX,
GLuint numGroupsY,
GLuint numGroupsZ);
gl::Error dispatchComputeIndirect(const gl::Context *context, GLintptr indirect);
gl::Error memoryBarrier(GLbitfield barriers);
gl::Error memoryBarrierByRegion(GLbitfield barriers);
private:
void ensureCapsInitialized() const;
void generateCaps(gl::Caps *outCaps,
gl::TextureCapsMap *outTextureCaps,
gl::Extensions *outExtensions,
gl::Limitations *outLimitations) const;
mutable gl::Version mMaxSupportedESVersion;
const FunctionsGL *mFunctions;
StateManagerGL *mStateManager;
BlitGL *mBlitter;
ClearMultiviewGL *mMultiviewClearer;
WorkaroundsGL mWorkarounds;
bool mUseDebugOutput;
mutable bool mCapsInitialized;
mutable gl::Caps mNativeCaps;
mutable gl::TextureCapsMap mNativeTextureCaps;
mutable gl::Extensions mNativeExtensions;
mutable gl::Limitations mNativeLimitations;
mutable MultiviewImplementationTypeGL mMultiviewImplementationType;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_GL_RENDERERGL_H_