// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. #pragma once #if COMPILE_WITH_OGL_SHADER_COMPILER #include "Engine/ShadersCompilation/ShaderCompiler.h" #include "IncludeXShaderCompiler.h" #include "../IncludeOpenGLHeaders.h" #include "Engine/Serialization/MemoryWriteStream.h" #include /// /// Implementation of shaders compiler for OpenGL and OpenGL ES platforms /// class ShaderCompilerOGL : public ShaderCompiler { private: ShaderProfile _profile; ShaderCompilationContext* _context; Array _globalMacros; Array _macros; Array _constantBuffers; Array _dataCompressedCache; Xsc::ShaderInput _inputDesc; Xsc::ShaderOutput _outputDesc; std::stringstream _sourceStream; public: /// /// Initializes a new instance of the class. /// /// The profile. ShaderCompilerOGL(ShaderProfile profile); private: bool ProcessShader(Xsc::Reflection::ReflectionData& data, uint32& cbMask, uint32& srMask, uint32& uaMask) protected: // [ShaderCompiler] bool CompileShader(ShaderFunctionMeta& meta, WritePermutationData customDataWrite = nullptr) override; bool OnCompileBegin() override; }; #endif