mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-08 13:14:56 +00:00
[Validation] v-0006: variables must be defined before use
Bug:tint 6 Change-Id: I22f3117a8d59eaba97166de1f188156a9e3cd7a0 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26381 Reviewed-by: David Neto <dneto@google.com> Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
This commit is contained in:
23
test/undefined-variable-global-scope.wgsl
Normal file
23
test/undefined-variable-global-scope.wgsl
Normal file
@@ -0,0 +1,23 @@
|
||||
# Copyright 2020 The Tint Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Vertex shader
|
||||
var<private> a : i32;
|
||||
|
||||
fn main() -> void {
|
||||
a = 2;
|
||||
return;
|
||||
}
|
||||
entry_point vertex as "main" = main;
|
||||
|
||||
20
test/undefined-variable-inner-block.wgsl
Normal file
20
test/undefined-variable-inner-block.wgsl
Normal file
@@ -0,0 +1,20 @@
|
||||
# Copyright 2020 The Tint Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
fn main() -> void {
|
||||
var a : f32 = 2.0;
|
||||
{ a = 3.14;}
|
||||
return;
|
||||
}
|
||||
entry_point fragment = main;
|
||||
Reference in New Issue
Block a user