mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-06 20:25:44 +00:00
Involves expanding the source range of a variable declaration so we can point at something that can include the 'const'. Fixed: tint:1740 Change-Id: Ie8f784de34a1792002aaa708c1b77053be54f1b5 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/108120 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: David Neto <dneto@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
39 lines
592 B
GLSL
39 lines
592 B
GLSL
bug/tint/1369.wgsl:3:3 warning: code is unreachable
|
|
return true;
|
|
^^^^^^
|
|
|
|
bug/tint/1369.wgsl:9:5 warning: code is unreachable
|
|
var also_unreachable : bool;
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
#version 310 es
|
|
precision mediump float;
|
|
|
|
bool tint_discard = false;
|
|
bool call_discard() {
|
|
tint_discard = true;
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
void f() {
|
|
bool v = call_discard();
|
|
if (tint_discard) {
|
|
return;
|
|
}
|
|
bool also_unreachable = false;
|
|
}
|
|
|
|
void tint_discard_func() {
|
|
discard;
|
|
}
|
|
|
|
void main() {
|
|
f();
|
|
if (tint_discard) {
|
|
tint_discard_func();
|
|
return;
|
|
}
|
|
return;
|
|
}
|