RetroArch
fft_fragment_program_complex.glsl.frag.h
Go to the documentation of this file.
1 #include "shaders_common.h"
2 
4  precision mediump float;
5  precision highp int;
6  precision highp usampler2D;
7  precision highp isampler2D;
8 
9  in vec2 vTex;
10  uniform usampler2D sTexture;
11  uniform usampler2D sParameterTexture;
12  uniform int uViewportOffset;
13  out uvec2 FragColor;
14 
15  vec2 compMul(vec2 a, vec2 b) { return vec2(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x); }
16 
17  void main() {
18  uvec2 params = texture(sParameterTexture, vec2(vTex.x, 0.5)).rg;
19  uvec2 coord = uvec2((params.x >> 16u) & 0xffffu, params.x & 0xffffu);
20  int ycoord = int(gl_FragCoord.y) - uViewportOffset;
21  vec2 twiddle = unpackHalf2x16(params.y);
22 
23  uvec2 x = texelFetch(sTexture, ivec2(int(coord.x), ycoord), 0).rg;
24  uvec2 y = texelFetch(sTexture, ivec2(int(coord.y), ycoord), 0).rg;
25  vec4 a = vec4(unpackHalf2x16(x.x), unpackHalf2x16(x.y));
26  vec4 b = vec4(unpackHalf2x16(y.x), unpackHalf2x16(y.y));
27  b.xy = compMul(b.xy, twiddle);
28  b.zw = compMul(b.zw, twiddle);
29 
30  vec4 res = a + b;
31  FragColor = uvec2(packHalf2x16(res.xy), packHalf2x16(res.zw));
32  }
33 );
#define GLSL_300(src)
Definition: shaders_common.h:11
GLenum const GLfloat * params
Definition: glext.h:6297
GLuint res
Definition: glext.h:10520
static const char * fft_fragment_program_complex
Definition: fft_fragment_program_complex.glsl.frag.h:3
struct passwd out
Definition: missing_libc_functions.c:51
GLenum GLint GLint * precision
Definition: glext.h:8206
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
#define gl_FragCoord
Definition: internal_interface.hpp:357
sampler2DBase< glm::ivec4 > isampler2D
Definition: sampler.hpp:95
GLenum GLuint texture
Definition: glext.h:6935
GLuint coord
Definition: glext.h:10418
GLint GLint GLint GLint GLint GLint y
Definition: glext.h:6295
GLint GLint GLint GLint GLint x
Definition: glext.h:6295
GLuint in
Definition: glext.h:10523
int main(int argc, char *argv[])
Definition: send-presence.c:197
sampler2DBase< glm::uvec4 > usampler2D
Definition: sampler.hpp:96
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6844