video_core: fix texture filters in GLES
anime4k: reset state.texture_units[0].texture_2d before filtering clang-fmtmaster
parent
7b82883767
commit
91f52c2fdb
@ -1,14 +0,0 @@
|
||||
//? #version 330
|
||||
out vec2 tex_coord;
|
||||
out vec2 input_max;
|
||||
|
||||
uniform sampler2D HOOKED;
|
||||
|
||||
const vec2 vertices[4] =
|
||||
vec2[4](vec2(-1.0, -1.0), vec2(1.0, -1.0), vec2(-1.0, 1.0), vec2(1.0, 1.0));
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(vertices[gl_VertexID], 0.0, 1.0);
|
||||
tex_coord = (vertices[gl_VertexID] + 1.0) / 2.0;
|
||||
input_max = textureSize(HOOKED, 0) * 2.0 - 1.0;
|
||||
}
|
@ -1,16 +1,18 @@
|
||||
//? #version 330
|
||||
in vec2 input_max;
|
||||
precision mediump float;
|
||||
|
||||
in vec2 tex_coord;
|
||||
|
||||
out float frag_color;
|
||||
|
||||
uniform sampler2DRect tex_input;
|
||||
uniform sampler2D tex_input;
|
||||
|
||||
void main() {
|
||||
vec2 t = texture(tex_input, min(gl_FragCoord.xy + vec2(0.0, 1.0), input_max)).xy;
|
||||
vec2 c = texture(tex_input, gl_FragCoord.xy).xy;
|
||||
vec2 b = texture(tex_input, max(gl_FragCoord.xy - vec2(0.0, 1.0), vec2(0.0))).xy;
|
||||
vec2 t = textureLodOffset(tex_input, tex_coord, 0.0, ivec2(0, 1)).xy;
|
||||
vec2 c = textureLod(tex_input, tex_coord, 0.0).xy;
|
||||
vec2 b = textureLodOffset(tex_input, tex_coord, 0.0, ivec2(0, -1)).xy;
|
||||
|
||||
vec2 grad = vec2(t.x + 2 * c.x + b.x, b.y - t.y);
|
||||
vec2 grad = vec2(t.x + 2.0 * c.x + b.x, b.y - t.y);
|
||||
|
||||
frag_color = 1 - length(grad);
|
||||
frag_color = 1.0 - length(grad);
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
//? #version 330
|
||||
out vec2 input_max;
|
||||
|
||||
uniform sampler2D tex_size;
|
||||
|
||||
const vec2 vertices[4] =
|
||||
vec2[4](vec2(-1.0, -1.0), vec2(1.0, -1.0), vec2(-1.0, 1.0), vec2(1.0, 1.0));
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(vertices[gl_VertexID], 0.0, 1.0);
|
||||
input_max = textureSize(tex_size, 0) * 2 - 1;
|
||||
}
|
Loading…
Reference in New Issue