-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
glsl-in: Allow nested accesses in lhs positions
Also fixes access to runtime sized arrays behind named blocks
- Loading branch information
Showing
8 changed files
with
168 additions
and
65 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#version 450 | ||
|
||
layout(set = 0, binding = 0) buffer testBufferBlock { | ||
uint[] data; | ||
} testBuffer; | ||
|
||
layout(set = 0, binding = 1) writeonly buffer testBufferWriteOnlyBlock { | ||
uint[] data; | ||
} testBufferWriteOnly; | ||
|
||
layout(set = 0, binding = 2) readonly buffer testBufferReadOnlyBlock { | ||
uint[] data; | ||
} testBufferReadOnly; | ||
|
||
void main() { | ||
uint a = testBuffer.data[0]; | ||
testBuffer.data[1] = 2; | ||
|
||
testBufferWriteOnly.data[1] = 2; | ||
|
||
uint b = testBufferReadOnly.data[0]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
struct testBufferBlock { | ||
data: array<u32>, | ||
} | ||
|
||
struct testBufferWriteOnlyBlock { | ||
data: array<u32>, | ||
} | ||
|
||
struct testBufferReadOnlyBlock { | ||
data: array<u32>, | ||
} | ||
|
||
@group(0) @binding(0) | ||
var<storage, read_write> testBuffer: testBufferBlock; | ||
@group(0) @binding(1) | ||
var<storage, read_write> testBufferWriteOnly: testBufferWriteOnlyBlock; | ||
@group(0) @binding(2) | ||
var<storage> testBufferReadOnly: testBufferReadOnlyBlock; | ||
|
||
fn main_1() { | ||
var a: u32; | ||
var b: u32; | ||
|
||
let _e12 = testBuffer.data[0]; | ||
a = _e12; | ||
testBuffer.data[1] = u32(2); | ||
testBufferWriteOnly.data[1] = u32(2); | ||
let _e27 = testBufferReadOnly.data[0]; | ||
b = _e27; | ||
return; | ||
} | ||
|
||
@stage(fragment) | ||
fn main() { | ||
main_1(); | ||
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
Oops, something went wrong.