Edit

kc3-lang/angle/src/libANGLE/renderer/ShaderImpl.h

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2020-09-20 10:51:00
    Hash : d13c9e78
    Message : Rename ShaderImpl::mData to mState. Makes it consistent with the other back-end types. Bug: angleproject:5076 Change-Id: I7a54dd4a0a54e6dc05e257b7b2ac1ec21ceea700 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2420748 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>

  • src/libANGLE/renderer/ShaderImpl.h
  • //
    // 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 &state) : mState(state) {}
        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 &getState() const { return mState; }
    
      protected:
        std::shared_ptr<WaitableCompileEvent> compileImpl(const gl::Context *context,
                                                          gl::ShCompilerInstance *compilerInstance,
                                                          const std::string &source,
                                                          ShCompileOptions compileOptions);
    
        const gl::ShaderState &mState;
    };
    
    }  // namespace rx
    
    #endif  // LIBANGLE_RENDERER_SHADERIMPL_H_