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.
Correctly reflect declared buffer size for out of order members.
Need to deduce size based on member with highest offset, not highest index.
- Loading branch information
1 parent
04293e0
commit 05e8e5a
Showing
3 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
reference/shaders-reflection/comp/out-of-order-block-offsets.comp.json
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,44 @@ | ||
{ | ||
"entryPoints" : [ | ||
{ | ||
"name" : "main", | ||
"mode" : "comp", | ||
"workgroup_size" : [ | ||
1, | ||
1, | ||
1 | ||
], | ||
"workgroup_size_is_spec_constant_id" : [ | ||
false, | ||
false, | ||
false | ||
] | ||
} | ||
], | ||
"types" : { | ||
"_7" : { | ||
"name" : "SSBO", | ||
"members" : [ | ||
{ | ||
"name" : "foo", | ||
"type" : "uint", | ||
"offset" : 8 | ||
}, | ||
{ | ||
"name" : "bar", | ||
"type" : "uint", | ||
"offset" : 4 | ||
} | ||
] | ||
} | ||
}, | ||
"ssbos" : [ | ||
{ | ||
"type" : "_7", | ||
"name" : "SSBO", | ||
"block_size" : 12, | ||
"set" : 0, | ||
"binding" : 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#version 450 | ||
|
||
layout(set = 0, binding = 0) buffer SSBO | ||
{ | ||
layout(offset = 8) uint foo; | ||
layout(offset = 4) uint bar; | ||
}; | ||
|
||
void main() | ||
{ | ||
bar = foo; | ||
} |
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