blob: 7c8dd2ee29fa06e1ff036eadfe6093240a9a7d5b [file] [log] [blame]
Geoff Lang49be2ad2014-02-28 13:05:51 -05001//
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
Yuly Novikove3352f92016-08-12 20:40:14 -040010#include <export.h>
Martin Radev4c4c8e72016-08-04 12:25:34 +030011#include <GLES3/gl31.h>
Geoff Lang49be2ad2014-02-28 13:05:51 -050012#include <GLES3/gl3.h>
Geoff Lang49be2ad2014-02-28 13:05:51 -050013#include <GLES2/gl2.h>
14#include <GLES2/gl2ext.h>
15#include <EGL/egl.h>
16#include <EGL/eglext.h>
17
18#include <string>
Jamie Madillca03b352015-09-02 12:38:13 -040019#include <vector>
Geoff Lang49be2ad2014-02-28 13:05:51 -050020
Yuly Novikove3352f92016-08-12 20:40:14 -040021ANGLE_EXPORT GLuint CompileShader(GLenum type, const std::string &source);
22ANGLE_EXPORT GLuint CompileShaderFromFile(GLenum type, const std::string &sourcePath);
Geoff Lang712e3f42014-03-03 11:14:15 -050023
Yuly Novikove3352f92016-08-12 20:40:14 -040024ANGLE_EXPORT GLuint
25CompileProgramWithTransformFeedback(const std::string &vsSource,
26 const std::string &fsSource,
27 const std::vector<std::string> &transformFeedbackVaryings,
28 GLenum bufferMode);
29ANGLE_EXPORT GLuint CompileProgram(const std::string &vsSource, const std::string &fsSource);
30ANGLE_EXPORT GLuint CompileProgramFromFiles(const std::string &vsPath, const std::string &fsPath);
31ANGLE_EXPORT GLuint CompileComputeProgram(const std::string &csSource,
32 bool outputErrorMessages = true);
Jamie Madill401345e2017-08-21 10:52:40 -040033ANGLE_EXPORT bool LinkAttachedProgram(GLuint program);
Yuly Novikove3352f92016-08-12 20:40:14 -040034
Jamie Madilla7d12dc2016-12-13 15:08:19 -050035ANGLE_EXPORT GLuint LoadBinaryProgramOES(const std::vector<uint8_t> &binary, GLenum binaryFormat);
36ANGLE_EXPORT GLuint LoadBinaryProgramES3(const std::vector<uint8_t> &binary, GLenum binaryFormat);
37
Geoff Lang49be2ad2014-02-28 13:05:51 -050038#endif // SAMPLE_UTIL_SHADER_UTILS_H