Skip to content

Commit

Permalink
Merge pull request #2071 from Davidster/wgpu_webgpu_support
Browse files Browse the repository at this point in the history
use @interpolate(flat) attribute as per the WebGPU spec
  • Loading branch information
hecrj authored Sep 7, 2023
2 parents ccc7870 + 8780009 commit d82c8b5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions wgpu/src/shader/quad.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand All @@ -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>,
Expand Down
20 changes: 10 additions & 10 deletions wgpu/src/shader/triangle.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
}

Expand Down

0 comments on commit d82c8b5

Please sign in to comment.