forked from AuroraMiddleware/gtk
vulkan: Delete unused shaders
These have been renamed to .frag/.vert, apparently the originals weren't deleted.
This commit is contained in:
parent
4f6cee3ee3
commit
e4dbff6bfc
@ -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));
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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);
|
||||
}
|
@ -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;
|
||||
}
|
@ -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);
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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);
|
||||
}
|
@ -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);
|
||||
}
|
@ -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];
|
||||
}
|
Loading…
Reference in New Issue
Block a user