Skip to content

Commit 3c0eeda

Browse files
refactor: Interface::check_stage: use concat!(…) for non-invariant @builtin(position) warning
1 parent 854664a commit 3c0eeda

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

wgpu-core/src/validation.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,10 +1332,18 @@ impl Interface {
13321332
if let Varying::BuiltIn(naga::BuiltIn::Position { invariant: false }) = *output
13331333
{
13341334
log::warn!(
1335-
"Vertex shader with entry point {entry_point_name} outputs a @builtin(position) without the @invariant \
1336-
attribute and is used in a pipeline with {cmp:?}. On some machines, this can cause bad artifacting as {cmp:?} assumes \
1337-
the values output from the vertex shader exactly match the value in the depth buffer. The @invariant attribute on the \
1338-
@builtin(position) vertex output ensures that the exact same pixel depths are used every render."
1335+
concat!(
1336+
"Vertex shader with entry point {} outputs a ",
1337+
"@builtin(position) without the @invariant attribute and ",
1338+
"is used in a pipeline with {cmp:?}. On some machines, ",
1339+
"this can cause bad artifacting as {cmp:?} assumes the ",
1340+
"values output from the vertex shader exactly match the ",
1341+
"value in the depth buffer. The @invariant attribute on the ",
1342+
"@builtin(position) vertex output ensures that the exact ",
1343+
"same pixel depths are used every render."
1344+
),
1345+
entry_point_name,
1346+
cmp = cmp
13391347
);
13401348
}
13411349
}

0 commit comments

Comments
 (0)