Skip to content

Commit 310e097

Browse files
committed
style(web-ui): Annotate GLSL shader templates
1 parent a7a1e56 commit 310e097

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

web-ui/src/playback-engine/render/filters/bwdif.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ import { type RenderParams, registerFilter, type VideoFilter } from "./types";
6565
* it is older in cur, newer in next.
6666
*/
6767

68-
const FRAGMENT_SHADER = `#version 300 es
68+
const FRAGMENT_SHADER = /*glsl*/`#version 300 es
6969
precision highp float;
7070
7171
uniform sampler2D u_prev;

web-ui/src/playback-engine/render/filters/gl-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function createProgram(gl: WebGL2RenderingContext, vertexSource: string,
4141
* v_texCoord has (0,0) at the top-left of the video frame (texel row 0 = top video row,
4242
* so Y is flipped relative to clip space). Field parity math relies on this orientation.
4343
*/
44-
export const FULLSCREEN_VERTEX_SHADER = `#version 300 es
44+
export const FULLSCREEN_VERTEX_SHADER = /*glsl*/`#version 300 es
4545
out vec2 v_texCoord;
4646
void main() {
4747
vec2 pos = vec2(float((gl_VertexID << 1) & 2), float(gl_VertexID & 2));
@@ -57,7 +57,7 @@ void main() {
5757
* fed to a presenter directly (no source stage) needs the same Y-flip as
5858
* `FULLSCREEN_VERTEX_SHADER`. `u_flipY` selects which one applies per draw.
5959
*/
60-
export const FRAMEBUFFER_VERTEX_SHADER = `#version 300 es
60+
export const FRAMEBUFFER_VERTEX_SHADER = /*glsl*/`#version 300 es
6161
uniform bool u_flipY;
6262
out vec2 v_texCoord;
6363
void main() {

web-ui/src/playback-engine/render/fsr.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import type { Presenter } from "./presenters";
5454
* taps are accumulated through easuTap and normalized, then de-ringed by
5555
* clamping to the range of the four central texels (f,g,j,k).
5656
*/
57-
const EASU_FRAGMENT_SHADER = `#version 300 es
57+
const EASU_FRAGMENT_SHADER = /*glsl*/`#version 300 es
5858
precision highp float;
5959
precision highp int;
6060
@@ -248,7 +248,7 @@ void main() {
248248
* noise/grain), and blends the cross taps with the center by that lobe
249249
* before applying the CONTRAST/SATURATION lift.
250250
*/
251-
const RCAS_FRAGMENT_SHADER = `#version 300 es
251+
const RCAS_FRAGMENT_SHADER = /*glsl*/`#version 300 es
252252
precision highp float;
253253
precision highp int;
254254

web-ui/src/playback-engine/render/interlace-detector.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const READBACK_POOL_SIZE = 4;
7575
* Prepended to every detection fragment shader so the luma weights live in one
7676
* place.
7777
*/
78-
const GLSL_LUMA_PRELUDE = `#version 300 es
78+
const GLSL_LUMA_PRELUDE = /*glsl*/`#version 300 es
7979
precision highp float;
8080
8181
float lumaOfRgb(vec3 rgb) {
@@ -91,7 +91,7 @@ float lumaAt(sampler2D tex, vec2 uv) {
9191
* Marker pass — one fullscreen pass over the video texture.
9292
* Output: R = combed (0.0 or 1.0), G = abs luma diff vs prev frame [0,1].
9393
*/
94-
const MARKER_FRAGMENT_SHADER = `${GLSL_LUMA_PRELUDE}
94+
const MARKER_FRAGMENT_SHADER = /*glsl*/`${GLSL_LUMA_PRELUDE}
9595
uniform sampler2D u_cur;
9696
uniform sampler2D u_prev;
9797
uniform float u_height;
@@ -116,7 +116,7 @@ void main() {
116116
* Reduction pass — 2×2 box filter, reused for every step of the chain.
117117
* u_texelSize is 1/inputWidth, 1/inputHeight of the current step's input.
118118
*/
119-
const REDUCTION_FRAGMENT_SHADER = `#version 300 es
119+
const REDUCTION_FRAGMENT_SHADER = /*glsl*/`#version 300 es
120120
precision highp float;
121121
122122
uniform sampler2D u_input;
@@ -146,7 +146,7 @@ void main() {
146146
* main maps v_texCoord.y in [0,1] to half-height FBO rows, each corresponding to
147147
* an even source row (0, 2, 4, ...).
148148
*/
149-
const FIELD_ORDER_FRAGMENT_SHADER = `${GLSL_LUMA_PRELUDE}
149+
const FIELD_ORDER_FRAGMENT_SHADER = /*glsl*/`${GLSL_LUMA_PRELUDE}
150150
uniform sampler2D u_prev;
151151
uniform sampler2D u_cur;
152152
uniform float u_height;

web-ui/src/playback-engine/render/presenters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface Presenter {
3232
destroy(gl: WebGL2RenderingContext): void;
3333
}
3434

35-
const PASSTHROUGH_FRAGMENT_SHADER = `#version 300 es
35+
const PASSTHROUGH_FRAGMENT_SHADER = /*glsl*/`#version 300 es
3636
precision highp float;
3737
3838
uniform sampler2D u_input;

0 commit comments

Comments
 (0)