Fix 8-bit storage nearly always using the

UniformAndStorageBuffer8BitAccess capability.

When using the 8-bit storage extension it basically always used the
`UniformAndStorageBuffer8BitAccess` capability, even in cases where it
wasn't required. For instance if we are targeting Vulkan 1.1 (SPIR-V 1.3
or higher), and we are only using 8-bit types in an SSBO, we only need
the `StorageBuffer8BitAccess` capability.

I fixed this by enabling storage buffer use in Vulkan 1.1 / SPIR-V 1.3
or higher, and then changing the logic to match.

I also added some tests that will output different capabilities when run
on Vulkan 1.0 and 1.1, thus they are added twice to the test list (one
for each version).

Fixes #1539
This commit is contained in:
Neil Henning 2018-10-23 15:02:29 +01:00
parent a08f465d53
commit b6b01f067b
27 changed files with 404 additions and 112 deletions

View file

@ -21,7 +21,7 @@ spv.subgroupBasic.comp
Name 25 "gl_SubgroupID"
Decorate 7 ArrayStride 4
MemberDecorate 8(Buffer) 0 Offset 0
Decorate 8(Buffer) BufferBlock
Decorate 8(Buffer) Block
Decorate 10(data) DescriptorSet 0
Decorate 10(data) Binding 0
Decorate 14(gl_SubgroupSize) RelaxedPrecision
@ -38,14 +38,14 @@ spv.subgroupBasic.comp
6: TypeInt 32 1
7: TypeRuntimeArray 6(int)
8(Buffer): TypeStruct 7
9: TypePointer Uniform 8(Buffer)
10(data): 9(ptr) Variable Uniform
9: TypePointer StorageBuffer 8(Buffer)
10(data): 9(ptr) Variable StorageBuffer
11: 6(int) Constant 0
12: TypeInt 32 0
13: TypePointer Input 12(int)
14(gl_SubgroupSize): 13(ptr) Variable Input
16: 6(int) Constant 1
17: TypePointer Uniform 6(int)
17: TypePointer StorageBuffer 6(int)
19(gl_SubgroupInvocationID): 13(ptr) Variable Input
22(gl_NumSubgroups): 13(ptr) Variable Input
25(gl_SubgroupID): 13(ptr) Variable Input