diff options
author | Benjamin Otte <otte@redhat.com> | 2017-10-24 01:20:50 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2017-10-24 01:29:28 +0200 |
commit | e4dbff6bfcb5d7b75afe085b9d990af08074917d (patch) | |
tree | c9b8e7d49c456c4b76d87731e1d1e1e988693052 /gsk | |
parent | 4f6cee3ee38b2f9c766d2aca942dec401238d41d (diff) | |
download | gtk+-e4dbff6bfcb5d7b75afe085b9d990af08074917d.tar.gz |
vulkan: Delete unused shaders
These have been renamed to .frag/.vert, apparently the originals weren't
deleted.
Diffstat (limited to 'gsk')
-rw-r--r-- | gsk/resources/vulkan/blur.frag.glsl | 13 | ||||
-rw-r--r-- | gsk/resources/vulkan/blur.vert.glsl | 30 | ||||
-rw-r--r-- | gsk/resources/vulkan/border.frag.glsl | 23 | ||||
-rw-r--r-- | gsk/resources/vulkan/border.vert.glsl | 101 | ||||
-rw-r--r-- | gsk/resources/vulkan/color-matrix.frag.glsl | 31 | ||||
-rw-r--r-- | gsk/resources/vulkan/color-matrix.vert.glsl | 32 | ||||
-rw-r--r-- | gsk/resources/vulkan/color.frag.glsl | 10 | ||||
-rw-r--r-- | gsk/resources/vulkan/color.vert.glsl | 25 | ||||
-rw-r--r-- | gsk/resources/vulkan/linear.frag.glsl | 33 | ||||
-rw-r--r-- | gsk/resources/vulkan/linear.vert.glsl | 75 | ||||
-rw-r--r-- | gsk/resources/vulkan/texture.frag.glsl | 12 | ||||
-rw-r--r-- | gsk/resources/vulkan/texture.vert.glsl | 26 |
12 files changed, 0 insertions, 411 deletions
diff --git a/gsk/resources/vulkan/blur.frag.glsl b/gsk/resources/vulkan/blur.frag.glsl deleted file mode 100644 index 528db202b0..0000000000 --- a/gsk/resources/vulkan/blur.frag.glsl +++ /dev/null @@ -1,13 +0,0 @@ -#version 420 core - -#include "clip.frag.glsl" - -layout(location = 0) in vec2 inPos; -layout(location = 1) in float inRadius; - -layout(location = 0) out vec4 color; - -void main() -{ - color = clip (inPos, vec4(1, 0, 0, 0)); -} diff --git a/gsk/resources/vulkan/blur.vert.glsl b/gsk/resources/vulkan/blur.vert.glsl deleted file mode 100644 index f50ca37980..0000000000 --- a/gsk/resources/vulkan/blur.vert.glsl +++ /dev/null @@ -1,30 +0,0 @@ -#version 420 core - -#include "clip.vert.glsl" - -layout(location = 0) in vec4 inRect; -layout(location = 1) in float inRadius; - -layout(location = 0) out vec2 outPos; -layout(location = 1) out flat float outRadius; - -out gl_PerVertex { - vec4 gl_Position; -}; - -vec2 offsets[6] = { vec2(0.0, 0.0), - vec2(1.0, 0.0), - vec2(0.0, 1.0), - vec2(0.0, 1.0), - vec2(1.0, 0.0), - vec2(1.0, 1.0) }; - -void main() { - vec4 rect = clip (inRect); - - vec2 pos = rect.xy + rect.zw * offsets[gl_VertexIndex]; - gl_Position = push.mvp * vec4 (pos, 0.0, 1.0); - outPos = pos; - outRadius = inRadius; -} - diff --git a/gsk/resources/vulkan/border.frag.glsl b/gsk/resources/vulkan/border.frag.glsl deleted file mode 100644 index 5f9d7090a1..0000000000 --- a/gsk/resources/vulkan/border.frag.glsl +++ /dev/null @@ -1,23 +0,0 @@ -#version 420 core - -#include "rounded-rect.glsl" - -layout(location = 0) in vec2 inPos; -layout(location = 1) in flat vec4 inColor; -layout(location = 2) in flat vec4 inRect; -layout(location = 3) in flat vec4 inCornerWidths; -layout(location = 4) in flat vec4 inCornerHeights; -layout(location = 5) in flat vec4 inBorderWidths; - -layout(location = 0) out vec4 color; - -void main() -{ - RoundedRect routside = RoundedRect (vec4(inRect.xy, inRect.xy + inRect.zw), inCornerWidths, inCornerHeights); - RoundedRect rinside = rounded_rect_shrink (routside, inBorderWidths); - - float alpha = clamp (rounded_rect_coverage (routside, inPos) - - rounded_rect_coverage (rinside, inPos), - 0.0, 1.0); - color = inColor * alpha; -} diff --git a/gsk/resources/vulkan/border.vert.glsl b/gsk/resources/vulkan/border.vert.glsl deleted file mode 100644 index 744f5000ef..0000000000 --- a/gsk/resources/vulkan/border.vert.glsl +++ /dev/null @@ -1,101 +0,0 @@ -#version 420 core - -#include "constants.glsl" - -layout(location = 0) in vec4 inRect; -layout(location = 1) in vec4 inCornerWidths; -layout(location = 2) in vec4 inCornerHeights; -layout(location = 3) in vec4 inBorderWidths; -layout(location = 4) in mat4 inBorderColors; - -layout(location = 0) out vec2 outPos; -layout(location = 1) out flat vec4 outColor; -layout(location = 2) out flat vec4 outRect; -layout(location = 3) out flat vec4 outCornerWidths; -layout(location = 4) out flat vec4 outCornerHeights; -layout(location = 5) out flat vec4 outBorderWidths; - -out gl_PerVertex { - vec4 gl_Position; -}; - -vec2 offsets[6] = { vec2(0.0, 0.0), - vec2(1.0, 0.0), - vec2(0.0, 1.0), - vec2(1.0, 1.0), - vec2(0.0, 1.0), - vec2(1.0, 0.0) }; - -#define TOP 0 -#define RIGHT 1 -#define BOTTOM 2 -#define LEFT 3 - -#define TOP_LEFT 0 -#define TOP_RIGHT 1 -#define BOTTOM_RIGHT 2 -#define BOTTOM_LEFT 3 - -#define SLICE_TOP_LEFT 0 -#define SLICE_TOP 1 -#define SLICE_TOP_RIGHT 2 -#define SLICE_RIGHT 3 -#define SLICE_BOTTOM_RIGHT 4 -#define SLICE_BOTTOM 5 -#define SLICE_BOTTOM_LEFT 6 -#define SLICE_LEFT 7 - -void main() { - int slice_index = gl_VertexIndex / 6; - int vert_index = gl_VertexIndex % 6; - - vec4 corner_widths = max (inCornerWidths, inBorderWidths.wyyw); - vec4 corner_heights = max (inCornerHeights, inBorderWidths.xxzz); - - vec4 rect; - - switch (slice_index) - { - case SLICE_TOP_LEFT: - rect = vec4(inRect.xy, corner_widths[TOP_LEFT], corner_heights[TOP_LEFT]); - vert_index = (vert_index + 3) % 6; - break; - case SLICE_TOP: - rect = vec4(inRect.x + corner_widths[TOP_LEFT], inRect.y, inRect.z - corner_widths[TOP_LEFT] - corner_widths[TOP_RIGHT], inBorderWidths[TOP]); - outColor = inBorderColors[TOP]; - break; - case SLICE_TOP_RIGHT: - rect = vec4(inRect.x + inRect.z - corner_widths[TOP_RIGHT], inRect.y, corner_widths[TOP_RIGHT], corner_heights[TOP_RIGHT]); - break; - case SLICE_RIGHT: - rect = vec4(inRect.x + inRect.z - inBorderWidths[RIGHT], inRect.y + corner_heights[TOP_RIGHT], inBorderWidths[RIGHT], inRect.w - corner_heights[TOP_RIGHT] - corner_heights[BOTTOM_RIGHT]); - outColor = inBorderColors[RIGHT]; - break; - case SLICE_BOTTOM_RIGHT: - rect = vec4(inRect.x + inRect.z - corner_widths[BOTTOM_RIGHT], inRect.y + inRect.w - corner_heights[BOTTOM_RIGHT], corner_widths[BOTTOM_RIGHT], corner_heights[BOTTOM_RIGHT]); - break; - case SLICE_BOTTOM: - rect = vec4(inRect.x + corner_widths[BOTTOM_LEFT], inRect.y + inRect.w - inBorderWidths[BOTTOM], inRect.z - corner_widths[BOTTOM_LEFT] - corner_widths[BOTTOM_RIGHT], inBorderWidths[BOTTOM]); - break; - case SLICE_BOTTOM_LEFT: - rect = vec4(inRect.x, inRect.y + inRect.w - corner_heights[BOTTOM_LEFT], corner_widths[BOTTOM_LEFT], corner_heights[BOTTOM_LEFT]); - vert_index = (vert_index + 3) % 6; - break; - case SLICE_LEFT: - rect = vec4(inRect.x, inRect.y + corner_heights[TOP_LEFT], inBorderWidths[LEFT], inRect.w - corner_heights[TOP_LEFT] - corner_heights[BOTTOM_LEFT]); - break; - } - - vec2 pos; - if ((slice_index % 4) != 0 || (vert_index % 3) != 2) - pos = rect.xy + rect.zw * offsets[vert_index]; - else - pos = rect.xy + rect.zw * vec2(1.0 - offsets[vert_index].x, offsets[vert_index].y); - gl_Position = push.mvp * vec4 (pos, 0.0, 1.0); - outColor = inBorderColors[((gl_VertexIndex / 3 + 15) / 4) % 4]; - outPos = pos; - outRect = inRect; - outCornerWidths = inCornerWidths; - outCornerHeights = inCornerHeights; - outBorderWidths = inBorderWidths; -} diff --git a/gsk/resources/vulkan/color-matrix.frag.glsl b/gsk/resources/vulkan/color-matrix.frag.glsl deleted file mode 100644 index 21a324e780..0000000000 --- a/gsk/resources/vulkan/color-matrix.frag.glsl +++ /dev/null @@ -1,31 +0,0 @@ -#version 420 core - -layout(location = 0) in vec2 inTexCoord; -layout(location = 1) in flat mat4 inColorMatrix; -layout(location = 5) in flat vec4 inColorOffset; - -layout(set = 0, binding = 0) uniform sampler2D inTexture; - -layout(location = 0) out vec4 color; - -vec4 -color_matrix (vec4 color, mat4 color_matrix, vec4 color_offset) -{ - /* unpremultiply */ - if (color.a != 0.0) - color.rgb /= color.a; - - color = color_matrix * color + color_offset; - color = clamp(color, 0.0, 1.0); - - /* premultiply */ - if (color.a != 0.0) - color.rgb *= color.a; - - return color; -} - -void main() -{ - color = color_matrix (texture (inTexture, inTexCoord), inColorMatrix, inColorOffset); -} diff --git a/gsk/resources/vulkan/color-matrix.vert.glsl b/gsk/resources/vulkan/color-matrix.vert.glsl deleted file mode 100644 index ac1ccc0a54..0000000000 --- a/gsk/resources/vulkan/color-matrix.vert.glsl +++ /dev/null @@ -1,32 +0,0 @@ -#version 420 core - -#include "constants.glsl" - -layout(location = 0) in vec4 inRect; -layout(location = 1) in vec4 inTexRect; -layout(location = 2) in mat4 inColorMatrix; -layout(location = 6) in vec4 inColorOffset; - -layout(location = 0) out vec2 outTexCoord; -layout(location = 1) out flat mat4 outColorMatrix; -layout(location = 5) out flat vec4 outColorOffset; - -out gl_PerVertex { - vec4 gl_Position; -}; - -vec2 offsets[6] = { vec2(0.0, 0.0), - vec2(1.0, 0.0), - vec2(0.0, 1.0), - vec2(0.0, 1.0), - vec2(1.0, 0.0), - vec2(1.0, 1.0) }; - -void main() { - vec2 pos = inRect.xy + inRect.zw * offsets[gl_VertexIndex]; - gl_Position = push.mvp * vec4 (pos, 0.0, 1.0); - - outTexCoord = inTexRect.xy + inTexRect.zw * offsets[gl_VertexIndex]; - outColorMatrix = inColorMatrix; - outColorOffset = inColorOffset; -} diff --git a/gsk/resources/vulkan/color.frag.glsl b/gsk/resources/vulkan/color.frag.glsl deleted file mode 100644 index 218ee854eb..0000000000 --- a/gsk/resources/vulkan/color.frag.glsl +++ /dev/null @@ -1,10 +0,0 @@ -#version 420 core - -layout(location = 0) in vec4 inColor; - -layout(location = 0) out vec4 color; - -void main() -{ - color = vec4(inColor.rgb * inColor.a, inColor.a); -} diff --git a/gsk/resources/vulkan/color.vert.glsl b/gsk/resources/vulkan/color.vert.glsl deleted file mode 100644 index ab71cdacb6..0000000000 --- a/gsk/resources/vulkan/color.vert.glsl +++ /dev/null @@ -1,25 +0,0 @@ -#version 420 core - -#include "constants.glsl" - -layout(location = 0) in vec4 inRect; -layout(location = 1) in vec4 inColor; - -layout(location = 0) out vec4 outColor; - -out gl_PerVertex { - vec4 gl_Position; -}; - -vec2 offsets[6] = { vec2(0.0, 0.0), - vec2(1.0, 0.0), - vec2(0.0, 1.0), - vec2(0.0, 1.0), - vec2(1.0, 0.0), - vec2(1.0, 1.0) }; - -void main() { - vec2 pos = inRect.xy + inRect.zw * offsets[gl_VertexIndex]; - gl_Position = push.mvp * vec4 (pos, 0.0, 1.0); - outColor = inColor; -} diff --git a/gsk/resources/vulkan/linear.frag.glsl b/gsk/resources/vulkan/linear.frag.glsl deleted file mode 100644 index 1d03553705..0000000000 --- a/gsk/resources/vulkan/linear.frag.glsl +++ /dev/null @@ -1,33 +0,0 @@ -#version 420 core - -struct ColorStop { - float offset; - vec4 color; -}; - -layout(location = 0) in float inGradientPos; -layout(location = 1) in flat int inRepeating; -layout(location = 2) in flat int inStopCount; -layout(location = 3) in flat ColorStop inStops[8]; - -layout(location = 0) out vec4 outColor; - -void main() -{ - float pos; - if (inRepeating != 0) - pos = fract (inGradientPos); - else - pos = clamp (inGradientPos, 0, 1); - - vec4 color = inStops[0].color; - int n = clamp (inStopCount, 2, 8); - for (int i = 1; i < n; i++) - { - if (inStops[i].offset > inStops[i-1].offset) - color = mix (color, inStops[i].color, clamp((pos - inStops[i-1].offset) / (inStops[i].offset - inStops[i-1].offset), 0, 1)); - } - - //outColor = vec4(pos, pos, pos, 1.0); - outColor = color; -} diff --git a/gsk/resources/vulkan/linear.vert.glsl b/gsk/resources/vulkan/linear.vert.glsl deleted file mode 100644 index 5a7874c2b1..0000000000 --- a/gsk/resources/vulkan/linear.vert.glsl +++ /dev/null @@ -1,75 +0,0 @@ -#version 420 core - -#define CLIP_NONE -#include "clip.vert.glsl" - -struct ColorStop { - float offset; - vec4 color; -}; - -layout(location = 0) in vec4 inRect; -layout(location = 1) in vec2 inStart; -layout(location = 2) in vec2 inEnd; -layout(location = 3) in int inRepeating; -layout(location = 4) in int inStopCount; -layout(location = 5) in vec4 inOffsets0; -layout(location = 6) in vec4 inOffsets1; -layout(location = 7) in vec4 inColors0; -layout(location = 8) in vec4 inColors1; -layout(location = 9) in vec4 inColors2; -layout(location = 10) in vec4 inColors3; -layout(location = 11) in vec4 inColors4; -layout(location = 12) in vec4 inColors5; -layout(location = 13) in vec4 inColors6; -layout(location = 14) in vec4 inColors7; - -layout(location = 0) out float outGradientPos; -layout(location = 1) out flat int outRepeating; -layout(location = 2) out flat int outStopCount; -layout(location = 3) out flat ColorStop outStops[8]; - -out gl_PerVertex { - vec4 gl_Position; -}; - -vec2 offsets[6] = { vec2(0.0, 0.0), - vec2(1.0, 0.0), - vec2(0.0, 1.0), - vec2(0.0, 1.0), - vec2(1.0, 0.0), - vec2(1.0, 1.0) }; - -float -get_gradient_pos (vec2 pos) -{ - pos = pos - inStart; - vec2 grad = inEnd - inStart; - - return dot (pos, grad) / dot (grad, grad); -} - -void main() { - vec4 rect = clip (inRect); - vec2 pos = rect.xy + rect.zw * offsets[gl_VertexIndex]; - gl_Position = push.mvp * vec4 (pos, 0.0, 1.0); - outGradientPos = get_gradient_pos (pos); - outRepeating = inRepeating; - outStopCount = inStopCount; - outStops[0].offset = inOffsets0[0]; - outStops[0].color = inColors0 * vec4(inColors0.aaa, 1.0); - outStops[1].offset = inOffsets0[1]; - outStops[1].color = inColors1 * vec4(inColors1.aaa, 1.0); - outStops[2].offset = inOffsets0[2]; - outStops[2].color = inColors2 * vec4(inColors2.aaa, 1.0); - outStops[3].offset = inOffsets0[3]; - outStops[3].color = inColors3 * vec4(inColors3.aaa, 1.0); - outStops[4].offset = inOffsets1[0]; - outStops[4].color = inColors4 * vec4(inColors4.aaa, 1.0); - outStops[5].offset = inOffsets1[1]; - outStops[5].color = inColors5 * vec4(inColors5.aaa, 1.0); - outStops[6].offset = inOffsets1[2]; - outStops[6].color = inColors6 * vec4(inColors6.aaa, 1.0); - outStops[7].offset = inOffsets1[3]; - outStops[7].color = inColors7 * vec4(inColors7.aaa, 1.0); -} diff --git a/gsk/resources/vulkan/texture.frag.glsl b/gsk/resources/vulkan/texture.frag.glsl deleted file mode 100644 index 4575c49848..0000000000 --- a/gsk/resources/vulkan/texture.frag.glsl +++ /dev/null @@ -1,12 +0,0 @@ -#version 420 core - -layout(location = 0) in vec2 inTexCoord; - -layout(set = 0, binding = 0) uniform sampler2D inTexture; - -layout(location = 0) out vec4 color; - -void main() -{ - color = texture (inTexture, inTexCoord); -} diff --git a/gsk/resources/vulkan/texture.vert.glsl b/gsk/resources/vulkan/texture.vert.glsl deleted file mode 100644 index 17be873457..0000000000 --- a/gsk/resources/vulkan/texture.vert.glsl +++ /dev/null @@ -1,26 +0,0 @@ -#version 420 core - -#include "constants.glsl" - -layout(location = 0) in vec4 inRect; -layout(location = 1) in vec4 inTexRect; - -layout(location = 0) out vec2 outTexCoord; - -out gl_PerVertex { - vec4 gl_Position; -}; - -vec2 offsets[6] = { vec2(0.0, 0.0), - vec2(1.0, 0.0), - vec2(0.0, 1.0), - vec2(0.0, 1.0), - vec2(1.0, 0.0), - vec2(1.0, 1.0) }; - -void main() { - vec2 pos = inRect.xy + inRect.zw * offsets[gl_VertexIndex]; - gl_Position = push.mvp * vec4 (pos, 0.0, 1.0); - - outTexCoord = inTexRect.xy + inTexRect.zw * offsets[gl_VertexIndex]; -} |