-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wgsl-in] Don't allow redefinition of module scope identifiers
- Loading branch information
Showing
9 changed files
with
200 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
// Global variable & constant declarations | ||
|
||
let Foo: bool = true; | ||
|
||
var<workgroup> wg : array<f32, 10u>; | ||
var<workgroup> at: atomic<u32>; | ||
|
||
[[stage(compute), workgroup_size(1)]] | ||
fn main() { | ||
wg[3] = 1.0; | ||
atomicStore(&at, 2u); | ||
} | ||
// Global variable & constant declarations | ||
|
||
let Foo: bool = true; | ||
|
||
var<workgroup> wg : array<f32, 10u>; | ||
var<workgroup> at: atomic<u32>; | ||
|
||
[[stage(compute), workgroup_size(1)]] | ||
fn main() { | ||
wg[3] = 1.0; | ||
atomicStore(&at, 2u); | ||
|
||
// Valid, Foo and at is in function scope | ||
var Foo: f32 = 1.0; | ||
var at: bool = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
static const bool Foo = true; | ||
static const bool Foo_1 = true; | ||
|
||
groupshared float wg[10]; | ||
groupshared uint at; | ||
groupshared uint at_1; | ||
|
||
[numthreads(1, 1, 1)] | ||
void main() | ||
{ | ||
float Foo = 1.0; | ||
bool at = true; | ||
|
||
wg[3] = 1.0; | ||
at = 2u; | ||
at_1 = 2u; | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
let Foo: bool = true; | ||
let Foo_1: bool = true; | ||
|
||
var<workgroup> wg: array<f32,10u>; | ||
var<workgroup> at: atomic<u32>; | ||
var<workgroup> at_1: atomic<u32>; | ||
|
||
[[stage(compute), workgroup_size(1, 1, 1)]] | ||
fn main() { | ||
var Foo: f32 = 1.0; | ||
var at: bool = true; | ||
|
||
wg[3] = 1.0; | ||
atomicStore((&at), 2u); | ||
atomicStore((&at_1), 2u); | ||
return; | ||
} |
Oops, something went wrong.