forked from KhronosGroup/SPIRV-Cross
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unroll, when storing to pointer to array
#fixed KhronosGroup#2196
- Loading branch information
Showing
3 changed files
with
47 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
struct Data | ||
{ | ||
uint arr[3]; | ||
}; | ||
|
||
RWByteAddressBuffer _13 : register(u0); | ||
|
||
void comp_main() | ||
{ | ||
Data d1; | ||
[unroll] | ||
for (int _0ident = 0; _0ident < 3; _0ident++) | ||
{ | ||
_13.Store(_0ident * 4 + 0, d1.arr[_0ident]); | ||
} | ||
} | ||
|
||
[numthreads(1, 1, 1)] | ||
void main() | ||
{ | ||
comp_main(); | ||
} |
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,19 @@ | ||
#version 460 | ||
|
||
struct Data | ||
{ | ||
uint arr[3]; | ||
}; | ||
|
||
layout(set = 0, binding = 0, std430) buffer B0 | ||
{ | ||
Data d[]; | ||
}; | ||
|
||
void main() | ||
{ | ||
Data d1; | ||
d[0].arr = d1.arr; | ||
} | ||
|
||
|
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