Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
++
  • Loading branch information
jonahwilliams committed Nov 22, 2022
commit 56df059758ad30f0b4050718e8f252981e2e4c76
14 changes: 0 additions & 14 deletions impeller/entity/shaders/blending/advanced_blend.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,13 @@
#include <impeller/types.glsl>

uniform BlendInfo {
<<<<<<< HEAD
float16_t dst_input_alpha;
float16_t dst_y_coord_scale;
float16_t src_y_coord_scale;
float16_t color_factor;
f16vec4 color; // This color input is expected to be unpremultiplied.
}
blend_info;
=======
float dst_input_alpha;
float dst_y_coord_scale;
float src_y_coord_scale;
float color_factor;
vec4 color; // This color input is expected to be unpremultiplied.
}
blend_info;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07

uniform sampler2D texture_sampler_dst;
uniform sampler2D texture_sampler_src;
Expand Down Expand Up @@ -56,8 +46,4 @@ void main() {
f16vec4 blended = f16vec4(Blend(dst.rgb, src.rgb), 1.0hf) * dst.a;

frag_color = mix(dst_sample, blended, src.a);
<<<<<<< HEAD
=======
// frag_color = dst_sample;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07
}
7 changes: 0 additions & 7 deletions impeller/entity/shaders/blending/blend.frag
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@
uniform sampler2D texture_sampler_src;

uniform FragInfo {
<<<<<<< HEAD
float16_t texture_sampler_y_coord_scale;
float16_t input_alpha;
}
frag_info;
=======
float texture_sampler_y_coord_scale;
float input_alpha;
}
frag_info;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07

in f16vec2 v_texture_coords;

Expand Down
6 changes: 0 additions & 6 deletions impeller/entity/shaders/border_mask_blur.frag
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,9 @@
uniform sampler2D texture_sampler;

uniform FragInfo {
<<<<<<< HEAD
float16_t texture_sampler_y_coord_scale;
}
frag_info;
=======
float texture_sampler_y_coord_scale;
}
frag_info;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07

in f16vec2 v_texture_coords;
in f16vec2 v_sigma_uv;
Expand Down
13 changes: 0 additions & 13 deletions impeller/entity/shaders/color_matrix_color_filter.frag
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,11 @@

uniform FragInfo {
mat4 color_m;
<<<<<<< HEAD
f16vec4 color_v;
float16_t texture_sampler_y_coord_scale;
float16_t input_alpha;
}
frag_info;
=======
vec4 color_v;
float texture_sampler_y_coord_scale;
float input_alpha;
}
frag_info;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07

uniform sampler2D input_texture;

Expand All @@ -61,11 +53,6 @@ void main() {
color = clamp(f16mat4(frag_info.color_m) * color + frag_info.color_v, 0.0hf,
1.0hf);

<<<<<<< HEAD
=======
color = clamp(frag_info.color_m * color + frag_info.color_v, 0.0, 1.0);

>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07
// premultiply the outputs
frag_color = f16vec4(color.rgb * color.a, color.a);
}
24 changes: 0 additions & 24 deletions impeller/entity/shaders/glyph_atlas.frag
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
uniform sampler2D glyph_atlas_sampler;

uniform FragInfo {
<<<<<<< HEAD
f16vec2 atlas_size;
f16vec4 text_color;
}
Expand All @@ -17,22 +16,10 @@ in f16vec2 v_unit_vertex;
in f16vec2 v_atlas_position;
in f16vec2 v_atlas_glyph_size;
in float16_t v_color_glyph;
=======
vec2 atlas_size;
vec4 text_color;
}
frag_info;

in vec2 v_unit_position;
in vec2 v_source_position;
in vec2 v_source_glyph_size;
in float v_has_color;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07

out f16vec4 frag_color;

void main() {
<<<<<<< HEAD
f16vec2 scale_perspective = v_atlas_glyph_size / frag_info.atlas_size;
f16vec2 offset = v_atlas_position / frag_info.atlas_size;
if (v_color_glyph == 1.0hf) {
Expand All @@ -43,16 +30,5 @@ void main() {
v_unit_vertex * scale_perspective + offset)
.aaaa) *
frag_info.text_color;
=======
vec2 uv_size = v_source_glyph_size / frag_info.atlas_size;
vec2 offset = v_source_position / frag_info.atlas_size;
if (v_has_color == 1.0) {
frag_color =
texture(glyph_atlas_sampler, v_unit_position * uv_size + offset);
} else {
frag_color =
texture(glyph_atlas_sampler, v_unit_position * uv_size + offset).aaaa *
frag_info.text_color;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07
}
}
39 changes: 13 additions & 26 deletions impeller/entity/shaders/glyph_atlas.vert
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <impeller/transform.glsl>
#include <impeller/types.glsl>

#include <impeller/transform.glsl>

uniform FrameInfo {
mat4 mvp;
}
frame_info;

<<<<<<< HEAD
in f16vec2 unit_vertex;
in f16vec2 glyph_position;
in f16vec2 glyph_size;
in f16vec2 atlas_position;
in f16vec2 atlas_glyph_size;
in float16_t color_glyph;
in f16vec2 unit_position;
in f16vec2 destination_position;
in f16vec2 destination_size;
in f16vec2 source_position;
in f16vec2 source_glyph_size;
in float16_t has_color;

out f16vec2 v_unit_vertex;
out f16vec2 v_atlas_position;
out f16vec2 v_atlas_glyph_size;
out float16_t v_color_glyph;
=======
in vec2 unit_position;
in vec2 destination_position;
in vec2 destination_size;
in vec2 source_position;
in vec2 source_glyph_size;
in float has_color;

out vec2 v_unit_position;
out vec2 v_source_position;
out vec2 v_source_glyph_size;
out float v_has_color;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07
out f16vec2 v_unit_position;
out f16vec2 v_source_position;
out f16vec2 v_source_glyph_size;
out float16_t v_has_color;

void main() {
gl_Position = IPPositionForGlyphPosition(
Expand All @@ -43,4 +30,4 @@ void main() {
v_source_position = source_position;
v_source_glyph_size = source_glyph_size;
v_has_color = has_color;
}
}
24 changes: 0 additions & 24 deletions impeller/entity/shaders/linear_gradient_fill.frag
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
uniform sampler2D texture_sampler;

uniform GradientInfo {
<<<<<<< HEAD
f16vec2 start_point;
f16vec2 end_point;
float16_t tile_mode;
Expand All @@ -17,23 +16,12 @@ uniform GradientInfo {
f16vec2 half_texel;
}
gradient_info;
=======
vec2 start_point;
vec2 end_point;
float tile_mode;
float texture_sampler_y_coord_scale;
float alpha;
vec2 half_texel;
}
gradient_info;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07

in f16vec2 v_position;

out f16vec4 frag_color;

void main() {
<<<<<<< HEAD
float16_t len = length(gradient_info.end_point - gradient_info.start_point);
float16_t dot = dot(v_position - gradient_info.start_point,
gradient_info.end_point - gradient_info.start_point);
Expand All @@ -44,16 +32,4 @@ void main() {
gradient_info.tile_mode);
frag_color = f16vec4(frag_color.xyz * frag_color.a, frag_color.a) *
gradient_info.alpha;
=======
float len = length(gradient_info.end_point - gradient_info.start_point);
float dot = dot(v_position - gradient_info.start_point,
gradient_info.end_point - gradient_info.start_point);
float t = dot / (len * len);
frag_color = IPSampleLinearWithTileMode(
texture_sampler, vec2(t, 0.5),
gradient_info.texture_sampler_y_coord_scale, gradient_info.half_texel,
gradient_info.tile_mode);
frag_color =
vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07
}
29 changes: 0 additions & 29 deletions impeller/entity/shaders/linear_gradient_ssbo_fill.frag
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <impeller/types.glsl>

readonly buffer ColorData {
<<<<<<< HEAD
f16vec4 colors[];
}
color_data;
Expand All @@ -20,37 +19,16 @@ uniform GradientInfo {
float16_t colors_length;
}
gradient_info;
=======
vec4 colors[];
}
color_data;

uniform GradientInfo {
vec2 start_point;
vec2 end_point;
float alpha;
float tile_mode;
float colors_length;
}
gradient_info;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07

in f16vec2 v_position;

out f16vec4 frag_color;

void main() {
<<<<<<< HEAD
float16_t len = length(gradient_info.end_point - gradient_info.start_point);
float16_t dot = dot(v_position - gradient_info.start_point,
gradient_info.end_point - gradient_info.start_point);
float16_t t = dot / (len * len);
=======
float len = length(gradient_info.end_point - gradient_info.start_point);
float dot = dot(v_position - gradient_info.start_point,
gradient_info.end_point - gradient_info.start_point);
float t = dot / (len * len);
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07

if ((t < 0.0hf || t > 1.0hf) && gradient_info.tile_mode == kTileModeDecal) {
frag_color = f16vec4(0.0hf);
Expand All @@ -59,15 +37,8 @@ void main() {
t = IPFloatTile(t, gradient_info.tile_mode);
f16vec3 values = IPComputeFixedGradientValues(t, gradient_info.colors_length);

<<<<<<< HEAD
frag_color = mix(color_data.colors[int(values.x)],
color_data.colors[int(values.y)], values.z);
frag_color = f16vec4(frag_color.xyz * frag_color.a, frag_color.a) *
gradient_info.alpha;
=======
frag_color = mix(color_data.colors[int(values.x)],
color_data.colors[int(values.y)], values.z);
frag_color =
vec4(frag_color.xyz * frag_color.a, frag_color.a) * gradient_info.alpha;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07
}
7 changes: 0 additions & 7 deletions impeller/entity/shaders/linear_to_srgb_filter.frag
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@
uniform sampler2D input_texture;

uniform FragInfo {
<<<<<<< HEAD
float16_t texture_sampler_y_coord_scale;
float16_t input_alpha;
}
frag_info;
=======
float texture_sampler_y_coord_scale;
float input_alpha;
}
frag_info;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07

in vec2 v_position;
out f16vec4 frag_color;
Expand Down
19 changes: 0 additions & 19 deletions impeller/entity/shaders/morphology_filter.frag
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@

// These values must correspond to the order of the items in the
// 'FilterContents::MorphType' enum class.
<<<<<<< HEAD
const float16_t kMorphTypeDilate = 0.0hf;
const float16_t kMorphTypeErode = 1.0hf;
=======
const float kMorphTypeDilate = 0;
const float kMorphTypeErode = 1;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07

uniform sampler2D texture_sampler;

Expand All @@ -31,7 +26,6 @@ in f16vec2 v_texture_coords;
out f16vec4 frag_color;

void main() {
<<<<<<< HEAD
f16vec4 result =
frag_info.morph_type == kMorphTypeDilate ? f16vec4(0) : f16vec4(1);
f16vec2 uv_offset = frag_info.direction / frag_info.texture_size;
Expand All @@ -44,19 +38,6 @@ void main() {
frag_info.texture_sampler_y_coord_scale, // y coordinate scale
kTileModeDecal // tile mode
);
=======
vec4 result = frag_info.morph_type == kMorphTypeDilate ? vec4(0) : vec4(1);
vec2 uv_offset = frag_info.direction / frag_info.texture_size;
for (float i = -frag_info.radius; i <= frag_info.radius; i++) {
vec2 texture_coords = v_texture_coords + uv_offset * i;
vec4 color;
color = IPSampleWithTileMode(
texture_sampler, // sampler
texture_coords, // texture coordinates
frag_info.texture_sampler_y_coord_scale, // y coordinate scale
kTileModeDecal // tile mode
);
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07
if (frag_info.morph_type == kMorphTypeDilate) {
result = max(color, result);
} else {
Expand Down
6 changes: 0 additions & 6 deletions impeller/entity/shaders/position.vert
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,9 @@

uniform VertInfo {
mat4 mvp;
<<<<<<< HEAD
f16vec4 color;
}
vert_info;
=======
vec4 color;
}
vert_info;
>>>>>>> ddf6a20b86578f147ee7da023f3f08ecb4256d07

in f16vec2 position;

Expand Down
Loading