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

@@ -42,7 +42,7 @@ error: Opcode GroupNonUniformFAdd requires one of these capabilities: GroupNonUn
MemberDecorate 28(Buffers) 1 Offset 16
MemberDecorate 28(Buffers) 2 Offset 32
MemberDecorate 28(Buffers) 3 Offset 64
Decorate 28(Buffers) BufferBlock
Decorate 28(Buffers) Block
Decorate 31(data) DescriptorSet 0
Decorate 31(data) Binding 0
Decorate 2505 BuiltIn WorkgroupSize
@@ -64,28 +64,28 @@ error: Opcode GroupNonUniformFAdd requires one of these capabilities: GroupNonUn
27: TypeVector 26(float64_t) 4
28(Buffers): TypeStruct 23(fvec4) 25(ivec4) 17(ivec4) 27(f64vec4)
29: TypeArray 28(Buffers) 15
30: TypePointer Uniform 29
31(data): 30(ptr) Variable Uniform
30: TypePointer StorageBuffer 29
31(data): 30(ptr) Variable StorageBuffer
33: 24(int) Constant 2
34: 24(int) Constant 0
35: 6(int) Constant 0
36: TypePointer Uniform 22(float)
40: TypePointer Uniform 17(ivec4)
36: TypePointer StorageBuffer 22(float)
40: TypePointer StorageBuffer 17(ivec4)
43: TypeVector 22(float) 2
44: TypePointer Uniform 23(fvec4)
44: TypePointer StorageBuffer 23(fvec4)
51: TypeVector 22(float) 3
63: 24(int) Constant 1
64: TypePointer Uniform 24(int)
64: TypePointer StorageBuffer 24(int)
70: TypeVector 24(int) 2
71: TypePointer Uniform 25(ivec4)
71: TypePointer StorageBuffer 25(ivec4)
78: TypeVector 24(int) 3
90: TypePointer Uniform 6(int)
90: TypePointer StorageBuffer 6(int)
96: TypeVector 6(int) 2
103: TypeVector 6(int) 3
115: 24(int) Constant 3
116: TypePointer Uniform 26(float64_t)
116: TypePointer StorageBuffer 26(float64_t)
122: TypeVector 26(float64_t) 2
123: TypePointer Uniform 27(f64vec4)
123: TypePointer StorageBuffer 27(f64vec4)
130: TypeVector 26(float64_t) 3
144: TypeBool
152: TypeVector 144(bool) 2