2 // Copyright (c) 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.
7 #ifndef SAMPLE_UTIL_SHADER_UTILS_H
8 #define SAMPLE_UTIL_SHADER_UTILS_H
11 #include <GLES3/gl31.h>
12 #include <GLES3/gl3.h>
13 #include <GLES2/gl2.h>
14 #include <GLES2/gl2ext.h>
16 #include <EGL/eglext.h>
21 ANGLE_EXPORT GLuint CompileShader(GLenum type, const std::string &source);
22 ANGLE_EXPORT GLuint CompileShaderFromFile(GLenum type, const std::string &sourcePath);
25 CompileProgramWithTransformFeedback(const std::string &vsSource,
26 const std::string &fsSource,
27 const std::vector<std::string> &transformFeedbackVaryings,
30 CompileProgramWithGSAndTransformFeedback(const std::string &vsSource,
31 const std::string &gsSource,
32 const std::string &fsSource,
33 const std::vector<std::string> &transformFeedbackVaryings,
35 ANGLE_EXPORT GLuint CompileProgram(const std::string &vsSource, const std::string &fsSource);
36 ANGLE_EXPORT GLuint CompileProgramWithGS(const std::string &vsSource,
37 const std::string &gsSource,
38 const std::string &fsSource);
39 ANGLE_EXPORT GLuint CompileProgramFromFiles(const std::string &vsPath, const std::string &fsPath);
40 ANGLE_EXPORT GLuint CompileComputeProgram(const std::string &csSource,
41 bool outputErrorMessages = true);
42 ANGLE_EXPORT bool LinkAttachedProgram(GLuint program);
44 ANGLE_EXPORT GLuint LoadBinaryProgramOES(const std::vector<uint8_t> &binary, GLenum binaryFormat);
45 ANGLE_EXPORT GLuint LoadBinaryProgramES3(const std::vector<uint8_t> &binary, GLenum binaryFormat);
47 #endif // SAMPLE_UTIL_SHADER_UTILS_H