mirror of
https://github.com/servo/servo.git
synced 2025-06-06 00:25:37 +00:00
Remove some unused WR1 shaders, copy new shaders, update WR hash.
This commit is contained in:
parent
8cd4b772e9
commit
ce01120fb1
22 changed files with 81 additions and 332 deletions
|
@ -1,9 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 diffuse = Texture(sDiffuse, vColorTexCoord);
|
||||
SetFragColor(diffuse * vColor);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vColor = aColorRectTL / 255.0;
|
||||
vColorTexCoord = aColorTexCoordRectTop.xy;
|
||||
vec4 pos = vec4(aPosition, 1.0);
|
||||
pos.xy = SnapToPixels(pos.xy);
|
||||
gl_Position = uTransform * pos;
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
void main(void)
|
||||
{
|
||||
SetFragColor(vColor);
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vColor = aColorRectTL / 255.0;
|
||||
gl_Position = uTransform * vec4(aPosition, 1.0);
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
void main(void)
|
||||
{
|
||||
SetFragColor(vColor);
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vColor = aColorRectTL / 255.0;
|
||||
gl_Position = uTransform * vec4(aPosition, 1.0);
|
||||
}
|
|
@ -146,6 +146,53 @@ VertexInfo write_vertex(PrimitiveInfo info) {
|
|||
VertexInfo vi = VertexInfo(Rect(p0, p1), local_clamped_pos.xy, clamped_pos.xy);
|
||||
return vi;
|
||||
}
|
||||
|
||||
struct TransformVertexInfo {
|
||||
vec3 local_pos;
|
||||
};
|
||||
|
||||
TransformVertexInfo write_transform_vertex(PrimitiveInfo info) {
|
||||
Layer layer = layers[info.layer_tile_part.x];
|
||||
Tile tile = tiles[info.layer_tile_part.y];
|
||||
|
||||
vec2 p0 = info.local_rect.xy;
|
||||
vec2 p1 = info.local_rect.xy + vec2(info.local_rect.z, 0.0);
|
||||
vec2 p2 = info.local_rect.xy + vec2(0.0, info.local_rect.w);
|
||||
vec2 p3 = info.local_rect.xy + info.local_rect.zw;
|
||||
|
||||
vec4 t0 = layer.transform * vec4(p0, 0, 1);
|
||||
vec4 t1 = layer.transform * vec4(p1, 0, 1);
|
||||
vec4 t2 = layer.transform * vec4(p2, 0, 1);
|
||||
vec4 t3 = layer.transform * vec4(p3, 0, 1);
|
||||
|
||||
vec2 tp0 = t0.xy / t0.w;
|
||||
vec2 tp1 = t1.xy / t1.w;
|
||||
vec2 tp2 = t2.xy / t2.w;
|
||||
vec2 tp3 = t3.xy / t3.w;
|
||||
|
||||
vec2 min_pos = min(tp0.xy, min(tp1.xy, min(tp2.xy, tp3.xy)));
|
||||
vec2 max_pos = max(tp0.xy, max(tp1.xy, max(tp2.xy, tp3.xy)));
|
||||
|
||||
vec2 min_pos_clamped = clamp(min_pos * uDevicePixelRatio,
|
||||
vec2(tile.actual_rect.xy),
|
||||
vec2(tile.actual_rect.xy + tile.actual_rect.zw));
|
||||
|
||||
vec2 max_pos_clamped = clamp(max_pos * uDevicePixelRatio,
|
||||
vec2(tile.actual_rect.xy),
|
||||
vec2(tile.actual_rect.xy + tile.actual_rect.zw));
|
||||
|
||||
vec2 clamped_pos = mix(min_pos_clamped,
|
||||
max_pos_clamped,
|
||||
aPosition.xy);
|
||||
|
||||
vec3 layer_pos = get_layer_pos(clamped_pos / uDevicePixelRatio, info.layer_tile_part.x);
|
||||
|
||||
vec2 final_pos = clamped_pos + vec2(tile.target_rect.xy) - vec2(tile.actual_rect.xy);
|
||||
|
||||
gl_Position = uTransform * vec4(final_pos, 0, 1);
|
||||
|
||||
return TransformVertexInfo(layer_pos);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WR_FRAGMENT_SHADER
|
||||
|
@ -177,4 +224,14 @@ bool point_in_rect(vec2 p, vec2 p0, vec2 p1) {
|
|||
p.x <= p1.x &&
|
||||
p.y <= p1.y;
|
||||
}
|
||||
|
||||
vec2 init_transform_fs(vec3 local_pos, vec4 local_rect) {
|
||||
vec2 pos = local_pos.xy / local_pos.z;
|
||||
|
||||
if (!point_in_rect(pos, local_rect.xy, local_rect.xy + local_rect.zw)) {
|
||||
discard;
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
struct AngleGradient {
|
||||
PrimitiveInfo info;
|
||||
PrimitiveInfo info;
|
||||
vec4 start_end_point;
|
||||
uvec4 stop_count;
|
||||
vec4 colors[MAX_STOPS_PER_ANGLE_GRADIENT];
|
||||
|
|
|
@ -3,11 +3,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
void main(void) {
|
||||
vec2 pos = vPos.xy / vPos.z;
|
||||
|
||||
if (!point_in_rect(pos, vRect.xy, vRect.xy + vRect.zw)) {
|
||||
discard;
|
||||
}
|
||||
|
||||
oFragColor = texture(sDiffuse, vUv / vPos.z);
|
||||
init_transform_fs(vLocalPos, vLocalRect);
|
||||
oFragColor = texture(sDiffuse, vUv / vLocalPos.z);
|
||||
}
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
|
||||
varying vec2 vUv;
|
||||
|
||||
varying vec3 vPos;
|
||||
flat varying vec4 vRect;
|
||||
varying vec3 vLocalPos;
|
||||
flat varying vec4 vLocalRect;
|
||||
|
|
|
@ -15,51 +15,15 @@ layout(std140) uniform Items {
|
|||
|
||||
void main(void) {
|
||||
Image image = images[gl_InstanceID];
|
||||
Layer layer = layers[image.info.layer_tile_part.x];
|
||||
Tile tile = tiles[image.info.layer_tile_part.y];
|
||||
|
||||
vec2 p0 = image.info.local_rect.xy;
|
||||
vec2 p1 = image.info.local_rect.xy + vec2(image.info.local_rect.z, 0.0);
|
||||
vec2 p2 = image.info.local_rect.xy + vec2(0.0, image.info.local_rect.w);
|
||||
vec2 p3 = image.info.local_rect.xy + image.info.local_rect.zw;
|
||||
TransformVertexInfo vi = write_transform_vertex(image.info);
|
||||
|
||||
vec4 t0 = layer.transform * vec4(p0, 0, 1);
|
||||
vec4 t1 = layer.transform * vec4(p1, 0, 1);
|
||||
vec4 t2 = layer.transform * vec4(p2, 0, 1);
|
||||
vec4 t3 = layer.transform * vec4(p3, 0, 1);
|
||||
vLocalRect = image.info.local_rect;
|
||||
vLocalPos = vi.local_pos;
|
||||
|
||||
vec2 tp0 = t0.xy / t0.w;
|
||||
vec2 tp1 = t1.xy / t1.w;
|
||||
vec2 tp2 = t2.xy / t2.w;
|
||||
vec2 tp3 = t3.xy / t3.w;
|
||||
|
||||
vec2 min_pos = min(tp0.xy, min(tp1.xy, min(tp2.xy, tp3.xy)));
|
||||
vec2 max_pos = max(tp0.xy, max(tp1.xy, max(tp2.xy, tp3.xy)));
|
||||
|
||||
vec2 min_pos_clamped = clamp(min_pos * uDevicePixelRatio,
|
||||
vec2(tile.actual_rect.xy),
|
||||
vec2(tile.actual_rect.xy + tile.actual_rect.zw));
|
||||
|
||||
vec2 max_pos_clamped = clamp(max_pos * uDevicePixelRatio,
|
||||
vec2(tile.actual_rect.xy),
|
||||
vec2(tile.actual_rect.xy + tile.actual_rect.zw));
|
||||
|
||||
vec2 clamped_pos = mix(min_pos_clamped,
|
||||
max_pos_clamped,
|
||||
aPosition.xy);
|
||||
|
||||
vec3 layer_pos = get_layer_pos(clamped_pos / uDevicePixelRatio, image.info.layer_tile_part.x);
|
||||
|
||||
vRect = image.info.local_rect;
|
||||
vPos = layer_pos;
|
||||
|
||||
vec2 f = (layer_pos.xy - image.info.local_rect.xy) / image.info.local_rect.zw;
|
||||
vec2 f = (vi.local_pos.xy - image.info.local_rect.xy) / image.info.local_rect.zw;
|
||||
|
||||
vUv = mix(image.st_rect.xy,
|
||||
image.st_rect.zw,
|
||||
f);
|
||||
|
||||
vec2 final_pos = clamped_pos + vec2(tile.target_rect.xy) - vec2(tile.actual_rect.xy);
|
||||
|
||||
gl_Position = uTransform * vec4(final_pos, 0, 1);
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
struct Rectangle {
|
||||
PrimitiveInfo info;
|
||||
vec4 color;
|
||||
PrimitiveInfo info;
|
||||
vec4 color;
|
||||
};
|
||||
|
||||
layout(std140) uniform Items {
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
struct Rectangle {
|
||||
PrimitiveInfo info;
|
||||
vec4 color;
|
||||
PrimitiveInfo info;
|
||||
vec4 color;
|
||||
Clip clip;
|
||||
};
|
||||
|
||||
|
|
|
@ -3,11 +3,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
void main(void) {
|
||||
vec2 pos = vPos.xy / vPos.z;
|
||||
|
||||
if (!point_in_rect(pos, vRect.xy, vRect.xy + vRect.zw)) {
|
||||
discard;
|
||||
}
|
||||
|
||||
oFragColor = vColor;
|
||||
init_transform_fs(vLocalPos, vLocalRect);
|
||||
oFragColor = vColor;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
|
||||
varying vec4 vColor;
|
||||
|
||||
varying vec3 vPos;
|
||||
flat varying vec4 vRect;
|
||||
varying vec3 vLocalPos;
|
||||
flat varying vec4 vLocalRect;
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
struct Rectangle {
|
||||
PrimitiveInfo info;
|
||||
vec4 color;
|
||||
PrimitiveInfo info;
|
||||
vec4 color;
|
||||
};
|
||||
|
||||
layout(std140) uniform Items {
|
||||
|
@ -14,46 +14,11 @@ layout(std140) uniform Items {
|
|||
|
||||
void main(void) {
|
||||
Rectangle rect = rects[gl_InstanceID];
|
||||
Layer layer = layers[rect.info.layer_tile_part.x];
|
||||
Tile tile = tiles[rect.info.layer_tile_part.y];
|
||||
|
||||
vec2 p0 = rect.info.local_rect.xy;
|
||||
vec2 p1 = rect.info.local_rect.xy + vec2(rect.info.local_rect.z, 0.0);
|
||||
vec2 p2 = rect.info.local_rect.xy + vec2(0.0, rect.info.local_rect.w);
|
||||
vec2 p3 = rect.info.local_rect.xy + rect.info.local_rect.zw;
|
||||
TransformVertexInfo vi = write_transform_vertex(rect.info);
|
||||
|
||||
vec4 t0 = layer.transform * vec4(p0, 0, 1);
|
||||
vec4 t1 = layer.transform * vec4(p1, 0, 1);
|
||||
vec4 t2 = layer.transform * vec4(p2, 0, 1);
|
||||
vec4 t3 = layer.transform * vec4(p3, 0, 1);
|
||||
vLocalRect = rect.info.local_rect;
|
||||
vLocalPos = vi.local_pos;
|
||||
|
||||
vec2 tp0 = t0.xy / t0.w;
|
||||
vec2 tp1 = t1.xy / t1.w;
|
||||
vec2 tp2 = t2.xy / t2.w;
|
||||
vec2 tp3 = t3.xy / t3.w;
|
||||
|
||||
vec2 min_pos = min(tp0.xy, min(tp1.xy, min(tp2.xy, tp3.xy)));
|
||||
vec2 max_pos = max(tp0.xy, max(tp1.xy, max(tp2.xy, tp3.xy)));
|
||||
|
||||
vec2 min_pos_clamped = clamp(min_pos * uDevicePixelRatio,
|
||||
vec2(tile.actual_rect.xy),
|
||||
vec2(tile.actual_rect.xy + tile.actual_rect.zw));
|
||||
|
||||
vec2 max_pos_clamped = clamp(max_pos * uDevicePixelRatio,
|
||||
vec2(tile.actual_rect.xy),
|
||||
vec2(tile.actual_rect.xy + tile.actual_rect.zw));
|
||||
|
||||
vec2 clamped_pos = mix(min_pos_clamped,
|
||||
max_pos_clamped,
|
||||
aPosition.xy);
|
||||
|
||||
vec3 layer_pos = get_layer_pos(clamped_pos / uDevicePixelRatio, rect.info.layer_tile_part.x);
|
||||
|
||||
vRect = rect.info.local_rect;
|
||||
vPos = layer_pos;
|
||||
vColor = rect.color;
|
||||
|
||||
vec2 final_pos = clamped_pos + vec2(tile.target_rect.xy) - vec2(tile.actual_rect.xy);
|
||||
|
||||
gl_Position = uTransform * vec4(final_pos, 0, 1);
|
||||
}
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// GLSL point in rect test.
|
||||
// See: https://stackoverflow.com/questions/12751080/glsl-point-inside-box-test
|
||||
bool PointInRect(vec2 p, vec2 p0, vec2 p1)
|
||||
{
|
||||
vec2 s = step(p0, p) - step(p1, p);
|
||||
return s.x * s.y != 0.0;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
// Clip out.
|
||||
if (PointInRect(vPosition, vClipOutRect.xy, vClipOutRect.zw)) {
|
||||
discard;
|
||||
}
|
||||
|
||||
// Clip in.
|
||||
if (!PointInRect(vPosition, vClipInRect.xy, vClipInRect.zw)) {
|
||||
discard;
|
||||
}
|
||||
|
||||
// Apply image tiling parameters (offset and scale) to color UVs.
|
||||
vec2 colorTexCoord = vTileParams.xy + fract(vColorTexCoord.xy) * vTileParams.zw;
|
||||
vec2 maskTexCoord = vMaskTexCoord.xy;
|
||||
|
||||
// Fetch the diffuse and mask texels.
|
||||
vec4 diffuse = Texture(sDiffuse, colorTexCoord);
|
||||
vec4 mask = Texture(sMask, maskTexCoord);
|
||||
|
||||
// Extract alpha from the mask (component depends on platform)
|
||||
float alpha = GetAlphaFromMask(mask);
|
||||
|
||||
// Write the final fragment color.
|
||||
SetFragColor(diffuse * vec4(vColor.rgb, vColor.a * alpha));
|
||||
}
|
|
@ -1,112 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
vec2 Bilerp2(vec2 tl, vec2 tr, vec2 br, vec2 bl, vec2 st) {
|
||||
return mix(mix(tl, bl, st.y), mix(tr, br, st.y), st.x);
|
||||
}
|
||||
|
||||
vec4 Bilerp4(vec4 tl, vec4 tr, vec4 br, vec4 bl, vec2 st) {
|
||||
return mix(mix(tl, bl, st.y), mix(tr, br, st.y), st.x);
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
// Extract the image tiling parameters.
|
||||
// These are passed to the fragment shader, since
|
||||
// the uv interpolation must be done per-fragment.
|
||||
vTileParams = uTileParams[Bottom7Bits(int(aMisc.w))];
|
||||
|
||||
// Determine clip rects.
|
||||
vClipOutRect = uClipRects[int(aMisc.z)];
|
||||
vec4 clipInRect = uClipRects[int(aMisc.y)];
|
||||
|
||||
// Extract the complete (stacking context + css transform) transform
|
||||
// for this vertex. Transform the position by it.
|
||||
vec2 offsetParams = uOffsets[Bottom7Bits(int(aMisc.x))].xy;
|
||||
mat4 matrix = uMatrixPalette[Bottom7Bits(int(aMisc.x))];
|
||||
|
||||
vec2 p0 = aPositionRect.xy + offsetParams;
|
||||
vec2 p1 = p0 + aPositionRect.zw;
|
||||
|
||||
vec2 rect_origin = SnapToPixels(p0);
|
||||
vec2 rect_size = SnapToPixels(p1) - rect_origin;
|
||||
|
||||
// Determine the position, color, and mask texture coordinates of this vertex.
|
||||
vec4 localPos = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
bool isBorderCorner = int(aMisc.w) >= 0x80;
|
||||
bool isBottomTriangle = IsBottomTriangle();
|
||||
if (aPosition.y == 0.0) {
|
||||
localPos.y = rect_origin.y;
|
||||
if (aPosition.x == 0.0) {
|
||||
localPos.x = rect_origin.x;
|
||||
if (isBorderCorner) {
|
||||
vColor = isBottomTriangle ? aColorRectBL : aColorRectTR;
|
||||
}
|
||||
} else {
|
||||
localPos.x = rect_origin.x + rect_size.x;
|
||||
if (isBorderCorner) {
|
||||
vColor = aColorRectTR;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
localPos.y = rect_origin.y + rect_size.y;
|
||||
if (aPosition.x == 0.0) {
|
||||
localPos.x = rect_origin.x;
|
||||
if (isBorderCorner) {
|
||||
vColor = aColorRectBL;
|
||||
}
|
||||
} else {
|
||||
localPos.x = rect_origin.x + rect_size.x;
|
||||
if (isBorderCorner) {
|
||||
vColor = isBottomTriangle ? aColorRectBL : aColorRectTR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Rotate or clip as necessary. If there is no rotation, we can clip here in the vertex shader
|
||||
// and save a whole bunch of fragment shader invocations. If there is a rotation, we fall back
|
||||
// to FS clipping.
|
||||
//
|
||||
// The rotation angle is encoded as a negative bottom left u coordinate. (uv coordinates should
|
||||
// always be nonnegative normally, and gradients don't use color textures, so this is fine.)
|
||||
vec4 colorTexCoordRectBottom = aColorTexCoordRectBottom;
|
||||
vec2 localST;
|
||||
if (colorTexCoordRectBottom.z < 0.0) {
|
||||
float angle = -colorTexCoordRectBottom.z;
|
||||
vec2 center = rect_origin + rect_size / 2.0;
|
||||
vec2 translatedPos = localPos.xy - center;
|
||||
localST = (localPos.xy - rect_origin) / rect_size;
|
||||
localPos.xy = vec2(translatedPos.x * cos(angle) - translatedPos.y * sin(angle),
|
||||
translatedPos.x * sin(angle) + translatedPos.y * cos(angle)) + center;
|
||||
colorTexCoordRectBottom.z = aColorTexCoordRectTop.x;
|
||||
vClipInRect = clipInRect;
|
||||
} else {
|
||||
localPos.x = clamp(localPos.x, clipInRect.x, clipInRect.z);
|
||||
localPos.y = clamp(localPos.y, clipInRect.y, clipInRect.w);
|
||||
localST = (localPos.xy - rect_origin) / rect_size;
|
||||
vClipInRect = vec4(-1e37, -1e37, 1e38, 1e38);
|
||||
}
|
||||
|
||||
vColorTexCoord = Bilerp2(aColorTexCoordRectTop.xy, aColorTexCoordRectTop.zw,
|
||||
colorTexCoordRectBottom.xy, colorTexCoordRectBottom.zw,
|
||||
localST);
|
||||
vMaskTexCoord = Bilerp2(aMaskTexCoordRectTop.xy, aMaskTexCoordRectTop.zw,
|
||||
aMaskTexCoordRectBottom.xy, aMaskTexCoordRectBottom.zw,
|
||||
localST);
|
||||
if (!isBorderCorner) {
|
||||
vColor = Bilerp4(aColorRectTL, aColorRectTR, aColorRectBR, aColorRectBL, localST);
|
||||
}
|
||||
|
||||
// Normalize the vertex color and mask texture coordinates.
|
||||
vColor /= 255.0;
|
||||
vMaskTexCoord /= uAtlasParams.zw;
|
||||
|
||||
vPosition = localPos.xy;
|
||||
|
||||
vec4 worldPos = matrix * localPos;
|
||||
|
||||
// Transform by the orthographic projection into clip space.
|
||||
gl_Position = uTransform * worldPos;
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
void main(void) {
|
||||
vec2 textureSize = vBorderPosition.zw - vBorderPosition.xy;
|
||||
vec2 colorTexCoord = vBorderPosition.xy + mod(vColorTexCoord.xy, 1.0) * textureSize;
|
||||
vec4 diffuse = Texture(sDiffuse, colorTexCoord);
|
||||
SetFragColor(diffuse);
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vColorTexCoord = aBorderRadii.xy;
|
||||
vBorderPosition = aBorderPosition;
|
||||
gl_Position = uTransform * vec4(aPosition, 1.0);
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue