1 // 2 // Copyright 2014 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 // ShaderImpl.h: Defines the abstract rx::ShaderImpl class. 8 9 #ifndef LIBANGLE_RENDERER_SHADERIMPL_H_ 10 #define LIBANGLE_RENDERER_SHADERIMPL_H_ 11 12 #include "common/angleutils.h" 13 #include "libANGLE/Shader.h" 14 15 namespace rx 16 { 17 18 class ShaderImpl : angle::NonCopyable 19 { 20 public: ShaderImpl(const gl::ShaderState & data)21 ShaderImpl(const gl::ShaderState &data) : mData(data) {} ~ShaderImpl()22 virtual ~ShaderImpl() { } 23 24 // Returns additional sh::Compile options. 25 virtual ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream, 26 std::string *sourcePath) = 0; 27 // Returns success for compiling on the driver. Returns success. 28 virtual bool postTranslateCompile(gl::Compiler *compiler, std::string *infoLog) = 0; 29 30 virtual std::string getDebugInfo() const = 0; 31 getData()32 const gl::ShaderState &getData() const { return mData; } 33 34 protected: 35 const gl::ShaderState &mData; 36 }; 37 38 } 39 40 #endif // LIBANGLE_RENDERER_SHADERIMPL_H_ 41