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

@ -36,7 +36,7 @@ spv.subgroupArithmetic.comp
MemberDecorate 24(Buffers) 1 Offset 16
MemberDecorate 24(Buffers) 2 Offset 32
MemberDecorate 24(Buffers) 3 Offset 64
Decorate 24(Buffers) BufferBlock
Decorate 24(Buffers) Block
Decorate 27(data) DescriptorSet 0
Decorate 27(data) Binding 0
Decorate 2084 BuiltIn WorkgroupSize
@ -57,29 +57,29 @@ spv.subgroupArithmetic.comp
23: TypeVector 22(float64_t) 4
24(Buffers): TypeStruct 18(fvec4) 20(ivec4) 21(ivec4) 23(f64vec4)
25: TypeArray 24(Buffers) 15
26: TypePointer Uniform 25
27(data): 26(ptr) Variable Uniform
26: TypePointer StorageBuffer 25
27(data): 26(ptr) Variable StorageBuffer
29: 19(int) Constant 0
30: 6(int) Constant 0
31: TypePointer Uniform 17(float)
31: TypePointer StorageBuffer 17(float)
34: 6(int) Constant 3
38: 19(int) Constant 1
39: TypeVector 17(float) 2
40: TypePointer Uniform 18(fvec4)
40: TypePointer StorageBuffer 18(fvec4)
49: 19(int) Constant 2
50: TypeVector 17(float) 3
59: 19(int) Constant 3
65: TypePointer Uniform 19(int)
65: TypePointer StorageBuffer 19(int)
71: TypeVector 19(int) 2
72: TypePointer Uniform 20(ivec4)
72: TypePointer StorageBuffer 20(ivec4)
81: TypeVector 19(int) 3
95: TypePointer Uniform 6(int)
95: TypePointer StorageBuffer 6(int)
101: TypeVector 6(int) 2
102: TypePointer Uniform 21(ivec4)
102: TypePointer StorageBuffer 21(ivec4)
111: TypeVector 6(int) 3
125: TypePointer Uniform 22(float64_t)
125: TypePointer StorageBuffer 22(float64_t)
131: TypeVector 22(float64_t) 2
132: TypePointer Uniform 23(f64vec4)
132: TypePointer StorageBuffer 23(f64vec4)
141: TypeVector 22(float64_t) 3
521: TypeBool
530: 71(ivec2) ConstantComposite 29 29