-
Notifications
You must be signed in to change notification settings - Fork 935
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wgsl): add
first
and either
sampling types for `@interpolate…
…(flat, …)`
- Loading branch information
1 parent
34bb9e4
commit 5c69262
Showing
29 changed files
with
1,091 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
( | ||
spv: ( | ||
version: (1, 0), | ||
capabilities: [ Shader, SampleRateShading ], | ||
debug: true, | ||
force_point_size: true, | ||
adjust_coordinate_space: true, | ||
), | ||
glsl: ( | ||
version: Desktop(400), | ||
writer_flags: (""), | ||
binding_map: {}, | ||
zero_initialize_workgroup_memory: true, | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// NOTE: This is basically the same as `interpolate.wgsl`, except for the removal of | ||
// `@interpolate(flat, first)`, which is unsupported in GLSL and `compat`. | ||
|
||
// NOTE: invalid combinations are tested in the | ||
// `validation::incompatible_interpolation_and_sampling_types` test. | ||
struct FragmentInput { | ||
@builtin(position) position: vec4<f32>, | ||
@location(0) @interpolate(flat) _flat : u32, | ||
// NOTE: not supported in `compat` or GLSL | ||
// // @location(1) @interpolate(flat, first) flat_first : u32, | ||
@location(2) @interpolate(flat, either) flat_either : u32, | ||
@location(3) @interpolate(linear) _linear : f32, | ||
@location(4) @interpolate(linear, centroid) linear_centroid : vec2<f32>, | ||
@location(6) @interpolate(linear, sample) linear_sample : vec3<f32>, | ||
@location(7) @interpolate(perspective) perspective : vec4<f32>, | ||
@location(8) @interpolate(perspective, centroid) perspective_centroid : f32, | ||
@location(9) @interpolate(perspective, sample) perspective_sample : f32, | ||
} | ||
|
||
@vertex | ||
fn vert_main() -> FragmentInput { | ||
var out: FragmentInput; | ||
|
||
out.position = vec4<f32>(2.0, 4.0, 5.0, 6.0); | ||
out._flat = 8u; | ||
// out.flat_first = 9u; | ||
out.flat_either = 10u; | ||
out._linear = 27.0; | ||
out.linear_centroid = vec2<f32>(64.0, 125.0); | ||
out.linear_sample = vec3<f32>(216.0, 343.0, 512.0); | ||
out.perspective = vec4<f32>(729.0, 1000.0, 1331.0, 1728.0); | ||
out.perspective_centroid = 2197.0; | ||
out.perspective_sample = 2744.0; | ||
|
||
return out; | ||
} | ||
|
||
@fragment | ||
fn frag_main(val : FragmentInput) { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
naga/tests/out/glsl/interpolate_compat.frag_main.Fragment.glsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#version 400 core | ||
struct FragmentInput { | ||
vec4 position; | ||
uint _flat; | ||
uint flat_either; | ||
float _linear; | ||
vec2 linear_centroid; | ||
vec3 linear_sample; | ||
vec4 perspective; | ||
float perspective_centroid; | ||
float perspective_sample; | ||
}; | ||
flat in uint _vs2fs_location0; | ||
flat in uint _vs2fs_location2; | ||
noperspective in float _vs2fs_location3; | ||
noperspective centroid in vec2 _vs2fs_location4; | ||
noperspective sample in vec3 _vs2fs_location6; | ||
smooth in vec4 _vs2fs_location7; | ||
smooth centroid in float _vs2fs_location8; | ||
smooth sample in float _vs2fs_location9; | ||
|
||
void main() { | ||
FragmentInput val = FragmentInput(gl_FragCoord, _vs2fs_location0, _vs2fs_location2, _vs2fs_location3, _vs2fs_location4, _vs2fs_location6, _vs2fs_location7, _vs2fs_location8, _vs2fs_location9); | ||
return; | ||
} | ||
|
Oops, something went wrong.