From 14e9028e333292a1491b4ffeeb63764271b6b137 Mon Sep 17 00:00:00 2001 From: Stuart Carnie Date: Sun, 15 Jul 2018 13:53:44 -0700 Subject: [PATCH] fix(cross): rename identifiers for SPIRV-Cross compatibility --- retro/shaders/aann.slang | 12 ++++++------ scalefx/shaders/old/scalefx-pass1.slang | 4 ++-- scalefx/shaders/scalefx-pass2.slang | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/retro/shaders/aann.slang b/retro/shaders/aann.slang index c429e6e..d925bca 100644 --- a/retro/shaders/aann.slang +++ b/retro/shaders/aann.slang @@ -9,7 +9,7 @@ layout(push_constant) uniform Push float NOGAMMA; float MASKING; float BILINEAR; -} param; +} params; layout(std140, set = 0, binding = 0) uniform UBO { @@ -76,7 +76,7 @@ vec3 linear2srgb(vec3 linear) { #define BS 0.0722 vec3 rgb2vry(vec3 rgb) { - if (param.NOGAMMA == 1.0) + if (params.NOGAMMA == 1.0) return rgb; // https://en.wikipedia.org/wiki/Opponent_process @@ -94,7 +94,7 @@ vec3 rgb2vry(vec3 rgb) { return vry; } vec3 vry2rgb(vec3 vry) { - if (param.NOGAMMA == 1.0) + if (params.NOGAMMA == 1.0) return vry; // Magic. @@ -110,7 +110,7 @@ vec3 vry2rgb(vec3 vry) { } vec3 vry_interp(vec3 first, vec3 second, float frac) { - if (param.NOGAMMA == 1.0) + if (params.NOGAMMA == 1.0) return first*NOT(frac) + second*YES(frac); // Because the chroma values were generated on linear light, but the luma must be interpolated in perceptual gamma (3) @@ -131,7 +131,7 @@ vec3 vry_interp(vec3 first, vec3 second, float frac) { } vec3 percent(float ssize, float tsize, float coord) { - if (param.BILINEAR == 1.0) + if (params.BILINEAR == 1.0) tsize = ssize; float minfull = (coord*tsize - 0.5)/tsize*ssize; @@ -153,7 +153,7 @@ vec3 percent(float ssize, float tsize, float coord) { void main() { vec2 viewportSize = global.OutputSize.xy; vec2 gameCoord = vTexCoord; - if (param.MASKING == 1.0) { + if (params.MASKING == 1.0) { float hscale = viewportSize.x/global.SourceSize.x; float vscale = viewportSize.y/global.SourceSize.y; diff --git a/scalefx/shaders/old/scalefx-pass1.slang b/scalefx/shaders/old/scalefx-pass1.slang index dc3c722..6fabc22 100644 --- a/scalefx/shaders/old/scalefx-pass1.slang +++ b/scalefx/shaders/old/scalefx-pass1.slang @@ -193,7 +193,7 @@ void main() vec4 hori = vec4(low.x < max(D.w, A.w), low.x < max(E.w, B.w), low.z < max(E.w, H.w), low.z < max(D.w, G.w)) * clr; // horizontal edges vec4 vert = vec4(low.w < max(E.y, D.y), low.y < max(E.y, F.y), low.y < max(H.y, I.y), low.w < max(H.y, G.y)) * clr; // vertical edges - vec4 or = vec4(A.w < D.y, B.w <= F.y, H.w < I.y, G.w <= G.y); // orientation + vec4 orie = vec4(A.w < D.y, B.w <= F.y, H.w < I.y, G.w <= G.y); // orientation - FragColor = (res + 2.0 * hori + 4.0 * vert + 8.0 * or) / 15.0; + FragColor = (res + 2.0 * hori + 4.0 * vert + 8.0 * orie) / 15.0; } diff --git a/scalefx/shaders/scalefx-pass2.slang b/scalefx/shaders/scalefx-pass2.slang index bf13103..d8dbbbd 100644 --- a/scalefx/shaders/scalefx-pass2.slang +++ b/scalefx/shaders/scalefx-pass2.slang @@ -151,9 +151,9 @@ void main() vec4 h = vec4(min(D.w, A.w), min(E.w, B.w), min(E.w, H.w), min(D.w, G.w)); vec4 v = vec4(min(E.y, D.y), min(E.y, F.y), min(H.y, I.y), min(H.y, G.y)); - vec4 or = GE(h + vec4(D.w, E.w, E.w, D.w), v + vec4(E.y, E.y, H.y, H.y)); // orientation - vec4 hori = LE(h, v) * clr; // horizontal edges - vec4 vert = GE(h, v) * clr; // vertical edges + vec4 orien = GE(h + vec4(D.w, E.w, E.w, D.w), v + vec4(E.y, E.y, H.y, H.y)); // orientation + vec4 hori = LE(h, v) * clr; // horizontal edges + vec4 vert = GE(h, v) * clr; // vertical edges - FragColor = (res + 2 * hori + 4 * vert + 8 * or) / 15; + FragColor = (res + 2 * hori + 4 * vert + 8 * orien) / 15; }