mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
[naga] Make additional test code reachable from entrypoints
This commit is contained in:
parent
25636e274b
commit
0997b99429
@ -35,5 +35,6 @@ void main() {
|
||||
const vec4 from_input_array = in_array[1];
|
||||
const float a = array_2d[0][0];
|
||||
const float b = array_toomanyd[0][0][0][0][0][0][0];
|
||||
const LightScatteringParams light_scattering_params;
|
||||
out_array[0] = vec4(2.0);
|
||||
}
|
||||
|
||||
@ -2861,7 +2861,12 @@ fn compaction_preserves_spans() {
|
||||
var x: array<i32,1>;
|
||||
var y = x[1.0];
|
||||
}
|
||||
"#; // ^^^ correct error span: 108..114
|
||||
@compute @workgroup_size(1)
|
||||
fn main() {
|
||||
f();
|
||||
}
|
||||
"#;
|
||||
// The error span should be on `x[1.0]`, which is at characters 108..114.
|
||||
let mut module = naga::front::wgsl::parse_str(source).expect("source ought to parse");
|
||||
naga::compact::compact(&mut module);
|
||||
let err = naga::valid::Validator::new(
|
||||
@ -2878,7 +2883,7 @@ fn compaction_preserves_spans() {
|
||||
// The first span is the whole function.
|
||||
let _ = spans.next().expect("error should have at least one span");
|
||||
|
||||
// The second span is the assignment destination.
|
||||
// The second span is the invalid indexing expression.
|
||||
let dest_span = spans
|
||||
.next()
|
||||
.expect("error should have at least two spans")
|
||||
|
||||
@ -43,6 +43,7 @@ fn main_1() {
|
||||
var from_input_array: vec4<f32>;
|
||||
var a_1: f32;
|
||||
var b: f32;
|
||||
var light_scattering_params: LightScatteringParams;
|
||||
|
||||
let _e17 = in_array_2[1];
|
||||
from_input_array = _e17;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user