2014-08-21 09:27:53 +02:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
2014-12-17 06:38:14 +01:00
|
|
|
// Licensed under GPLv2 or any later version
|
2014-08-21 09:27:53 +02:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-04-09 23:24:37 +02:00
|
|
|
#include <vector>
|
2015-08-30 08:37:42 +02:00
|
|
|
#include <glad/glad.h>
|
2014-08-21 09:27:53 +02:00
|
|
|
|
2018-11-17 08:29:10 +01:00
|
|
|
namespace OpenGL {
|
2014-08-21 09:27:53 +02:00
|
|
|
|
2019-01-30 21:10:33 +01:00
|
|
|
// High precision may or may not supported in GLES3. If it isn't, use medium precision instead.
|
|
|
|
static constexpr char fragment_shader_precision_OES[] = R"(
|
|
|
|
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
|
|
precision highp float;
|
|
|
|
precision highp samplerBuffer;
|
|
|
|
#else
|
|
|
|
precision mediump float;
|
|
|
|
precision mediump samplerBuffer;
|
|
|
|
#endif // GL_FRAGMENT_PRECISION_HIGH
|
|
|
|
)";
|
|
|
|
|
2015-10-07 00:10:32 +02:00
|
|
|
/**
|
2018-04-09 23:24:37 +02:00
|
|
|
* Utility function to create and compile an OpenGL GLSL shader
|
|
|
|
* @param source String of the GLSL shader program
|
|
|
|
* @param type Type of the shader (GL_VERTEX_SHADER, GL_GEOMETRY_SHADER or GL_FRAGMENT_SHADER)
|
2015-10-07 00:10:32 +02:00
|
|
|
*/
|
2018-04-09 23:24:37 +02:00
|
|
|
GLuint LoadShader(const char* source, GLenum type);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Utility function to create and link an OpenGL GLSL shader program
|
|
|
|
* @param separable_program whether to create a separable program
|
|
|
|
* @param shaders ID of shaders to attach to the program
|
|
|
|
* @returns Handle of the newly created OpenGL program object
|
|
|
|
*/
|
|
|
|
GLuint LoadProgram(bool separable_program, const std::vector<GLuint>& shaders);
|
2014-08-21 09:27:53 +02:00
|
|
|
|
2018-11-17 08:29:10 +01:00
|
|
|
} // namespace OpenGL
|