Upload upstream chromium 67.0.3396
[platform/framework/web/chromium-efl.git] / third_party / angle / util / shader_utils.h
1 //
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.
5 //
6
7 #ifndef SAMPLE_UTIL_SHADER_UTILS_H
8 #define SAMPLE_UTIL_SHADER_UTILS_H
9
10 #include <export.h>
11 #include <GLES3/gl31.h>
12 #include <GLES3/gl3.h>
13 #include <GLES2/gl2.h>
14 #include <GLES2/gl2ext.h>
15 #include <EGL/egl.h>
16 #include <EGL/eglext.h>
17
18 #include <string>
19 #include <vector>
20
21 ANGLE_EXPORT GLuint CompileShader(GLenum type, const std::string &source);
22 ANGLE_EXPORT GLuint CompileShaderFromFile(GLenum type, const std::string &sourcePath);
23
24 ANGLE_EXPORT GLuint
25 CompileProgramWithTransformFeedback(const std::string &vsSource,
26                                     const std::string &fsSource,
27                                     const std::vector<std::string> &transformFeedbackVaryings,
28                                     GLenum bufferMode);
29 ANGLE_EXPORT GLuint
30 CompileProgramWithGSAndTransformFeedback(const std::string &vsSource,
31                                          const std::string &gsSource,
32                                          const std::string &fsSource,
33                                          const std::vector<std::string> &transformFeedbackVaryings,
34                                          GLenum bufferMode);
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);
43
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);
46
47 #endif // SAMPLE_UTIL_SHADER_UTILS_H