diff options
Diffstat (limited to 'wgpu/src')
-rw-r--r-- | wgpu/src/shader/quad.wgsl | 20 | ||||
-rw-r--r-- | wgpu/src/shader/triangle.wgsl | 20 | ||||
-rw-r--r-- | wgpu/src/text.rs | 5 |
3 files changed, 24 insertions, 21 deletions
diff --git a/wgpu/src/shader/quad.wgsl b/wgpu/src/shader/quad.wgsl index fb402158..023b5a6d 100644 --- a/wgpu/src/shader/quad.wgsl +++ b/wgpu/src/shader/quad.wgsl @@ -147,11 +147,11 @@ fn solid_fs_main( struct GradientVertexInput { @location(0) v_pos: vec2<f32>, - @location(1) colors_1: vec4<u32>, - @location(2) colors_2: vec4<u32>, - @location(3) colors_3: vec4<u32>, - @location(4) colors_4: vec4<u32>, - @location(5) offsets: vec4<u32>, + @location(1) @interpolate(flat) colors_1: vec4<u32>, + @location(2) @interpolate(flat) colors_2: vec4<u32>, + @location(3) @interpolate(flat) colors_3: vec4<u32>, + @location(4) @interpolate(flat) colors_4: vec4<u32>, + @location(5) @interpolate(flat) offsets: vec4<u32>, @location(6) direction: vec4<f32>, @location(7) position_and_scale: vec4<f32>, @location(8) border_color: vec4<f32>, @@ -161,11 +161,11 @@ struct GradientVertexInput { struct GradientVertexOutput { @builtin(position) position: vec4<f32>, - @location(1) colors_1: vec4<u32>, - @location(2) colors_2: vec4<u32>, - @location(3) colors_3: vec4<u32>, - @location(4) colors_4: vec4<u32>, - @location(5) offsets: vec4<u32>, + @location(1) @interpolate(flat) colors_1: vec4<u32>, + @location(2) @interpolate(flat) colors_2: vec4<u32>, + @location(3) @interpolate(flat) colors_3: vec4<u32>, + @location(4) @interpolate(flat) colors_4: vec4<u32>, + @location(5) @interpolate(flat) offsets: vec4<u32>, @location(6) direction: vec4<f32>, @location(7) position_and_scale: vec4<f32>, @location(8) border_color: vec4<f32>, diff --git a/wgpu/src/shader/triangle.wgsl b/wgpu/src/shader/triangle.wgsl index 9f512d14..3a2b9845 100644 --- a/wgpu/src/shader/triangle.wgsl +++ b/wgpu/src/shader/triangle.wgsl @@ -38,22 +38,22 @@ fn solid_fs_main(input: SolidVertexOutput) -> @location(0) vec4<f32> { struct GradientVertexInput { @location(0) v_pos: vec2<f32>, - @location(1) colors_1: vec4<u32>, - @location(2) colors_2: vec4<u32>, - @location(3) colors_3: vec4<u32>, - @location(4) colors_4: vec4<u32>, - @location(5) offsets: vec4<u32>, + @location(1) @interpolate(flat) colors_1: vec4<u32>, + @location(2) @interpolate(flat) colors_2: vec4<u32>, + @location(3) @interpolate(flat) colors_3: vec4<u32>, + @location(4) @interpolate(flat) colors_4: vec4<u32>, + @location(5) @interpolate(flat) offsets: vec4<u32>, @location(6) direction: vec4<f32>, } struct GradientVertexOutput { @builtin(position) position: vec4<f32>, @location(0) raw_position: vec2<f32>, - @location(1) colors_1: vec4<u32>, - @location(2) colors_2: vec4<u32>, - @location(3) colors_3: vec4<u32>, - @location(4) colors_4: vec4<u32>, - @location(5) offsets: vec4<u32>, + @location(1) @interpolate(flat) colors_1: vec4<u32>, + @location(2) @interpolate(flat) colors_2: vec4<u32>, + @location(3) @interpolate(flat) colors_3: vec4<u32>, + @location(4) @interpolate(flat) colors_4: vec4<u32>, + @location(5) @interpolate(flat) offsets: vec4<u32>, @location(6) direction: vec4<f32>, } diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index fb13545d..9c42be0e 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -414,7 +414,10 @@ impl Cache { } if let hash_map::Entry::Vacant(entry) = self.entries.entry(hash) { - let metrics = glyphon::Metrics::new(key.size, key.line_height); + let metrics = glyphon::Metrics::new( + key.size, + key.line_height.max(f32::MIN_POSITIVE), + ); let mut buffer = glyphon::Buffer::new(font_system, metrics); buffer.set_size( |