mirror of
https://github.com/libretro/RetroArch
synced 2025-02-22 12:40:09 +00:00
Cleanup shadres in ffmpeg core
This commit is contained in:
parent
e2cfb594f8
commit
3d47e1d813
@ -1372,29 +1372,19 @@ static void context_destroy(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void context_reset(void)
|
#include "gl_shaders/ffmpeg.glsl.vert.h"
|
||||||
{
|
|
||||||
static const char *vertex_source =
|
|
||||||
"attribute vec2 aVertex;\n"
|
|
||||||
"attribute vec2 aTexCoord;\n"
|
|
||||||
"varying vec2 vTex;\n"
|
|
||||||
"void main() { gl_Position = vec4(aVertex, 0.0, 1.0); vTex = aTexCoord; }\n";
|
|
||||||
|
|
||||||
static const char *fragment_source =
|
/* OpenGL ES note about main() - Get format as GL_RGBA/GL_UNSIGNED_BYTE.
|
||||||
"#ifdef GL_ES\n"
|
* Assume little endian, so we get ARGB -> BGRA byte order, and
|
||||||
"precision mediump float;\n"
|
* we have to swizzle to .BGR. */
|
||||||
"#endif\n"
|
#ifdef HAVE_OPENGLES
|
||||||
"varying vec2 vTex;\n"
|
#include "gl_shaders/ffmpeg_es.glsl.frag.h"
|
||||||
"uniform sampler2D sTex0;\n"
|
|
||||||
"uniform sampler2D sTex1;\n"
|
|
||||||
"uniform float uMix;\n"
|
|
||||||
#if defined(HAVE_OPENGLES)
|
|
||||||
"void main() { gl_FragColor = vec4(pow(mix(pow(texture2D(sTex0, vTex).bgr, vec3(2.2)), pow(texture2D(sTex1, vTex).bgr, vec3(2.2)), uMix), vec3(1.0 / 2.2)), 1.0); }\n";
|
|
||||||
// Get format as GL_RGBA/GL_UNSIGNED_BYTE. Assume little endian, so we get ARGB -> BGRA byte order, and we have to swizzle to .BGR.
|
|
||||||
#else
|
#else
|
||||||
"void main() { gl_FragColor = vec4(pow(mix(pow(texture2D(sTex0, vTex).rgb, vec3(2.2)), pow(texture2D(sTex1, vTex).rgb, vec3(2.2)), uMix), vec3(1.0 / 2.2)), 1.0); }\n";
|
#include "gl_shaders/ffmpeg.glsl.frag.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void context_reset(void)
|
||||||
|
{
|
||||||
static const GLfloat vertex_data[] = {
|
static const GLfloat vertex_data[] = {
|
||||||
-1, -1, 0, 0,
|
-1, -1, 0, 0,
|
||||||
1, -1, 1, 0,
|
1, -1, 1, 0,
|
||||||
|
@ -90,13 +90,13 @@ typedef struct GLFFT
|
|||||||
unsigned depth;
|
unsigned depth;
|
||||||
} glfft_t;
|
} glfft_t;
|
||||||
|
|
||||||
#include "gl_shaders/fft_heightmap.glsl.vert.h"
|
#include "../gl_shaders/fft_heightmap.glsl.vert.h"
|
||||||
#include "gl_shaders/fft_heightmap.glsl.frag.h"
|
#include "../gl_shaders/fft_heightmap.glsl.frag.h"
|
||||||
#include "gl_shaders/fft_vertex_program.glsl.vert.h"
|
#include "../gl_shaders/fft_vertex_program.glsl.vert.h"
|
||||||
#include "gl_shaders/fft_fragment_program_resolve.glsl.frag.h"
|
#include "../gl_shaders/fft_fragment_program_resolve.glsl.frag.h"
|
||||||
#include "gl_shaders/fft_fragment_program_real.glsl.frag.h"
|
#include "../gl_shaders/fft_fragment_program_real.glsl.frag.h"
|
||||||
#include "gl_shaders/fft_fragment_program_complex.glsl.frag.h"
|
#include "../gl_shaders/fft_fragment_program_complex.glsl.frag.h"
|
||||||
#include "gl_shaders/fft_fragment_program_blur.glsl.frag.h"
|
#include "../gl_shaders/fft_fragment_program_blur.glsl.frag.h"
|
||||||
|
|
||||||
static GLuint fft_compile_shader(glfft_t *fft, GLenum type, const char *source)
|
static GLuint fft_compile_shader(glfft_t *fft, GLenum type, const char *source)
|
||||||
{
|
{
|
||||||
|
13
cores/libretro-ffmpeg/gl_shaders/ffmpeg.glsl.frag.h
Normal file
13
cores/libretro-ffmpeg/gl_shaders/ffmpeg.glsl.frag.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#include "shaders_common.h"
|
||||||
|
|
||||||
|
static const char *fragment_source = GLSL(
|
||||||
|
varying vec2 vTex;
|
||||||
|
uniform sampler2D sTex0;
|
||||||
|
uniform sampler2D sTex1;
|
||||||
|
uniform float uMix;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
gl_FragColor = vec4(pow(mix(pow(texture2D(sTex0, vTex).rgb, vec3(2.2)), pow(texture2D(sTex1, vTex).rgb, vec3(2.2)), uMix), vec3(1.0 / 2.2)), 1.0);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
12
cores/libretro-ffmpeg/gl_shaders/ffmpeg.glsl.vert.h
Normal file
12
cores/libretro-ffmpeg/gl_shaders/ffmpeg.glsl.vert.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#include "shaders_common.h"
|
||||||
|
|
||||||
|
static const char *vertex_source = GLSL(
|
||||||
|
attribute vec2 aVertex;
|
||||||
|
attribute vec2 aTexCoord;
|
||||||
|
varying vec2 vTex;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
gl_Position = vec4(aVertex, 0.0, 1.0); vTex = aTexCoord;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
13
cores/libretro-ffmpeg/gl_shaders/ffmpeg_es.glsl.frag.h
Normal file
13
cores/libretro-ffmpeg/gl_shaders/ffmpeg_es.glsl.frag.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#include "shaders_common.h"
|
||||||
|
|
||||||
|
static const char *fragment_source = GLSL(
|
||||||
|
varying vec2 vTex;
|
||||||
|
uniform sampler2D sTex0;
|
||||||
|
uniform sampler2D sTex1;
|
||||||
|
uniform float uMix;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
gl_FragColor = vec4(pow(mix(pow(texture2D(sTex0, vTex).bgr, vec3(2.2)), pow(texture2D(sTex1, vTex).bgr, vec3(2.2)), uMix), vec3(1.0 / 2.2)), 1.0);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user