Add a test for 8- and 16-bit construction.

This commit is contained in:
Andreas Flöjt 2019-11-14 14:41:52 +01:00
parent 1b93de4f1d
commit cb563e68d2
4 changed files with 107 additions and 1 deletions

View File

@ -0,0 +1,82 @@
spv.8bit-16bit-construction.frag
Validation failed
// Module Version 10000
// Generated by (magic number): 80008
// Id's are bound by 43
Capability Shader
Capability StorageUniformBufferBlock16
Capability UniformAndStorageBuffer8BitAccess
Extension "SPV_KHR_16bit_storage"
Extension "SPV_KHR_8bit_storage"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_EXT_shader_16bit_storage"
SourceExtension "GL_EXT_shader_8bit_storage"
Name 4 "main"
Name 11 "B"
MemberName 11(B) 0 "i8_from_i16"
MemberName 11(B) 1 "i16_from_i8"
MemberName 11(B) 2 "u8_from_u16"
MemberName 11(B) 3 "u16_from_u8"
MemberName 11(B) 4 "f16_from_i8"
Name 13 ""
MemberDecorate 11(B) 0 Offset 0
MemberDecorate 11(B) 1 Offset 2
MemberDecorate 11(B) 2 Offset 4
MemberDecorate 11(B) 3 Offset 6
MemberDecorate 11(B) 4 Offset 8
Decorate 11(B) BufferBlock
Decorate 13 DescriptorSet 0
Decorate 13 Binding 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 8 1
7: TypeInt 16 1
8: TypeInt 8 0
9: TypeInt 16 0
10: TypeFloat 16
11(B): TypeStruct 6(int8_t) 7(int16_t) 8(int8_t) 9(int16_t) 10(float16_t)
12: TypePointer Uniform 11(B)
13: 12(ptr) Variable Uniform
14: TypeInt 32 1
15: 14(int) Constant 0
16: 14(int) Constant 1
19: TypePointer Uniform 6(int8_t)
23: TypePointer Uniform 7(int16_t)
25: 14(int) Constant 2
26: TypeInt 32 0
27: 26(int) Constant 1
30: TypePointer Uniform 8(int8_t)
32: 14(int) Constant 3
35: TypePointer Uniform 9(int16_t)
37: 14(int) Constant 4
39: TypeFloat 32
41: TypePointer Uniform 10(float16_t)
4(main): 2 Function None 3
5: Label
17: 7(int16_t) SConvert 16
18: 6(int8_t) SConvert 17
20: 19(ptr) AccessChain 13 15
Store 20 18
21: 6(int8_t) SConvert 16
22: 7(int16_t) SConvert 21
24: 23(ptr) AccessChain 13 16
Store 24 22
28: 9(int16_t) UConvert 27
29: 8(int8_t) UConvert 28
31: 30(ptr) AccessChain 13 25
Store 31 29
33: 8(int8_t) UConvert 27
34: 9(int16_t) UConvert 33
36: 35(ptr) AccessChain 13 32
Store 36 34
38: 6(int8_t) SConvert 16
40:10(float16_t) FConvert 38
42: 41(ptr) AccessChain 13 37
Store 42 40
Return
FunctionEnd

View File

@ -0,0 +1,22 @@
#version 450 core
#extension GL_EXT_shader_8bit_storage : enable
#extension GL_EXT_shader_16bit_storage : enable
buffer B
{
int8_t i8_from_i16;
int16_t i16_from_i8;
uint8_t u8_from_u16;
uint16_t u16_from_u8;
float16_t f16_from_i8;
};
void main()
{
i8_from_i16 = int8_t(int16_t(1));
i16_from_i8 = int16_t(int8_t(1));
u8_from_u16 = uint8_t(uint16_t(1));
u16_from_u8 = uint16_t(uint8_t(1));
f16_from_i8 = float16_t(int8_t(1));
}

View File

@ -2,7 +2,7 @@
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
// Copyright (C) 2012-2015 LunarG, Inc.
// Copyright (C) 2015-2018 Google, Inc.
// Copyright (C) 2017 ARM Limited.
// Copyright (C) 2017, 2019 ARM Limited.
//
// All rights reserved.
//

View File

@ -1,5 +1,6 @@
//
// Copyright (C) 2016 Google, Inc.
// Copyright (C) 2019 ARM Limited.
//
// All rights reserved.
//
@ -263,6 +264,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.8bitstorage_Error-uint.frag",
"spv.8bitstorage-ubo.vert",
"spv.8bitstorage-ssbo.vert",
"spv.8bit-16bit-construction.frag",
"spv.accessChain.frag",
"spv.aggOps.frag",
"spv.always-discard.frag",