-
Notifications
You must be signed in to change notification settings - Fork 976
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
[Naga] SHADER_INT64_ATOMIC_MIN_MAX issue #5888
Comments
Backtrace:
|
Okay, so this is a front-end bug. We're getting the following IR: expressions: {
[0]: FunctionArgument(
0,
),
[1]: GlobalVariable(
[0],
),
[2]: AccessIndex {
base: [1],
index: 0,
},
[3]: AccessIndex {
base: [0],
index: 2,
},
[4]: As {
expr: [3],
kind: Uint,
convert: Some(
8,
),
},
},
named_expressions: {
[0]: "position",
},
body: Block {
body: [
Atomic {
pointer: [2],
fun: Max,
value: [4],
result: None,
},
Emit(
[2..5],
),
], That |
It seems like, by deciding not to interrupt the emitter to produce an But then I can't explain why the existing test case |
This seems to fix the problem, but that doesn't account for the above. modified naga/src/front/wgsl/lower/mod.rs
@@ -2482,6 +2482,9 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
crate::TypeInner::Scalar(crate::Scalar { width: 8, .. })
);
let result = if is_64_bit_min_max && is_statement {
+ let rctx = ctx.runtime_expression_ctx(span)?;
+ rctx.block.extend(rctx.emitter.finish(&rctx.function.expressions));
+ rctx.emitter.start(&rctx.function.expressions);
None
} else {
let ty = ctx.register_type(value)?;
|
Tested with naga-cli rev
82210e1c
The text was updated successfully, but these errors were encountered: