Hash :
a100d8f4
Author :
Date :
2018-12-29T16:39:55
ParallelCompile: add GL backend support For GL backend, at first each worker thread must have a naitve context for its own to work in. These worker contexts have to be shared from the main context, so that all shader and program objects are seen in any context. This extends backend displays to create and destroy the worker contexts. RendererGL manages and allocates them to the worker threads. ShaderImpl has a new compile method added to do the actual glCompile work in worker thread. The ProgramGL's link method is broken down by introducing the LinkEventGL class. Bug: chromium:849576 Change-Id: Idc2c51b4b6c978781ae77810e62c480acc67ebb5 Reviewed-on: https://chromium-review.googlesource.com/c/1373015 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> 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
//
// 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.
//
// ShaderGL.h: Defines the class interface for ShaderGL.
#ifndef LIBANGLE_RENDERER_GL_SHADERGL_H_
#define LIBANGLE_RENDERER_GL_SHADERGL_H_
#include "libANGLE/renderer/ShaderImpl.h"
namespace rx
{
class RendererGL;
struct WorkaroundsGL;
enum class MultiviewImplementationTypeGL;
class ShaderGL : public ShaderImpl
{
public:
ShaderGL(const gl::ShaderState &data,
GLuint shaderID,
MultiviewImplementationTypeGL multiviewImplementationType,
const std::shared_ptr<RendererGL> &renderer);
~ShaderGL() override;
void destroy() override;
// ShaderImpl implementation
ShCompileOptions prepareSourceAndReturnOptions(const gl::Context *context,
std::stringstream *sourceStream,
std::string *sourcePath) override;
void compileAsync(const std::string &source) override;
bool postTranslateCompile(gl::ShCompilerInstance *compiler, std::string *infoLog) override;
std::string getDebugInfo() const override;
GLuint getShaderID() const;
private:
void compileAndCheckShader(const char *source);
GLuint mShaderID;
MultiviewImplementationTypeGL mMultiviewImplementationType;
std::shared_ptr<RendererGL> mRenderer;
bool mFallbackToMainThread;
GLint mCompileStatus;
std::string mInfoLog;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_GL_SHADERGL_H_