diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /gfx/angle/checkout/src/libANGLE/renderer/ShaderImpl.h | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/angle/checkout/src/libANGLE/renderer/ShaderImpl.h')
-rw-r--r-- | gfx/angle/checkout/src/libANGLE/renderer/ShaderImpl.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/gfx/angle/checkout/src/libANGLE/renderer/ShaderImpl.h b/gfx/angle/checkout/src/libANGLE/renderer/ShaderImpl.h new file mode 100644 index 0000000000..7ec7ae7681 --- /dev/null +++ b/gfx/angle/checkout/src/libANGLE/renderer/ShaderImpl.h @@ -0,0 +1,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_ |