[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:
Sarah Mashayekhi
2020-08-06 21:24:14 +00:00
parent 6eb2a85adf
commit 65f88d6f1d
5 changed files with 370 additions and 17 deletions

View 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;

View 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;