Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glsl-in: Resume expression emit after imageStore #1795

Merged
merged 1 commit into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/front/glsl/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,7 @@ impl MacroCall {
},
meta,
);
ctx.emit_start();
return Ok(None);
}
MacroCall::MathFunction(fun) => ctx.add_expression(
Expand Down
2 changes: 1 addition & 1 deletion tests/in/glsl/images.frag
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ layout(rgba8, binding = 9) writeonly readonly uniform image2D imgWriteReadOnly;

void testImg1D(in int coord) {
int size = imageSize(img1D);
vec4 c = imageLoad(img1D, coord);
imageStore(img1D, coord, vec4(2));
vec4 c = imageLoad(img1D, coord);
}

void testImg1DArray(in ivec2 coord) {
Expand Down
10 changes: 5 additions & 5 deletions tests/out/wgsl/images-frag.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ fn testImg1D(coord: i32) {
coord_1 = coord;
let _e10 = textureDimensions(img1D);
size = _e10;
let _e13 = coord_1;
let _e14 = textureLoad(img1D, _e13);
c = _e14;
let _e20 = coord_1;
textureStore(img1D, _e20, vec4<f32>(f32(2)));
let _e16 = coord_1;
textureStore(img1D, _e16, vec4<f32>(f32(2)));
let _e21 = coord_1;
let _e22 = textureLoad(img1D, _e21);
c = _e22;
return;
}

Expand Down