mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 00:03:29 +00:00
Nested loop test
This commit is contained in:
parent
330a8608e3
commit
8129897ccb
@ -124,6 +124,10 @@ Bottom level categories:
|
||||
- Fix behavior of integer `clamp` when `min` argument > `max` argument. By @cwfitzgerald in [#5300](https://github.com/gfx-rs/wgpu/pull/5300).
|
||||
- Fix missing validation for `Device::clear_buffer` where `offset + size buffer.size` was not checked when `size` was omitted. By @ErichDonGubler in [#5282](https://github.com/gfx-rs/wgpu/pull/5282).
|
||||
|
||||
#### glsl-in
|
||||
|
||||
- Fix code generation from nested loops. By @cwfitzgerald and @teoxoy in [#5311](https://github.com/gfx-rs/wgpu/pull/5311)
|
||||
|
||||
#### WGL
|
||||
|
||||
- In Surface::configure and Surface::present, fix the current GL context not being unset when releasing the lock that guards access to making the context current. This was causing other threads to panic when trying to make the context current. By @Imberflur in [#5087](https://github.com/gfx-rs/wgpu/pull/5087).
|
||||
|
@ -435,7 +435,7 @@ impl<'source> ParsingContext<'source> {
|
||||
|
||||
if self.bump_if(frontend, TokenValue::Semicolon).is_none() {
|
||||
if self.peek_type_name(frontend) || self.peek_type_qualifier(frontend) {
|
||||
self.parse_declaration(frontend, ctx, false, false)?;
|
||||
self.parse_declaration(frontend, ctx, false, is_inside_loop)?;
|
||||
} else {
|
||||
let mut stmt = ctx.stmt_ctx();
|
||||
let expr = self.parse_expression(frontend, ctx, &mut stmt)?;
|
||||
|
12
naga/tests/in/glsl/5246-dual-iteration.frag
Normal file
12
naga/tests/in/glsl/5246-dual-iteration.frag
Normal file
@ -0,0 +1,12 @@
|
||||
// AUTHOR: cwfitzgerald
|
||||
// ISSUE: #5246
|
||||
|
||||
void main() {
|
||||
for (int x = 0; x < 10; x++) {
|
||||
for (int y = 0; y < 10; y++) {
|
||||
for (int z = 0; z < 10; z++) {
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
51
naga/tests/out/wgsl/5246-dual-iteration.frag.wgsl
Normal file
51
naga/tests/out/wgsl/5246-dual-iteration.frag.wgsl
Normal file
@ -0,0 +1,51 @@
|
||||
fn main_1() {
|
||||
var x: i32 = 0i;
|
||||
var y: i32;
|
||||
var z: i32;
|
||||
|
||||
loop {
|
||||
let _e2 = x;
|
||||
if !((_e2 < 10i)) {
|
||||
break;
|
||||
}
|
||||
{
|
||||
y = 0i;
|
||||
loop {
|
||||
let _e11 = y;
|
||||
if !((_e11 < 10i)) {
|
||||
break;
|
||||
}
|
||||
{
|
||||
z = 0i;
|
||||
loop {
|
||||
let _e20 = z;
|
||||
if !((_e20 < 10i)) {
|
||||
break;
|
||||
}
|
||||
{
|
||||
}
|
||||
continuing {
|
||||
let _e24 = z;
|
||||
z = (_e24 + 1i);
|
||||
}
|
||||
}
|
||||
}
|
||||
continuing {
|
||||
let _e15 = y;
|
||||
y = (_e15 + 1i);
|
||||
}
|
||||
}
|
||||
}
|
||||
continuing {
|
||||
let _e6 = x;
|
||||
x = (_e6 + 1i);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn main() {
|
||||
main_1();
|
||||
return;
|
||||
}
|
Loading…
Reference in New Issue
Block a user