Hash :
7d53c60b
Author :
Date :
2019-02-15T21:06:42
ParallelCompile: use the native extensions This enhances to use the native parallel compile extensions if available. Bug: 873724 Change-Id: I0aaed314accd75e1bfa596b322225b56d729d3a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1475234 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> 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
//
// Copyright 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.
//
// ShaderImpl.h: Defines the abstract rx::ShaderImpl class.
#ifndef LIBANGLE_RENDERER_SHADERIMPL_H_
#define LIBANGLE_RENDERER_SHADERIMPL_H_
#include <functional>
#include "common/angleutils.h"
#include "libANGLE/Shader.h"
#include "libANGLE/WorkerThread.h"
namespace gl
{
class ShCompilerInstance;
} // namespace gl
namespace rx
{
using UpdateShaderStateFunctor = std::function<void(bool compiled, ShHandle handle)>;
class WaitableCompileEvent : public angle::WaitableEvent
{
public:
WaitableCompileEvent(std::shared_ptr<angle::WaitableEvent> waitableEvent);
~WaitableCompileEvent() override;
void wait() override;
bool isReady() override;
virtual bool getResult() = 0;
virtual bool postTranslate(std::string *infoLog) = 0;
const std::string &getInfoLog();
protected:
std::shared_ptr<angle::WaitableEvent> mWaitableEvent;
std::string mInfoLog;
};
class ShaderImpl : angle::NonCopyable
{
public:
ShaderImpl(const gl::ShaderState &data) : mData(data) {}
virtual ~ShaderImpl() {}
virtual void destroy() {}
virtual std::shared_ptr<WaitableCompileEvent> compile(const gl::Context *context,
gl::ShCompilerInstance *compilerInstance,
ShCompileOptions options) = 0;
virtual std::string getDebugInfo() const = 0;
const gl::ShaderState &getData() const { return mData; }
protected:
std::shared_ptr<WaitableCompileEvent> compileImpl(const gl::Context *context,
gl::ShCompilerInstance *compilerInstance,
const std::string &source,
ShCompileOptions compileOptions);
const gl::ShaderState &mData;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_SHADERIMPL_H_