diff --git a/cube/android/CMakeLists.txt b/cube/android/CMakeLists.txt index 22900d782..66f75b424 100644 --- a/cube/android/CMakeLists.txt +++ b/cube/android/CMakeLists.txt @@ -21,7 +21,6 @@ target_sources(vkcube PRIVATE ) target_include_directories(vkcube PRIVATE - include . ) diff --git a/cube/android/include/cube.frag.h b/cube/android/include/cube.frag.h deleted file mode 100644 index 1e6fd4af1..000000000 --- a/cube/android/include/cube.frag.h +++ /dev/null @@ -1,73 +0,0 @@ -#include - -#if 0 -../cube.frag -Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. - - -Linked fragment stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 21 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 9 16 - ExecutionMode 4 OriginUpperLeft - Source GLSL 400 - SourceExtension "GL_ARB_separate_shader_objects" - SourceExtension "GL_ARB_shading_language_420pack" - Name 4 "main" - Name 9 "uFragColor" - Name 13 "tex" - Name 16 "texcoord" - Decorate 9(uFragColor) Location 0 - Decorate 13(tex) DescriptorSet 0 - Decorate 13(tex) Binding 1 - Decorate 16(texcoord) Location 0 - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeFloat 32 - 7: TypeVector 6(float) 4 - 8: TypePointer Output 7(fvec4) - 9(uFragColor): 8(ptr) Variable Output - 10: TypeImage 6(float) 2D sampled format:Unknown - 11: TypeSampledImage 10 - 12: TypePointer UniformConstant 11 - 13(tex): 12(ptr) Variable UniformConstant - 15: TypePointer Input 7(fvec4) - 16(texcoord): 15(ptr) Variable Input - 17: TypeVector 6(float) 2 - 4(main): 2 Function None 3 - 5: Label - 14: 11 Load 13(tex) - 18: 7(fvec4) Load 16(texcoord) - 19: 17(fvec2) VectorShuffle 18 18 0 1 - 20: 7(fvec4) ImageSampleImplicitLod 14 19 - Store 9(uFragColor) 20 - Return - FunctionEnd -#endif - -static const uint32_t cube_frag[164] = { - 0x07230203, 0x00010000, 0x00080001, 0x00000015, 0x00000000, 0x00020011, 0x00000001, 0x0006000b, 0x00000001, 0x4c534c47, - 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001, 0x0007000f, 0x00000004, 0x00000004, 0x6e69616d, - 0x00000000, 0x00000009, 0x00000010, 0x00030010, 0x00000004, 0x00000007, 0x00030003, 0x00000002, 0x00000190, 0x00090004, - 0x415f4c47, 0x735f4252, 0x72617065, 0x5f657461, 0x64616873, 0x6f5f7265, 0x63656a62, 0x00007374, 0x00090004, 0x415f4c47, - 0x735f4252, 0x69646168, 0x6c5f676e, 0x75676e61, 0x5f656761, 0x70303234, 0x006b6361, 0x00040005, 0x00000004, 0x6e69616d, - 0x00000000, 0x00050005, 0x00000009, 0x61724675, 0x6c6f4367, 0x0000726f, 0x00030005, 0x0000000d, 0x00786574, 0x00050005, - 0x00000010, 0x63786574, 0x64726f6f, 0x00000000, 0x00040047, 0x00000009, 0x0000001e, 0x00000000, 0x00040047, 0x0000000d, - 0x00000022, 0x00000000, 0x00040047, 0x0000000d, 0x00000021, 0x00000001, 0x00040047, 0x00000010, 0x0000001e, 0x00000000, - 0x00020013, 0x00000002, 0x00030021, 0x00000003, 0x00000002, 0x00030016, 0x00000006, 0x00000020, 0x00040017, 0x00000007, - 0x00000006, 0x00000004, 0x00040020, 0x00000008, 0x00000003, 0x00000007, 0x0004003b, 0x00000008, 0x00000009, 0x00000003, - 0x00090019, 0x0000000a, 0x00000006, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x0003001b, - 0x0000000b, 0x0000000a, 0x00040020, 0x0000000c, 0x00000000, 0x0000000b, 0x0004003b, 0x0000000c, 0x0000000d, 0x00000000, - 0x00040020, 0x0000000f, 0x00000001, 0x00000007, 0x0004003b, 0x0000000f, 0x00000010, 0x00000001, 0x00040017, 0x00000011, - 0x00000006, 0x00000002, 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003d, - 0x0000000b, 0x0000000e, 0x0000000d, 0x0004003d, 0x00000007, 0x00000012, 0x00000010, 0x0007004f, 0x00000011, 0x00000013, - 0x00000012, 0x00000012, 0x00000000, 0x00000001, 0x00050057, 0x00000007, 0x00000014, 0x0000000e, 0x00000013, 0x0003003e, - 0x00000009, 0x00000014, 0x000100fd, 0x00010038, -}; diff --git a/cube/android/include/cube.frag.inc b/cube/android/include/cube.frag.inc deleted file mode 100644 index e80adbb71..000000000 --- a/cube/android/include/cube.frag.inc +++ /dev/null @@ -1,22 +0,0 @@ - // Overload400-PrecQual.2000 12-Apr-2017 - 0x07230203,0x00010000,0x00080002,0x00000015,0x00000000,0x00020011,0x00000001,0x0006000b, - 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, - 0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000010,0x00030010, - 0x00000004,0x00000007,0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252, - 0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004,0x415f4c47, - 0x735f4252,0x69646168,0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361,0x00040005, - 0x00000004,0x6e69616d,0x00000000,0x00050005,0x00000009,0x61724675,0x6c6f4367,0x0000726f, - 0x00030005,0x0000000d,0x00786574,0x00050005,0x00000010,0x63786574,0x64726f6f,0x00000000, - 0x00040047,0x00000009,0x0000001e,0x00000000,0x00040047,0x0000000d,0x00000022,0x00000000, - 0x00040047,0x0000000d,0x00000021,0x00000001,0x00040047,0x00000010,0x0000001e,0x00000000, - 0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020, - 0x00040017,0x00000007,0x00000006,0x00000004,0x00040020,0x00000008,0x00000003,0x00000007, - 0x0004003b,0x00000008,0x00000009,0x00000003,0x00090019,0x0000000a,0x00000006,0x00000001, - 0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x0000000b,0x0000000a, - 0x00040020,0x0000000c,0x00000000,0x0000000b,0x0004003b,0x0000000c,0x0000000d,0x00000000, - 0x00040020,0x0000000f,0x00000001,0x00000007,0x0004003b,0x0000000f,0x00000010,0x00000001, - 0x00040017,0x00000011,0x00000006,0x00000002,0x00050036,0x00000002,0x00000004,0x00000000, - 0x00000003,0x000200f8,0x00000005,0x0004003d,0x0000000b,0x0000000e,0x0000000d,0x0004003d, - 0x00000007,0x00000012,0x00000010,0x0007004f,0x00000011,0x00000013,0x00000012,0x00000012, - 0x00000000,0x00000001,0x00050057,0x00000007,0x00000014,0x0000000e,0x00000013,0x0003003e, - 0x00000009,0x00000014,0x000100fd,0x00010038 diff --git a/cube/android/include/cube.vert.h b/cube/android/include/cube.vert.h deleted file mode 100644 index 4e349e78e..000000000 --- a/cube/android/include/cube.vert.h +++ /dev/null @@ -1,149 +0,0 @@ -#include - -#if 0 -../cube.vert -Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. - - -Linked vertex stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 55 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 9 21 28 - Source GLSL 400 - SourceExtension "GL_ARB_separate_shader_objects" - SourceExtension "GL_ARB_shading_language_420pack" - Name 4 "main" - Name 9 "texcoord" - Name 15 "buf" - MemberName 15(buf) 0 "MVP" - MemberName 15(buf) 1 "position" - MemberName 15(buf) 2 "attr" - Name 17 "ubuf" - Name 21 "gl_VertexIndex" - Name 26 "gl_PerVertex" - MemberName 26(gl_PerVertex) 0 "gl_Position" - Name 28 "" - Decorate 9(texcoord) Location 0 - Decorate 13 ArrayStride 16 - Decorate 14 ArrayStride 16 - MemberDecorate 15(buf) 0 ColMajor - MemberDecorate 15(buf) 0 Offset 0 - MemberDecorate 15(buf) 0 MatrixStride 16 - MemberDecorate 15(buf) 1 Offset 64 - MemberDecorate 15(buf) 2 Offset 640 - Decorate 15(buf) Block - Decorate 17(ubuf) DescriptorSet 0 - Decorate 17(ubuf) Binding 0 - Decorate 21(gl_VertexIndex) BuiltIn VertexIndex - MemberDecorate 26(gl_PerVertex) 0 BuiltIn Position - Decorate 26(gl_PerVertex) Block - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeFloat 32 - 7: TypeVector 6(float) 4 - 8: TypePointer Output 7(fvec4) - 9(texcoord): 8(ptr) Variable Output - 10: TypeMatrix 7(fvec4) 4 - 11: TypeInt 32 0 - 12: 11(int) Constant 36 - 13: TypeArray 7(fvec4) 12 - 14: TypeArray 7(fvec4) 12 - 15(buf): TypeStruct 10 13 14 - 16: TypePointer Uniform 15(buf) - 17(ubuf): 16(ptr) Variable Uniform - 18: TypeInt 32 1 - 19: 18(int) Constant 2 - 20: TypePointer Input 18(int) -21(gl_VertexIndex): 20(ptr) Variable Input - 23: TypePointer Uniform 7(fvec4) -26(gl_PerVertex): TypeStruct 7(fvec4) - 27: TypePointer Output 26(gl_PerVertex) - 28: 27(ptr) Variable Output - 29: 18(int) Constant 0 - 30: TypePointer Uniform 10 - 33: 18(int) Constant 1 - 39: 11(int) Constant 1 - 40: TypePointer Output 6(float) - 45: 11(int) Constant 2 - 48: 11(int) Constant 3 - 52: 6(float) Constant 1073741824 - 4(main): 2 Function None 3 - 5: Label - 22: 18(int) Load 21(gl_VertexIndex) - 24: 23(ptr) AccessChain 17(ubuf) 19 22 - 25: 7(fvec4) Load 24 - Store 9(texcoord) 25 - 31: 30(ptr) AccessChain 17(ubuf) 29 - 32: 10 Load 31 - 34: 18(int) Load 21(gl_VertexIndex) - 35: 23(ptr) AccessChain 17(ubuf) 33 34 - 36: 7(fvec4) Load 35 - 37: 7(fvec4) MatrixTimesVector 32 36 - 38: 8(ptr) AccessChain 28 29 - Store 38 37 - 41: 40(ptr) AccessChain 28 29 39 - 42: 6(float) Load 41 - 43: 6(float) FNegate 42 - 44: 40(ptr) AccessChain 28 29 39 - Store 44 43 - 46: 40(ptr) AccessChain 28 29 45 - 47: 6(float) Load 46 - 49: 40(ptr) AccessChain 28 29 48 - 50: 6(float) Load 49 - 51: 6(float) FAdd 47 50 - 53: 6(float) FDiv 51 52 - 54: 40(ptr) AccessChain 28 29 45 - Store 54 53 - Return - FunctionEnd -#endif - -static const uint32_t cube_vert[396] = { - 0x07230203, 0x00010000, 0x00080001, 0x00000037, 0x00000000, 0x00020011, 0x00000001, 0x0006000b, 0x00000001, 0x4c534c47, - 0x6474732e, 0x3035342e, 0x00000000, 0x0003000e, 0x00000000, 0x00000001, 0x0008000f, 0x00000000, 0x00000004, 0x6e69616d, - 0x00000000, 0x00000009, 0x00000015, 0x0000001c, 0x00030003, 0x00000002, 0x00000190, 0x00090004, 0x415f4c47, 0x735f4252, - 0x72617065, 0x5f657461, 0x64616873, 0x6f5f7265, 0x63656a62, 0x00007374, 0x00090004, 0x415f4c47, 0x735f4252, 0x69646168, - 0x6c5f676e, 0x75676e61, 0x5f656761, 0x70303234, 0x006b6361, 0x00040005, 0x00000004, 0x6e69616d, 0x00000000, 0x00050005, - 0x00000009, 0x63786574, 0x64726f6f, 0x00000000, 0x00030005, 0x0000000f, 0x00667562, 0x00040006, 0x0000000f, 0x00000000, - 0x0050564d, 0x00060006, 0x0000000f, 0x00000001, 0x69736f70, 0x6e6f6974, 0x00000000, 0x00050006, 0x0000000f, 0x00000002, - 0x72747461, 0x00000000, 0x00040005, 0x00000011, 0x66756275, 0x00000000, 0x00060005, 0x00000015, 0x565f6c67, 0x65747265, - 0x646e4978, 0x00007865, 0x00060005, 0x0000001a, 0x505f6c67, 0x65567265, 0x78657472, 0x00000000, 0x00060006, 0x0000001a, - 0x00000000, 0x505f6c67, 0x7469736f, 0x006e6f69, 0x00030005, 0x0000001c, 0x00000000, 0x00040047, 0x00000009, 0x0000001e, - 0x00000000, 0x00040047, 0x0000000d, 0x00000006, 0x00000010, 0x00040047, 0x0000000e, 0x00000006, 0x00000010, 0x00040048, - 0x0000000f, 0x00000000, 0x00000005, 0x00050048, 0x0000000f, 0x00000000, 0x00000023, 0x00000000, 0x00050048, 0x0000000f, - 0x00000000, 0x00000007, 0x00000010, 0x00050048, 0x0000000f, 0x00000001, 0x00000023, 0x00000040, 0x00050048, 0x0000000f, - 0x00000002, 0x00000023, 0x00000280, 0x00030047, 0x0000000f, 0x00000002, 0x00040047, 0x00000011, 0x00000022, 0x00000000, - 0x00040047, 0x00000011, 0x00000021, 0x00000000, 0x00040047, 0x00000015, 0x0000000b, 0x0000002a, 0x00050048, 0x0000001a, - 0x00000000, 0x0000000b, 0x00000000, 0x00030047, 0x0000001a, 0x00000002, 0x00020013, 0x00000002, 0x00030021, 0x00000003, - 0x00000002, 0x00030016, 0x00000006, 0x00000020, 0x00040017, 0x00000007, 0x00000006, 0x00000004, 0x00040020, 0x00000008, - 0x00000003, 0x00000007, 0x0004003b, 0x00000008, 0x00000009, 0x00000003, 0x00040018, 0x0000000a, 0x00000007, 0x00000004, - 0x00040015, 0x0000000b, 0x00000020, 0x00000000, 0x0004002b, 0x0000000b, 0x0000000c, 0x00000024, 0x0004001c, 0x0000000d, - 0x00000007, 0x0000000c, 0x0004001c, 0x0000000e, 0x00000007, 0x0000000c, 0x0005001e, 0x0000000f, 0x0000000a, 0x0000000d, - 0x0000000e, 0x00040020, 0x00000010, 0x00000002, 0x0000000f, 0x0004003b, 0x00000010, 0x00000011, 0x00000002, 0x00040015, - 0x00000012, 0x00000020, 0x00000001, 0x0004002b, 0x00000012, 0x00000013, 0x00000002, 0x00040020, 0x00000014, 0x00000001, - 0x00000012, 0x0004003b, 0x00000014, 0x00000015, 0x00000001, 0x00040020, 0x00000017, 0x00000002, 0x00000007, 0x0003001e, - 0x0000001a, 0x00000007, 0x00040020, 0x0000001b, 0x00000003, 0x0000001a, 0x0004003b, 0x0000001b, 0x0000001c, 0x00000003, - 0x0004002b, 0x00000012, 0x0000001d, 0x00000000, 0x00040020, 0x0000001e, 0x00000002, 0x0000000a, 0x0004002b, 0x00000012, - 0x00000021, 0x00000001, 0x0004002b, 0x0000000b, 0x00000027, 0x00000001, 0x00040020, 0x00000028, 0x00000003, 0x00000006, - 0x0004002b, 0x0000000b, 0x0000002d, 0x00000002, 0x0004002b, 0x0000000b, 0x00000030, 0x00000003, 0x0004002b, 0x00000006, - 0x00000034, 0x40000000, 0x00050036, 0x00000002, 0x00000004, 0x00000000, 0x00000003, 0x000200f8, 0x00000005, 0x0004003d, - 0x00000012, 0x00000016, 0x00000015, 0x00060041, 0x00000017, 0x00000018, 0x00000011, 0x00000013, 0x00000016, 0x0004003d, - 0x00000007, 0x00000019, 0x00000018, 0x0003003e, 0x00000009, 0x00000019, 0x00050041, 0x0000001e, 0x0000001f, 0x00000011, - 0x0000001d, 0x0004003d, 0x0000000a, 0x00000020, 0x0000001f, 0x0004003d, 0x00000012, 0x00000022, 0x00000015, 0x00060041, - 0x00000017, 0x00000023, 0x00000011, 0x00000021, 0x00000022, 0x0004003d, 0x00000007, 0x00000024, 0x00000023, 0x00050091, - 0x00000007, 0x00000025, 0x00000020, 0x00000024, 0x00050041, 0x00000008, 0x00000026, 0x0000001c, 0x0000001d, 0x0003003e, - 0x00000026, 0x00000025, 0x00060041, 0x00000028, 0x00000029, 0x0000001c, 0x0000001d, 0x00000027, 0x0004003d, 0x00000006, - 0x0000002a, 0x00000029, 0x0004007f, 0x00000006, 0x0000002b, 0x0000002a, 0x00060041, 0x00000028, 0x0000002c, 0x0000001c, - 0x0000001d, 0x00000027, 0x0003003e, 0x0000002c, 0x0000002b, 0x00060041, 0x00000028, 0x0000002e, 0x0000001c, 0x0000001d, - 0x0000002d, 0x0004003d, 0x00000006, 0x0000002f, 0x0000002e, 0x00060041, 0x00000028, 0x00000031, 0x0000001c, 0x0000001d, - 0x00000030, 0x0004003d, 0x00000006, 0x00000032, 0x00000031, 0x00050081, 0x00000006, 0x00000033, 0x0000002f, 0x00000032, - 0x00050088, 0x00000006, 0x00000035, 0x00000033, 0x00000034, 0x00060041, 0x00000028, 0x00000036, 0x0000001c, 0x0000001d, - 0x0000002d, 0x0003003e, 0x00000036, 0x00000035, 0x000100fd, 0x00010038, -}; diff --git a/cube/android/include/cube.vert.inc b/cube/android/include/cube.vert.inc deleted file mode 100644 index bbfc19287..000000000 --- a/cube/android/include/cube.vert.inc +++ /dev/null @@ -1,45 +0,0 @@ - // Overload400-PrecQual.2000 12-Apr-2017 - 0x07230203,0x00010000,0x00080002,0x00000029,0x00000000,0x00020011,0x00000001,0x0006000b, - 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, - 0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000015,0x0000001e, - 0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461, - 0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004,0x415f4c47,0x735f4252,0x69646168, - 0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361,0x00040005,0x00000004,0x6e69616d, - 0x00000000,0x00050005,0x00000009,0x63786574,0x64726f6f,0x00000000,0x00030005,0x0000000f, - 0x00667562,0x00040006,0x0000000f,0x00000000,0x0050564d,0x00060006,0x0000000f,0x00000001, - 0x69736f70,0x6e6f6974,0x00000000,0x00050006,0x0000000f,0x00000002,0x72747461,0x00000000, - 0x00040005,0x00000011,0x66756275,0x00000000,0x00060005,0x00000015,0x565f6c67,0x65747265, - 0x646e4978,0x00007865,0x00060005,0x0000001c,0x505f6c67,0x65567265,0x78657472,0x00000000, - 0x00060006,0x0000001c,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00070006,0x0000001c, - 0x00000001,0x505f6c67,0x746e696f,0x657a6953,0x00000000,0x00070006,0x0000001c,0x00000002, - 0x435f6c67,0x4470696c,0x61747369,0x0065636e,0x00030005,0x0000001e,0x00000000,0x00040047, - 0x00000009,0x0000001e,0x00000000,0x00040047,0x0000000d,0x00000006,0x00000010,0x00040047, - 0x0000000e,0x00000006,0x00000010,0x00040048,0x0000000f,0x00000000,0x00000005,0x00050048, - 0x0000000f,0x00000000,0x00000023,0x00000000,0x00050048,0x0000000f,0x00000000,0x00000007, - 0x00000010,0x00050048,0x0000000f,0x00000001,0x00000023,0x00000040,0x00050048,0x0000000f, - 0x00000002,0x00000023,0x00000280,0x00030047,0x0000000f,0x00000002,0x00040047,0x00000011, - 0x00000022,0x00000000,0x00040047,0x00000011,0x00000021,0x00000000,0x00040047,0x00000015, - 0x0000000b,0x0000002a,0x00050048,0x0000001c,0x00000000,0x0000000b,0x00000000,0x00050048, - 0x0000001c,0x00000001,0x0000000b,0x00000001,0x00050048,0x0000001c,0x00000002,0x0000000b, - 0x00000003,0x00030047,0x0000001c,0x00000002,0x00020013,0x00000002,0x00030021,0x00000003, - 0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004, - 0x00040020,0x00000008,0x00000003,0x00000007,0x0004003b,0x00000008,0x00000009,0x00000003, - 0x00040018,0x0000000a,0x00000007,0x00000004,0x00040015,0x0000000b,0x00000020,0x00000000, - 0x0004002b,0x0000000b,0x0000000c,0x00000024,0x0004001c,0x0000000d,0x00000007,0x0000000c, - 0x0004001c,0x0000000e,0x00000007,0x0000000c,0x0005001e,0x0000000f,0x0000000a,0x0000000d, - 0x0000000e,0x00040020,0x00000010,0x00000002,0x0000000f,0x0004003b,0x00000010,0x00000011, - 0x00000002,0x00040015,0x00000012,0x00000020,0x00000001,0x0004002b,0x00000012,0x00000013, - 0x00000002,0x00040020,0x00000014,0x00000001,0x00000012,0x0004003b,0x00000014,0x00000015, - 0x00000001,0x00040020,0x00000017,0x00000002,0x00000007,0x0004002b,0x0000000b,0x0000001a, - 0x00000001,0x0004001c,0x0000001b,0x00000006,0x0000001a,0x0005001e,0x0000001c,0x00000007, - 0x00000006,0x0000001b,0x00040020,0x0000001d,0x00000003,0x0000001c,0x0004003b,0x0000001d, - 0x0000001e,0x00000003,0x0004002b,0x00000012,0x0000001f,0x00000000,0x00040020,0x00000020, - 0x00000002,0x0000000a,0x0004002b,0x00000012,0x00000023,0x00000001,0x00050036,0x00000002, - 0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d,0x00000012,0x00000016, - 0x00000015,0x00060041,0x00000017,0x00000018,0x00000011,0x00000013,0x00000016,0x0004003d, - 0x00000007,0x00000019,0x00000018,0x0003003e,0x00000009,0x00000019,0x00050041,0x00000020, - 0x00000021,0x00000011,0x0000001f,0x0004003d,0x0000000a,0x00000022,0x00000021,0x0004003d, - 0x00000012,0x00000024,0x00000015,0x00060041,0x00000017,0x00000025,0x00000011,0x00000023, - 0x00000024,0x0004003d,0x00000007,0x00000026,0x00000025,0x00050091,0x00000007,0x00000027, - 0x00000022,0x00000026,0x00050041,0x00000008,0x00000028,0x0000001e,0x0000001f,0x0003003e, - 0x00000028,0x00000027,0x000100fd,0x00010038 diff --git a/cube/cube.c b/cube/cube.c index e319ee8b7..c473bbfd8 100644 --- a/cube/cube.c +++ b/cube/cube.c @@ -394,6 +394,7 @@ struct demo { VkPresentModeKHR presentMode; VkFence fences[FRAME_LAG]; int frame_index; + bool first_swapchain_frame; VkCommandPool cmd_pool; VkCommandPool present_cmd_pool; @@ -1134,10 +1135,17 @@ static void demo_draw(struct demo *demo) { uint32_t eighthOfWidth = demo->width / 8; uint32_t eighthOfHeight = demo->height / 8; - rect.offset.x = eighthOfWidth; - rect.offset.y = eighthOfHeight; - rect.extent.width = eighthOfWidth * 6; - rect.extent.height = eighthOfHeight * 6; + if (demo->first_swapchain_frame) { + rect.offset.x = 0; + rect.offset.y = 0; + rect.extent.width = demo->width; + rect.extent.height = demo->height; + } else { + rect.offset.x = eighthOfWidth; + rect.offset.y = eighthOfHeight; + rect.extent.width = eighthOfWidth * 6; + rect.extent.height = eighthOfHeight * 6; + } rect.layer = 0; region.rectangleCount = 1; @@ -1188,6 +1196,7 @@ static void demo_draw(struct demo *demo) { err = vkQueuePresentKHR(demo->present_queue, &present); demo->frame_index += 1; demo->frame_index %= FRAME_LAG; + demo->first_swapchain_frame = false; if (err == VK_ERROR_OUT_OF_DATE_KHR) { // demo->swapchain is out of date (e.g. the window was resized) and @@ -2152,8 +2161,6 @@ static void demo_prepare_pipeline(struct demo *demo) { pipeline.renderPass = demo->render_pass; pipeline.pDynamicState = &dynamicState; - pipeline.renderPass = demo->render_pass; - err = vkCreateGraphicsPipelines(demo->device, demo->pipelineCache, 1, &pipeline, NULL, &demo->pipeline); assert(!err); @@ -2359,6 +2366,7 @@ static void demo_prepare(struct demo *demo) { demo->current_buffer = 0; demo->prepared = true; + demo->first_swapchain_frame = true; } static void demo_cleanup(struct demo *demo) { @@ -2817,10 +2825,24 @@ static void demo_create_xcb_window(struct demo *demo) { #elif defined(VK_USE_PLATFORM_WAYLAND_KHR) static void demo_run(struct demo *demo) { while (!demo->quit) { + // Flush any commands to the server + wl_display_flush(demo->display); + if (demo->pause) { - wl_display_dispatch(demo->display); // block and wait for input + // block and wait for input + wl_display_dispatch(demo->display); } else { - wl_display_dispatch_pending(demo->display); // don't block + // Lock the display event queue in case the driver is doing something on another thread + // while we wait, keep pumping events + while (wl_display_prepare_read(demo->display) != 0) { + wl_display_dispatch_pending(demo->display); + } + // Actually do the read from the socket + wl_display_read_events(demo->display); + + // Pump events + wl_display_dispatch_pending(demo->display); + demo_draw(demo); demo->curFrame++; if (demo->frameCount != INT32_MAX && demo->curFrame == demo->frameCount) demo->quit = true; @@ -4009,6 +4031,7 @@ static void demo_init_vk_swapchain(struct demo *demo) { } } demo->frame_index = 0; + demo->first_swapchain_frame = true; // Get Memory information and properties vkGetPhysicalDeviceMemoryProperties(demo->gpu, &demo->memory_properties); diff --git a/cube/cube.cpp b/cube/cube.cpp index 9ed4dca4f..edefbf091 100644 --- a/cube/cube.cpp +++ b/cube/cube.cpp @@ -40,7 +40,7 @@ #define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1 #define VULKAN_HPP_NO_EXCEPTIONS -#define VULKAN_HPP_TYPESAFE_CONVERSION +#define VULKAN_HPP_TYPESAFE_CONVERSION 1 #include #define VOLK_IMPLEMENTATION diff --git a/cube/linmath.h b/cube/linmath.h index b4d386cc8..6df1d7ee6 100644 --- a/cube/linmath.h +++ b/cube/linmath.h @@ -1,501 +1,608 @@ -/* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Relicensed from the WTFPL (http://www.wtfpl.net/faq/). - */ - #ifndef LINMATH_H #define LINMATH_H +#include #include +#include -// Converts degrees to radians. -#define degreesToRadians(angleDegrees) (angleDegrees * M_PI / 180.0) - -// Converts radians to degrees. -#define radiansToDegrees(angleRadians) (angleRadians * 180.0 / M_PI) +#ifdef LINMATH_NO_INLINE +#define LINMATH_H_FUNC static +#else +#define LINMATH_H_FUNC static inline +#endif -typedef float vec3[3]; -static inline void vec3_add(vec3 r, vec3 const a, vec3 const b) { - int i; - for (i = 0; i < 3; ++i) r[i] = a[i] + b[i]; -} -static inline void vec3_sub(vec3 r, vec3 const a, vec3 const b) { - int i; - for (i = 0; i < 3; ++i) r[i] = a[i] - b[i]; -} -static inline void vec3_scale(vec3 r, vec3 const v, float const s) { - int i; - for (i = 0; i < 3; ++i) r[i] = v[i] * s; -} -static inline float vec3_mul_inner(vec3 const a, vec3 const b) { - float p = 0.f; - int i; - for (i = 0; i < 3; ++i) p += b[i] * a[i]; - return p; -} -static inline void vec3_mul_cross(vec3 r, vec3 const a, vec3 const b) { - r[0] = a[1] * b[2] - a[2] * b[1]; - r[1] = a[2] * b[0] - a[0] * b[2]; - r[2] = a[0] * b[1] - a[1] * b[0]; -} -static inline float vec3_len(vec3 const v) { return sqrtf(vec3_mul_inner(v, v)); } -static inline void vec3_norm(vec3 r, vec3 const v) { - float k = 1.f / vec3_len(v); - vec3_scale(r, v, k); -} -static inline void vec3_reflect(vec3 r, vec3 const v, vec3 const n) { - float p = 2.f * vec3_mul_inner(v, n); - int i; - for (i = 0; i < 3; ++i) r[i] = v[i] - p * n[i]; -} +#define degreesToRadians(angleDegrees) (angleDegrees * M_PI / 180.0) -typedef float vec4[4]; -static inline void vec4_add(vec4 r, vec4 const a, vec4 const b) { - int i; - for (i = 0; i < 4; ++i) r[i] = a[i] + b[i]; -} -static inline void vec4_sub(vec4 r, vec4 const a, vec4 const b) { - int i; - for (i = 0; i < 4; ++i) r[i] = a[i] - b[i]; -} -static inline void vec4_scale(vec4 r, vec4 v, float s) { - int i; - for (i = 0; i < 4; ++i) r[i] = v[i] * s; -} -static inline float vec4_mul_inner(vec4 a, vec4 b) { - float p = 0.f; - int i; - for (i = 0; i < 4; ++i) p += b[i] * a[i]; - return p; -} -static inline void vec4_mul_cross(vec4 r, vec4 a, vec4 b) { - r[0] = a[1] * b[2] - a[2] * b[1]; - r[1] = a[2] * b[0] - a[0] * b[2]; - r[2] = a[0] * b[1] - a[1] * b[0]; - r[3] = 1.f; -} -static inline float vec4_len(vec4 v) { return sqrtf(vec4_mul_inner(v, v)); } -static inline void vec4_norm(vec4 r, vec4 v) { - float k = 1.f / vec4_len(v); - vec4_scale(r, v, k); -} -static inline void vec4_reflect(vec4 r, vec4 v, vec4 n) { - float p = 2.f * vec4_mul_inner(v, n); - int i; - for (i = 0; i < 4; ++i) r[i] = v[i] - p * n[i]; +#define LINMATH_H_DEFINE_VEC(n) \ +typedef float vec##n[n]; \ +LINMATH_H_FUNC void vec##n##_add(vec##n r, vec##n const a, vec##n const b) \ +{ \ + int i; \ + for(i=0; ib[i] ? a[i] : b[i]; \ +} \ +LINMATH_H_FUNC void vec##n##_dup(vec##n r, vec##n const src) \ +{ \ + int i; \ + for(i=0; i 1e-4) { - vec3_norm(u, u); - mat4x4 T; - mat4x4_from_vec3_mul_outer(T, u, u); - - mat4x4 S = {{0, u[2], -u[1], 0}, {-u[2], 0, u[0], 0}, {u[1], -u[0], 0, 0}, {0, 0, 0, 0}}; - mat4x4_scale(S, S, s); - - mat4x4 C; - mat4x4_identity(C); - mat4x4_sub(C, C, T); - - mat4x4_scale(C, C, c); - - mat4x4_add(T, T, C); - mat4x4_add(T, T, S); - - T[3][3] = 1.; - mat4x4_mul(R, M, T); - } else { - mat4x4_dup(R, M); - } -} -static inline void mat4x4_rotate_X(mat4x4 Q, mat4x4 M, float angle) { - float s = sinf(angle); - float c = cosf(angle); - mat4x4 R = {{1.f, 0.f, 0.f, 0.f}, {0.f, c, s, 0.f}, {0.f, -s, c, 0.f}, {0.f, 0.f, 0.f, 1.f}}; - mat4x4_mul(Q, M, R); -} -static inline void mat4x4_rotate_Y(mat4x4 Q, mat4x4 M, float angle) { - float s = sinf(angle); - float c = cosf(angle); - mat4x4 R = {{c, 0.f, s, 0.f}, {0.f, 1.f, 0.f, 0.f}, {-s, 0.f, c, 0.f}, {0.f, 0.f, 0.f, 1.f}}; - mat4x4_mul(Q, M, R); -} -static inline void mat4x4_rotate_Z(mat4x4 Q, mat4x4 M, float angle) { - float s = sinf(angle); - float c = cosf(angle); - mat4x4 R = {{c, s, 0.f, 0.f}, {-s, c, 0.f, 0.f}, {0.f, 0.f, 1.f, 0.f}, {0.f, 0.f, 0.f, 1.f}}; - mat4x4_mul(Q, M, R); -} -static inline void mat4x4_invert(mat4x4 T, mat4x4 M) { - float s[6]; - float c[6]; - s[0] = M[0][0] * M[1][1] - M[1][0] * M[0][1]; - s[1] = M[0][0] * M[1][2] - M[1][0] * M[0][2]; - s[2] = M[0][0] * M[1][3] - M[1][0] * M[0][3]; - s[3] = M[0][1] * M[1][2] - M[1][1] * M[0][2]; - s[4] = M[0][1] * M[1][3] - M[1][1] * M[0][3]; - s[5] = M[0][2] * M[1][3] - M[1][2] * M[0][3]; - - c[0] = M[2][0] * M[3][1] - M[3][0] * M[2][1]; - c[1] = M[2][0] * M[3][2] - M[3][0] * M[2][2]; - c[2] = M[2][0] * M[3][3] - M[3][0] * M[2][3]; - c[3] = M[2][1] * M[3][2] - M[3][1] * M[2][2]; - c[4] = M[2][1] * M[3][3] - M[3][1] * M[2][3]; - c[5] = M[2][2] * M[3][3] - M[3][2] * M[2][3]; - - /* Assumes it is invertible */ - float idet = 1.0f / (s[0] * c[5] - s[1] * c[4] + s[2] * c[3] + s[3] * c[2] - s[4] * c[1] + s[5] * c[0]); - - T[0][0] = (M[1][1] * c[5] - M[1][2] * c[4] + M[1][3] * c[3]) * idet; - T[0][1] = (-M[0][1] * c[5] + M[0][2] * c[4] - M[0][3] * c[3]) * idet; - T[0][2] = (M[3][1] * s[5] - M[3][2] * s[4] + M[3][3] * s[3]) * idet; - T[0][3] = (-M[2][1] * s[5] + M[2][2] * s[4] - M[2][3] * s[3]) * idet; - - T[1][0] = (-M[1][0] * c[5] + M[1][2] * c[2] - M[1][3] * c[1]) * idet; - T[1][1] = (M[0][0] * c[5] - M[0][2] * c[2] + M[0][3] * c[1]) * idet; - T[1][2] = (-M[3][0] * s[5] + M[3][2] * s[2] - M[3][3] * s[1]) * idet; - T[1][3] = (M[2][0] * s[5] - M[2][2] * s[2] + M[2][3] * s[1]) * idet; - - T[2][0] = (M[1][0] * c[4] - M[1][1] * c[2] + M[1][3] * c[0]) * idet; - T[2][1] = (-M[0][0] * c[4] + M[0][1] * c[2] - M[0][3] * c[0]) * idet; - T[2][2] = (M[3][0] * s[4] - M[3][1] * s[2] + M[3][3] * s[0]) * idet; - T[2][3] = (-M[2][0] * s[4] + M[2][1] * s[2] - M[2][3] * s[0]) * idet; - - T[3][0] = (-M[1][0] * c[3] + M[1][1] * c[1] - M[1][2] * c[0]) * idet; - T[3][1] = (M[0][0] * c[3] - M[0][1] * c[1] + M[0][2] * c[0]) * idet; - T[3][2] = (-M[3][0] * s[3] + M[3][1] * s[1] - M[3][2] * s[0]) * idet; - T[3][3] = (M[2][0] * s[3] - M[2][1] * s[1] + M[2][2] * s[0]) * idet; -} -static inline void mat4x4_orthonormalize(mat4x4 R, mat4x4 M) { - mat4x4_dup(R, M); - float s = 1.; - vec3 h; - - vec3_norm(R[2], R[2]); - - s = vec3_mul_inner(R[1], R[2]); - vec3_scale(h, R[2], s); - vec3_sub(R[1], R[1], h); - vec3_norm(R[2], R[2]); - - s = vec3_mul_inner(R[1], R[2]); - vec3_scale(h, R[2], s); - vec3_sub(R[1], R[1], h); - vec3_norm(R[1], R[1]); - - s = vec3_mul_inner(R[0], R[1]); - vec3_scale(h, R[1], s); - vec3_sub(R[0], R[0], h); - vec3_norm(R[0], R[0]); -} - -static inline void mat4x4_frustum(mat4x4 M, float l, float r, float b, float t, float n, float f) { - M[0][0] = 2.f * n / (r - l); - M[0][1] = M[0][2] = M[0][3] = 0.f; - - M[1][1] = 2.f * n / (t - b); - M[1][0] = M[1][2] = M[1][3] = 0.f; - - M[2][0] = (r + l) / (r - l); - M[2][1] = (t + b) / (t - b); - M[2][2] = -(f + n) / (f - n); - M[2][3] = -1.f; - - M[3][2] = -2.f * (f * n) / (f - n); - M[3][0] = M[3][1] = M[3][3] = 0.f; -} -static inline void mat4x4_ortho(mat4x4 M, float l, float r, float b, float t, float n, float f) { - M[0][0] = 2.f / (r - l); - M[0][1] = M[0][2] = M[0][3] = 0.f; - - M[1][1] = 2.f / (t - b); - M[1][0] = M[1][2] = M[1][3] = 0.f; - - M[2][2] = -2.f / (f - n); - M[2][0] = M[2][1] = M[2][3] = 0.f; - - M[3][0] = -(r + l) / (r - l); - M[3][1] = -(t + b) / (t - b); - M[3][2] = -(f + n) / (f - n); - M[3][3] = 1.f; -} -static inline void mat4x4_perspective(mat4x4 m, float y_fov, float aspect, float n, float f) { - /* NOTE: Degrees are an unhandy unit to work with. - * linmath.h uses radians for everything! */ - float const a = (float)(1.f / tan(y_fov / 2.f)); - - m[0][0] = a / aspect; - m[0][1] = 0.f; - m[0][2] = 0.f; - m[0][3] = 0.f; - - m[1][0] = 0.f; - m[1][1] = a; - m[1][2] = 0.f; - m[1][3] = 0.f; - - m[2][0] = 0.f; - m[2][1] = 0.f; - m[2][2] = -((f + n) / (f - n)); - m[2][3] = -1.f; - - m[3][0] = 0.f; - m[3][1] = 0.f; - m[3][2] = -((2.f * f * n) / (f - n)); - m[3][3] = 0.f; -} -static inline void mat4x4_look_at(mat4x4 m, vec3 eye, vec3 center, vec3 up) { - /* Adapted from Android's OpenGL Matrix.java. */ - /* See the OpenGL GLUT documentation for gluLookAt for a description */ - /* of the algorithm. We implement it in a straightforward way: */ - - /* TODO: The negation of of can be spared by swapping the order of - * operands in the following cross products in the right way. */ - vec3 f; - vec3_sub(f, center, eye); - vec3_norm(f, f); - - vec3 s; - vec3_mul_cross(s, f, up); - vec3_norm(s, s); +LINMATH_H_FUNC void mat4x4_identity(mat4x4 M) +{ + int i, j; + for(i=0; i<4; ++i) + for(j=0; j<4; ++j) + M[i][j] = i==j ? 1.f : 0.f; +} +LINMATH_H_FUNC void mat4x4_dup(mat4x4 M, mat4x4 const N) +{ + int i; + for(i=0; i<4; ++i) + vec4_dup(M[i], N[i]); +} +LINMATH_H_FUNC void mat4x4_row(vec4 r, mat4x4 const M, int i) +{ + int k; + for(k=0; k<4; ++k) + r[k] = M[k][i]; +} +LINMATH_H_FUNC void mat4x4_col(vec4 r, mat4x4 const M, int i) +{ + int k; + for(k=0; k<4; ++k) + r[k] = M[i][k]; +} +LINMATH_H_FUNC void mat4x4_transpose(mat4x4 M, mat4x4 const N) +{ + // Note: if M and N are the same, the user has to + // explicitly make a copy of M and set it to N. + int i, j; + for(j=0; j<4; ++j) + for(i=0; i<4; ++i) + M[i][j] = N[j][i]; +} +LINMATH_H_FUNC void mat4x4_add(mat4x4 M, mat4x4 const a, mat4x4 const b) +{ + int i; + for(i=0; i<4; ++i) + vec4_add(M[i], a[i], b[i]); +} +LINMATH_H_FUNC void mat4x4_sub(mat4x4 M, mat4x4 const a, mat4x4 const b) +{ + int i; + for(i=0; i<4; ++i) + vec4_sub(M[i], a[i], b[i]); +} +LINMATH_H_FUNC void mat4x4_scale(mat4x4 M, mat4x4 const a, float k) +{ + int i; + for(i=0; i<4; ++i) + vec4_scale(M[i], a[i], k); +} +LINMATH_H_FUNC void mat4x4_scale_aniso(mat4x4 M, mat4x4 const a, float x, float y, float z) +{ + vec4_scale(M[0], a[0], x); + vec4_scale(M[1], a[1], y); + vec4_scale(M[2], a[2], z); + vec4_dup(M[3], a[3]); +} +LINMATH_H_FUNC void mat4x4_mul(mat4x4 M, mat4x4 const a, mat4x4 const b) +{ + mat4x4 temp; + int k, r, c; + for(c=0; c<4; ++c) for(r=0; r<4; ++r) { + temp[c][r] = 0.f; + for(k=0; k<4; ++k) + temp[c][r] += a[k][r] * b[c][k]; + } + mat4x4_dup(M, temp); +} +LINMATH_H_FUNC void mat4x4_mul_vec4(vec4 r, mat4x4 const M, vec4 const v) +{ + int i, j; + for(j=0; j<4; ++j) { + r[j] = 0.f; + for(i=0; i<4; ++i) + r[j] += M[i][j] * v[i]; + } +} +LINMATH_H_FUNC void mat4x4_translate(mat4x4 T, float x, float y, float z) +{ + mat4x4_identity(T); + T[3][0] = x; + T[3][1] = y; + T[3][2] = z; +} +LINMATH_H_FUNC void mat4x4_translate_in_place(mat4x4 M, float x, float y, float z) +{ + vec4 t = {x, y, z, 0}; + vec4 r; + int i; + for (i = 0; i < 4; ++i) { + mat4x4_row(r, M, i); + M[3][i] += vec4_mul_inner(r, t); + } +} +LINMATH_H_FUNC void mat4x4_from_vec3_mul_outer(mat4x4 M, vec3 const a, vec3 const b) +{ + int i, j; + for(i=0; i<4; ++i) for(j=0; j<4; ++j) + M[i][j] = i<3 && j<3 ? a[i] * b[j] : 0.f; +} +LINMATH_H_FUNC void mat4x4_rotate(mat4x4 R, mat4x4 const M, float x, float y, float z, float angle) +{ + float s = sinf(angle); + float c = cosf(angle); + vec3 u = {x, y, z}; + + if(vec3_len(u) > 1e-4) { + vec3_norm(u, u); + mat4x4 T; + mat4x4_from_vec3_mul_outer(T, u, u); + + mat4x4 S = { + { 0, u[2], -u[1], 0}, + {-u[2], 0, u[0], 0}, + { u[1], -u[0], 0, 0}, + { 0, 0, 0, 0} + }; + mat4x4_scale(S, S, s); + + mat4x4 C; + mat4x4_identity(C); + mat4x4_sub(C, C, T); + + mat4x4_scale(C, C, c); + + mat4x4_add(T, T, C); + mat4x4_add(T, T, S); + + T[3][3] = 1.f; + mat4x4_mul(R, M, T); + } else { + mat4x4_dup(R, M); + } +} +LINMATH_H_FUNC void mat4x4_rotate_X(mat4x4 Q, mat4x4 const M, float angle) +{ + float s = sinf(angle); + float c = cosf(angle); + mat4x4 R = { + {1.f, 0.f, 0.f, 0.f}, + {0.f, c, s, 0.f}, + {0.f, -s, c, 0.f}, + {0.f, 0.f, 0.f, 1.f} + }; + mat4x4_mul(Q, M, R); +} +LINMATH_H_FUNC void mat4x4_rotate_Y(mat4x4 Q, mat4x4 const M, float angle) +{ + float s = sinf(angle); + float c = cosf(angle); + mat4x4 R = { + { c, 0.f, -s, 0.f}, + { 0.f, 1.f, 0.f, 0.f}, + { s, 0.f, c, 0.f}, + { 0.f, 0.f, 0.f, 1.f} + }; + mat4x4_mul(Q, M, R); +} +LINMATH_H_FUNC void mat4x4_rotate_Z(mat4x4 Q, mat4x4 const M, float angle) +{ + float s = sinf(angle); + float c = cosf(angle); + mat4x4 R = { + { c, s, 0.f, 0.f}, + { -s, c, 0.f, 0.f}, + { 0.f, 0.f, 1.f, 0.f}, + { 0.f, 0.f, 0.f, 1.f} + }; + mat4x4_mul(Q, M, R); +} +LINMATH_H_FUNC void mat4x4_invert(mat4x4 T, mat4x4 const M) +{ + float s[6]; + float c[6]; + s[0] = M[0][0]*M[1][1] - M[1][0]*M[0][1]; + s[1] = M[0][0]*M[1][2] - M[1][0]*M[0][2]; + s[2] = M[0][0]*M[1][3] - M[1][0]*M[0][3]; + s[3] = M[0][1]*M[1][2] - M[1][1]*M[0][2]; + s[4] = M[0][1]*M[1][3] - M[1][1]*M[0][3]; + s[5] = M[0][2]*M[1][3] - M[1][2]*M[0][3]; + + c[0] = M[2][0]*M[3][1] - M[3][0]*M[2][1]; + c[1] = M[2][0]*M[3][2] - M[3][0]*M[2][2]; + c[2] = M[2][0]*M[3][3] - M[3][0]*M[2][3]; + c[3] = M[2][1]*M[3][2] - M[3][1]*M[2][2]; + c[4] = M[2][1]*M[3][3] - M[3][1]*M[2][3]; + c[5] = M[2][2]*M[3][3] - M[3][2]*M[2][3]; + + /* Assumes it is invertible */ + float idet = 1.0f/( s[0]*c[5]-s[1]*c[4]+s[2]*c[3]+s[3]*c[2]-s[4]*c[1]+s[5]*c[0] ); + + T[0][0] = ( M[1][1] * c[5] - M[1][2] * c[4] + M[1][3] * c[3]) * idet; + T[0][1] = (-M[0][1] * c[5] + M[0][2] * c[4] - M[0][3] * c[3]) * idet; + T[0][2] = ( M[3][1] * s[5] - M[3][2] * s[4] + M[3][3] * s[3]) * idet; + T[0][3] = (-M[2][1] * s[5] + M[2][2] * s[4] - M[2][3] * s[3]) * idet; + + T[1][0] = (-M[1][0] * c[5] + M[1][2] * c[2] - M[1][3] * c[1]) * idet; + T[1][1] = ( M[0][0] * c[5] - M[0][2] * c[2] + M[0][3] * c[1]) * idet; + T[1][2] = (-M[3][0] * s[5] + M[3][2] * s[2] - M[3][3] * s[1]) * idet; + T[1][3] = ( M[2][0] * s[5] - M[2][2] * s[2] + M[2][3] * s[1]) * idet; + + T[2][0] = ( M[1][0] * c[4] - M[1][1] * c[2] + M[1][3] * c[0]) * idet; + T[2][1] = (-M[0][0] * c[4] + M[0][1] * c[2] - M[0][3] * c[0]) * idet; + T[2][2] = ( M[3][0] * s[4] - M[3][1] * s[2] + M[3][3] * s[0]) * idet; + T[2][3] = (-M[2][0] * s[4] + M[2][1] * s[2] - M[2][3] * s[0]) * idet; + + T[3][0] = (-M[1][0] * c[3] + M[1][1] * c[1] - M[1][2] * c[0]) * idet; + T[3][1] = ( M[0][0] * c[3] - M[0][1] * c[1] + M[0][2] * c[0]) * idet; + T[3][2] = (-M[3][0] * s[3] + M[3][1] * s[1] - M[3][2] * s[0]) * idet; + T[3][3] = ( M[2][0] * s[3] - M[2][1] * s[1] + M[2][2] * s[0]) * idet; +} +LINMATH_H_FUNC void mat4x4_orthonormalize(mat4x4 R, mat4x4 const M) +{ + mat4x4_dup(R, M); + float s = 1.f; + vec3 h; + + vec3_norm(R[2], R[2]); + + s = vec3_mul_inner(R[1], R[2]); + vec3_scale(h, R[2], s); + vec3_sub(R[1], R[1], h); + vec3_norm(R[1], R[1]); + + s = vec3_mul_inner(R[0], R[2]); + vec3_scale(h, R[2], s); + vec3_sub(R[0], R[0], h); + + s = vec3_mul_inner(R[0], R[1]); + vec3_scale(h, R[1], s); + vec3_sub(R[0], R[0], h); + vec3_norm(R[0], R[0]); +} + +LINMATH_H_FUNC void mat4x4_frustum(mat4x4 M, float l, float r, float b, float t, float n, float f) +{ + M[0][0] = 2.f*n/(r-l); + M[0][1] = M[0][2] = M[0][3] = 0.f; + + M[1][1] = 2.f*n/(t-b); + M[1][0] = M[1][2] = M[1][3] = 0.f; + + M[2][0] = (r+l)/(r-l); + M[2][1] = (t+b)/(t-b); + M[2][2] = -(f+n)/(f-n); + M[2][3] = -1.f; + + M[3][2] = -2.f*(f*n)/(f-n); + M[3][0] = M[3][1] = M[3][3] = 0.f; +} +LINMATH_H_FUNC void mat4x4_ortho(mat4x4 M, float l, float r, float b, float t, float n, float f) +{ + M[0][0] = 2.f/(r-l); + M[0][1] = M[0][2] = M[0][3] = 0.f; + + M[1][1] = 2.f/(t-b); + M[1][0] = M[1][2] = M[1][3] = 0.f; + + M[2][2] = -2.f/(f-n); + M[2][0] = M[2][1] = M[2][3] = 0.f; + + M[3][0] = -(r+l)/(r-l); + M[3][1] = -(t+b)/(t-b); + M[3][2] = -(f+n)/(f-n); + M[3][3] = 1.f; +} +LINMATH_H_FUNC void mat4x4_perspective(mat4x4 m, float y_fov, float aspect, float n, float f) +{ + /* NOTE: Degrees are an unhandy unit to work with. + * linmath.h uses radians for everything! */ + float const a = 1.f / tanf(y_fov / 2.f); + + m[0][0] = a / aspect; + m[0][1] = 0.f; + m[0][2] = 0.f; + m[0][3] = 0.f; + + m[1][0] = 0.f; + m[1][1] = a; + m[1][2] = 0.f; + m[1][3] = 0.f; + + m[2][0] = 0.f; + m[2][1] = 0.f; + m[2][2] = -((f + n) / (f - n)); + m[2][3] = -1.f; + + m[3][0] = 0.f; + m[3][1] = 0.f; + m[3][2] = -((2.f * f * n) / (f - n)); + m[3][3] = 0.f; +} +LINMATH_H_FUNC void mat4x4_look_at(mat4x4 m, vec3 const eye, vec3 const center, vec3 const up) +{ + /* Adapted from Android's OpenGL Matrix.java. */ + /* See the OpenGL GLUT documentation for gluLookAt for a description */ + /* of the algorithm. We implement it in a straightforward way: */ + + /* TODO: The negation of of can be spared by swapping the order of + * operands in the following cross products in the right way. */ + vec3 f; + vec3_sub(f, center, eye); + vec3_norm(f, f); + + vec3 s; + vec3_mul_cross(s, f, up); + vec3_norm(s, s); + + vec3 t; + vec3_mul_cross(t, s, f); + + m[0][0] = s[0]; + m[0][1] = t[0]; + m[0][2] = -f[0]; + m[0][3] = 0.f; - vec3 t; - vec3_mul_cross(t, s, f); - - m[0][0] = s[0]; - m[0][1] = t[0]; - m[0][2] = -f[0]; - m[0][3] = 0.f; - - m[1][0] = s[1]; - m[1][1] = t[1]; - m[1][2] = -f[1]; - m[1][3] = 0.f; - - m[2][0] = s[2]; - m[2][1] = t[2]; - m[2][2] = -f[2]; - m[2][3] = 0.f; - - m[3][0] = 0.f; - m[3][1] = 0.f; - m[3][2] = 0.f; - m[3][3] = 1.f; - - mat4x4_translate_in_place(m, -eye[0], -eye[1], -eye[2]); + m[1][0] = s[1]; + m[1][1] = t[1]; + m[1][2] = -f[1]; + m[1][3] = 0.f; + + m[2][0] = s[2]; + m[2][1] = t[2]; + m[2][2] = -f[2]; + m[2][3] = 0.f; + + m[3][0] = 0.f; + m[3][1] = 0.f; + m[3][2] = 0.f; + m[3][3] = 1.f; + + mat4x4_translate_in_place(m, -eye[0], -eye[1], -eye[2]); } typedef float quat[4]; -static inline void quat_identity(quat q) { - q[0] = q[1] = q[2] = 0.f; - q[3] = 1.f; -} -static inline void quat_add(quat r, quat a, quat b) { - int i; - for (i = 0; i < 4; ++i) r[i] = a[i] + b[i]; -} -static inline void quat_sub(quat r, quat a, quat b) { - int i; - for (i = 0; i < 4; ++i) r[i] = a[i] - b[i]; -} -static inline void quat_mul(quat r, quat p, quat q) { - vec3 w; - vec3_mul_cross(r, p, q); - vec3_scale(w, p, q[3]); - vec3_add(r, r, w); - vec3_scale(w, q, p[3]); - vec3_add(r, r, w); - r[3] = p[3] * q[3] - vec3_mul_inner(p, q); -} -static inline void quat_scale(quat r, quat v, float s) { - int i; - for (i = 0; i < 4; ++i) r[i] = v[i] * s; -} -static inline float quat_inner_product(quat a, quat b) { - float p = 0.f; - int i; - for (i = 0; i < 4; ++i) p += b[i] * a[i]; - return p; -} -static inline void quat_conj(quat r, quat q) { - int i; - for (i = 0; i < 3; ++i) r[i] = -q[i]; - r[3] = q[3]; -} +#define quat_add vec4_add +#define quat_sub vec4_sub #define quat_norm vec4_norm -static inline void quat_mul_vec3(vec3 r, quat q, vec3 v) { - quat v_ = {v[0], v[1], v[2], 0.f}; - - quat_conj(r, q); - quat_norm(r, r); - quat_mul(r, v_, r); - quat_mul(r, q, r); -} -static inline void mat4x4_from_quat(mat4x4 M, quat q) { - float a = q[3]; - float b = q[0]; - float c = q[1]; - float d = q[2]; - float a2 = a * a; - float b2 = b * b; - float c2 = c * c; - float d2 = d * d; - - M[0][0] = a2 + b2 - c2 - d2; - M[0][1] = 2.f * (b * c + a * d); - M[0][2] = 2.f * (b * d - a * c); - M[0][3] = 0.f; - - M[1][0] = 2 * (b * c - a * d); - M[1][1] = a2 - b2 + c2 - d2; - M[1][2] = 2.f * (c * d + a * b); - M[1][3] = 0.f; - - M[2][0] = 2.f * (b * d + a * c); - M[2][1] = 2.f * (c * d - a * b); - M[2][2] = a2 - b2 - c2 + d2; - M[2][3] = 0.f; - - M[3][0] = M[3][1] = M[3][2] = 0.f; - M[3][3] = 1.f; -} - -static inline void mat4x4o_mul_quat(mat4x4 R, mat4x4 M, quat q) { - /* XXX: The way this is written only works for othogonal matrices. */ - /* TODO: Take care of non-orthogonal case. */ - quat_mul_vec3(R[0], q, M[0]); - quat_mul_vec3(R[1], q, M[1]); - quat_mul_vec3(R[2], q, M[2]); - - R[3][0] = R[3][1] = R[3][2] = 0.f; - R[3][3] = 1.f; -} -static inline void quat_from_mat4x4(quat q, mat4x4 M) { - float r = 0.f; - int i; - - int perm[] = {0, 1, 2, 0, 1}; - int *p = perm; - - for (i = 0; i < 3; i++) { - float m = M[i][i]; - if (m < r) continue; - m = r; - p = &perm[i]; - } - - r = sqrtf(1.f + M[p[0]][p[0]] - M[p[1]][p[1]] - M[p[2]][p[2]]); - - if (r < 1e-6) { - q[0] = 1.f; - q[1] = q[2] = q[3] = 0.f; - return; - } - - q[0] = r / 2.f; - q[1] = (M[p[0]][p[1]] - M[p[1]][p[0]]) / (2.f * r); - q[2] = (M[p[2]][p[0]] - M[p[0]][p[2]]) / (2.f * r); - q[3] = (M[p[2]][p[1]] - M[p[1]][p[2]]) / (2.f * r); +#define quat_scale vec4_scale +#define quat_mul_inner vec4_mul_inner + +LINMATH_H_FUNC void quat_identity(quat q) +{ + q[0] = q[1] = q[2] = 0.f; + q[3] = 1.f; +} +LINMATH_H_FUNC void quat_mul(quat r, quat const p, quat const q) +{ + vec3 w, tmp; + + vec3_mul_cross(tmp, p, q); + vec3_scale(w, p, q[3]); + vec3_add(tmp, tmp, w); + vec3_scale(w, q, p[3]); + vec3_add(tmp, tmp, w); + + vec3_dup(r, tmp); + r[3] = p[3]*q[3] - vec3_mul_inner(p, q); +} +LINMATH_H_FUNC void quat_conj(quat r, quat const q) +{ + int i; + for(i=0; i<3; ++i) + r[i] = -q[i]; + r[3] = q[3]; +} +LINMATH_H_FUNC void quat_rotate(quat r, float angle, vec3 const axis) { + vec3 axis_norm; + vec3_norm(axis_norm, axis); + float s = sinf(angle / 2); + float c = cosf(angle / 2); + vec3_scale(r, axis_norm, s); + r[3] = c; +} +LINMATH_H_FUNC void quat_mul_vec3(vec3 r, quat const q, vec3 const v) +{ +/* + * Method by Fabian 'ryg' Giessen (of Farbrausch) +t = 2 * cross(q.xyz, v) +v' = v + q.w * t + cross(q.xyz, t) + */ + vec3 t; + vec3 q_xyz = {q[0], q[1], q[2]}; + vec3 u = {q[0], q[1], q[2]}; + + vec3_mul_cross(t, q_xyz, v); + vec3_scale(t, t, 2); + + vec3_mul_cross(u, q_xyz, t); + vec3_scale(t, t, q[3]); + + vec3_add(r, v, t); + vec3_add(r, r, u); +} +LINMATH_H_FUNC void mat4x4_from_quat(mat4x4 M, quat const q) +{ + float a = q[3]; + float b = q[0]; + float c = q[1]; + float d = q[2]; + float a2 = a*a; + float b2 = b*b; + float c2 = c*c; + float d2 = d*d; + + M[0][0] = a2 + b2 - c2 - d2; + M[0][1] = 2.f*(b*c + a*d); + M[0][2] = 2.f*(b*d - a*c); + M[0][3] = 0.f; + + M[1][0] = 2*(b*c - a*d); + M[1][1] = a2 - b2 + c2 - d2; + M[1][2] = 2.f*(c*d + a*b); + M[1][3] = 0.f; + + M[2][0] = 2.f*(b*d + a*c); + M[2][1] = 2.f*(c*d - a*b); + M[2][2] = a2 - b2 - c2 + d2; + M[2][3] = 0.f; + + M[3][0] = M[3][1] = M[3][2] = 0.f; + M[3][3] = 1.f; +} + +LINMATH_H_FUNC void mat4x4o_mul_quat(mat4x4 R, mat4x4 const M, quat const q) +{ +/* XXX: The way this is written only works for orthogonal matrices. */ +/* TODO: Take care of non-orthogonal case. */ + quat_mul_vec3(R[0], q, M[0]); + quat_mul_vec3(R[1], q, M[1]); + quat_mul_vec3(R[2], q, M[2]); + + R[3][0] = R[3][1] = R[3][2] = 0.f; + R[0][3] = M[0][3]; + R[1][3] = M[1][3]; + R[2][3] = M[2][3]; + R[3][3] = M[3][3]; // typically 1.0, but here we make it general +} +LINMATH_H_FUNC void quat_from_mat4x4(quat q, mat4x4 const M) +{ + float r=0.f; + int i; + + int perm[] = { 0, 1, 2, 0, 1 }; + int *p = perm; + + for(i = 0; i<3; i++) { + float m = M[i][i]; + if( m < r ) + continue; + m = r; + p = &perm[i]; + } + + r = sqrtf(1.f + M[p[0]][p[0]] - M[p[1]][p[1]] - M[p[2]][p[2]] ); + + if(r < 1e-6) { + q[0] = 1.f; + q[1] = q[2] = q[3] = 0.f; + return; + } + + q[0] = r/2.f; + q[1] = (M[p[0]][p[1]] - M[p[1]][p[0]])/(2.f*r); + q[2] = (M[p[2]][p[0]] - M[p[0]][p[2]])/(2.f*r); + q[3] = (M[p[2]][p[1]] - M[p[1]][p[2]])/(2.f*r); +} + +LINMATH_H_FUNC void mat4x4_arcball(mat4x4 R, mat4x4 const M, vec2 const _a, vec2 const _b, float s) +{ + vec2 a; memcpy(a, _a, sizeof(a)); + vec2 b; memcpy(b, _b, sizeof(b)); + + float z_a = 0.; + float z_b = 0.; + + if(vec2_len(a) < 1.) { + z_a = sqrtf(1.f - vec2_mul_inner(a, a)); + } else { + vec2_norm(a, a); + } + + if(vec2_len(b) < 1.) { + z_b = sqrtf(1.f - vec2_mul_inner(b, b)); + } else { + vec2_norm(b, b); + } + + vec3 a_ = {a[0], a[1], z_a}; + vec3 b_ = {b[0], b[1], z_b}; + + vec3 c_; + vec3_mul_cross(c_, a_, b_); + + float const angle = acosf(vec3_mul_inner(a_, b_)) * s; + mat4x4_rotate(R, M, c_[0], c_[1], c_[2], angle); } #endif diff --git a/cube/macOS/cube/CMakeLists.txt b/cube/macOS/cube/CMakeLists.txt index c638243b3..1fcc6c45e 100644 --- a/cube/macOS/cube/CMakeLists.txt +++ b/cube/macOS/cube/CMakeLists.txt @@ -1,6 +1,6 @@ # ~~~ -# Copyright (c) 2018 Valve Corporation -# Copyright (c) 2018 LunarG, Inc. +# Copyright (c) 2018-2024 Valve Corporation +# Copyright (c) 2018-2024 LunarG, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -79,10 +79,10 @@ set_source_files_properties("${PROJECT_BINARY_DIR}/staging-json/MoltenVK_icd.jso # Copy the MoltenVK lib into the bundle. if(XCODE) add_custom_command(TARGET vkcube POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/dylib/macOS/libMoltenVK.dylib" + COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/Package/Release/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib" ${CMAKE_CURRENT_BINARY_DIR}/$/vkcube.app/Contents/Frameworks/libMoltenVK.dylib) else() add_custom_command(TARGET vkcube POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/dylib/macOS/libMoltenVK.dylib" + COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/Package/Release/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib" ${CMAKE_CURRENT_BINARY_DIR}/vkcube.app/Contents/Frameworks/libMoltenVK.dylib) endif() diff --git a/cube/macOS/cubepp/CMakeLists.txt b/cube/macOS/cubepp/CMakeLists.txt index 6277d4382..645d4da9f 100644 --- a/cube/macOS/cubepp/CMakeLists.txt +++ b/cube/macOS/cubepp/CMakeLists.txt @@ -1,6 +1,6 @@ # ~~~ -# Copyright (c) 2018 Valve Corporation -# Copyright (c) 2018 LunarG, Inc. +# Copyright (c) 2018-2024 Valve Corporation +# Copyright (c) 2018-2024 LunarG, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -76,10 +76,10 @@ set_source_files_properties("${PROJECT_BINARY_DIR}/staging-json/MoltenVK_icd.jso # Copy the MoltenVK lib into the bundle. if(XCODE) add_custom_command(TARGET vkcubepp POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/dylib/macOS/libMoltenVK.dylib" + COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/Package/Release/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib" ${CMAKE_CURRENT_BINARY_DIR}/$/vkcubepp.app/Contents/Frameworks/libMoltenVK.dylib) else() add_custom_command(TARGET vkcubepp POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/dylib/macOS/libMoltenVK.dylib" + COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/Package/Release/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib" ${CMAKE_CURRENT_BINARY_DIR}/vkcubepp.app/Contents/Frameworks/libMoltenVK.dylib) endif() diff --git a/devsim/CMakeLists.txt b/devsim/CMakeLists.txt index 341741e4b..b1b9d76db 100644 --- a/devsim/CMakeLists.txt +++ b/devsim/CMakeLists.txt @@ -150,6 +150,8 @@ target_sources(DevSimLayer PRIVATE profiles_json.h profiles_util.cpp profiles_util.h + profiles_interface.cpp + profiles_interface.h profiles_generated.cpp profiles.h vk_layer_table.cpp diff --git a/devsim/profiles_generated.cpp b/devsim/profiles_generated.cpp index e4b02316f..cc6994fa8 100644 --- a/devsim/profiles_generated.cpp +++ b/devsim/profiles_generated.cpp @@ -22,7 +22,7 @@ * - Mike Weiblen * - Arda Coskunses * - Jeremy Kniager - + * This file is ***GENERATED***. Do Not Edit. * See scripts/gen_profiles_layer.py for modifications. */ @@ -1247,26 +1247,6 @@ static uint32_t VkStringToUint(const std::string &input_value) { return 0; } -static VkToolPurposeFlags StringToVkToolPurposeFlags(const std::string &input_value) { - static const std::unordered_map map = { - {"VK_TOOL_PURPOSE_VALIDATION_BIT", VK_TOOL_PURPOSE_VALIDATION_BIT}, - {"VK_TOOL_PURPOSE_PROFILING_BIT", VK_TOOL_PURPOSE_PROFILING_BIT}, - {"VK_TOOL_PURPOSE_TRACING_BIT", VK_TOOL_PURPOSE_TRACING_BIT}, - {"VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT", VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT}, - {"VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT", VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT}, - {"VK_TOOL_PURPOSE_VALIDATION_BIT_EXT", VK_TOOL_PURPOSE_VALIDATION_BIT_EXT}, - {"VK_TOOL_PURPOSE_PROFILING_BIT_EXT", VK_TOOL_PURPOSE_PROFILING_BIT_EXT}, - {"VK_TOOL_PURPOSE_TRACING_BIT_EXT", VK_TOOL_PURPOSE_TRACING_BIT_EXT}, - {"VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT", VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT}, - {"VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT", VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT}, - }; - const auto it = map.find(input_value); - if (it != map.end()) { - return it->second; - } - return VkToolPurposeFlags{}; -} - static VkFormatFeatureFlags StringToVkFormatFeatureFlags(const std::string &input_value) { static const std::unordered_map map = { {"VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT", VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT}, @@ -1505,24 +1485,6 @@ static VkFormatFeatureFlags2 StringToVkFormatFeatureFlags2(const std::string &in return VkFormatFeatureFlags2{}; } -static VkQueueGlobalPriorityEXT StringToVkQueueGlobalPriorityEXT(const std::string &input_value) { - static const std::unordered_map map = { - {"VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR", VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR}, - {"VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR", VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR}, - {"VK_QUEUE_GLOBAL_PRIORITY_HIGH_KHR", VK_QUEUE_GLOBAL_PRIORITY_HIGH_KHR}, - {"VK_QUEUE_GLOBAL_PRIORITY_REALTIME_KHR", VK_QUEUE_GLOBAL_PRIORITY_REALTIME_KHR}, - {"VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT", VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT}, - {"VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT", VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT}, - {"VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT", VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT}, - {"VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT", VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT}, - }; - const auto it = map.find(input_value); - if (it != map.end()) { - return it->second; - } - return VkQueueGlobalPriorityEXT{}; -} - // Global constants ////////////////////////////////////////////////////////////////////////////////////////////////////////////// // For new features/functionality, increment the minor level and reset patch level to zero. @@ -1531,7 +1493,11 @@ static VkQueueGlobalPriorityEXT StringToVkQueueGlobalPriorityEXT(const std::stri // layer/VkLayer_khronos_profiles.json.in const uint32_t kVersionProfilesMajor = 1; +#ifdef VULKANSC const uint32_t kVersionProfilesMinor = 0; +#else +const uint32_t kVersionProfilesMinor = 3; +#endif const uint32_t kVersionProfilesPatch = 0; const uint32_t kVersionProfilesImplementation = VK_MAKE_VERSION(kVersionProfilesMajor, kVersionProfilesMinor, kVersionProfilesPatch); @@ -1551,6 +1517,13 @@ const VkLayerProperties kLayerProperties[] = {{ }}; const uint32_t kLayerPropertiesCount = (sizeof(kLayerProperties) / sizeof(kLayerProperties[0])); +#ifndef VULKANSC +// Instance extensions that this layer provides: +const VkExtensionProperties kInstanceExtensionProperties[] = { + VkExtensionProperties{VK_EXT_LAYER_SETTINGS_EXTENSION_NAME, VK_EXT_LAYER_SETTINGS_SPEC_VERSION}}; +const uint32_t kInstanceExtensionPropertiesCount = static_cast(std::size(kInstanceExtensionProperties)); +#endif + // Device extensions that this layer provides: #ifdef VULKANSC const std::array kDeviceExtensionProperties = {}; @@ -1572,23 +1545,23 @@ bool device_has_pvrtc = false; std::recursive_mutex global_lock; // Enforce thread-safety for this layer. -#define GET_VALUE(member, name, not_modifiable) GetValue(device_name, parent, member, #name, &dest->name, not_modifiable) +#define GET_VALUE(member, name, not_modifiable, requested_profile) GetValue(device_name, parent, member, #name, &dest->name, not_modifiable, requested_profile) #define GET_ARRAY(member, name, not_modifiable) GetArray(device_name, parent, member, #name, dest->name, not_modifiable) -#define GET_VALUE_WARN(member, name, not_modifiable, warn_func) \ - if (!GetValue(device_name, parent, member, #name, &dest->name, not_modifiable, warn_func)) { \ +#define GET_VALUE_WARN(member, name, not_modifiable, requested_profile, warn_func) \ + if (!GetValue(device_name, parent, member, #name, &dest->name, not_modifiable, requested_profile, warn_func)) { \ valid = false; \ } -#define GET_VALUE_SIZE_T_WARN(member, name, not_modifiable, warn_func) \ - if (!GetValueSizet(device_name, parent, member, #name, &dest->name, not_modifiable, warn_func)) { \ +#define GET_VALUE_SIZE_T_WARN(member, name, not_modifiable, requested_profile, warn_func) \ + if (!GetValueSizet(device_name, parent, member, #name, &dest->name, not_modifiable, requested_profile, warn_func)) { \ valid = false; \ } -#define GET_VALUE_FLAG_WARN(member, name, not_modifiable) \ - if (!GetValueFlag(device_name, parent, member, #name, &dest->name, not_modifiable)) { \ +#define GET_VALUE_FLAG_WARN(member, name, not_modifiable, requested_profile) \ + if (!GetValueFlag(device_name, parent, member, #name, &dest->name, not_modifiable, requested_profile)) { \ valid = false; \ } -#define GET_VALUE_ENUM_WARN(member, name, not_modifiable, warn_func) \ - if (!GetValueEnum(device_name, parent, member, #name, &dest->name, not_modifiable, warn_func)) { \ +#define GET_VALUE_ENUM_WARN(member, name, not_modifiable, requested_profile, warn_func) \ + if (!GetValueEnum(device_name, parent, member, #name, &dest->name, not_modifiable, requested_profile, warn_func)) { \ valid = false; \ } @@ -1669,6 +1642,7 @@ class PhysicalDeviceData { uint32_t GetEffectiveVersion() { return requested_version < physical_device_properties_.apiVersion ? requested_version : physical_device_properties_.apiVersion; + } VkInstance instance() const { return instance_; } @@ -1781,9 +1755,8 @@ class PhysicalDeviceData { // VK_KHR_shader_clock structs VkPhysicalDeviceShaderClockFeaturesKHR physical_device_shader_clock_features_; - // VK_EXT_vertex_attribute_divisor structs - VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT physical_device_vertex_attribute_divisor_properties_ext_; - VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT physical_device_vertex_attribute_divisor_features_; + // VK_KHR_global_priority structs + VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR physical_device_global_priority_query_features_; // VK_EXT_pci_bus_info structs VkPhysicalDevicePCIBusInfoPropertiesEXT physical_device_pcibus_info_properties_; @@ -1872,6 +1845,10 @@ class PhysicalDeviceData { VkPhysicalDeviceExternalSciSync2FeaturesNV physical_device_external_sci_sync_2_features_; #endif // VK_USE_PLATFORM_SCI + // VK_KHR_vertex_attribute_divisor structs + VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR physical_device_vertex_attribute_divisor_properties_; + VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR physical_device_vertex_attribute_divisor_features_; + // VK_QNX_external_memory_screen_buffer structs #ifdef VK_USE_PLATFORM_SCREEN_QNX VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX physical_device_external_memory_screen_buffer_features_; @@ -1976,9 +1953,8 @@ class PhysicalDeviceData { // VK_KHR_shader_clock structs physical_device_shader_clock_features_ = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR}; - // VK_EXT_vertex_attribute_divisor structs - physical_device_vertex_attribute_divisor_properties_ext_ = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT}; - physical_device_vertex_attribute_divisor_features_ = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT}; + // VK_KHR_global_priority structs + physical_device_global_priority_query_features_ = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR}; // VK_EXT_pci_bus_info structs physical_device_pcibus_info_properties_ = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT}; @@ -2067,6 +2043,10 @@ class PhysicalDeviceData { physical_device_external_sci_sync_2_features_ = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SCI_SYNC_2_FEATURES_NV}; #endif // VK_USE_PLATFORM_SCI + // VK_KHR_vertex_attribute_divisor structs + physical_device_vertex_attribute_divisor_properties_ = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR}; + physical_device_vertex_attribute_divisor_features_ = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR}; + // VK_QNX_external_memory_screen_buffer structs #ifdef VK_USE_PLATFORM_SCREEN_QNX physical_device_external_memory_screen_buffer_features_ = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX}; @@ -2124,12 +2104,13 @@ class JsonLoader { profile_map().erase(instance); } + void LogFoundProfiles(); const Json::Value& FindRootFromProfileName(const std::string& profile_name) const; VkResult LoadProfilesDatabase(); VkResult LoadFile(const std::string& filename); void ReadProfileApiVersion(); VkResult LoadDevice(const char* device_name, PhysicalDeviceData *pdd); - VkResult ReadProfile(const char* device_name, const Json::Value& root, const std::vector> &capabilities); + VkResult ReadProfile(const char* device_name, const Json::Value& root, const std::vector> &capabilities, bool requested_profile, bool enable_warnings); uint32_t GetProfileApiVersion() const { return profile_api_version_; } void CollectProfiles(const std::string& profile_name, std::vector& results) const; @@ -2157,9 +2138,9 @@ class JsonLoader { bool WarnDuplicatedFeature(const Json::Value &parent); bool WarnDuplicatedProperty(const Json::Value &parent); - bool GetFeature(const char *device_name, const Json::Value &features, const std::string &name); - bool GetProperty(const char *device_name, const Json::Value &props, const std::string &name); - bool GetFormat(const char *device_name, const Json::Value &formats, const std::string &format_name, MapOfVkFormatProperties *dest, + bool GetFeature(const char *device_name, bool requested_profile, const Json::Value &features, const std::string &name); + bool GetProperty(const char *device_name, bool requested_profile, const Json::Value &props, const std::string &name); + bool GetFormat(const char *device_name, bool requested_profile, const Json::Value &formats, const std::string &format_name, MapOfVkFormatProperties *dest, MapOfVkFormatProperties3 *dest3); bool CheckVersionSupport(uint32_t version, const std::string &name); ExtensionSupport CheckExtensionSupport(const char *extension, const std::string &name); @@ -2167,313 +2148,358 @@ class JsonLoader { bool GetQueueFamilyProperties(const char* device_name, const Json::Value &qf_props, QueueFamilyProperties *dest); bool OrderQueueFamilyProperties(ArrayOfVkQueueFamilyProperties *qfp); void AddPromotedExtensions(uint32_t api_level); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDriverProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceIDProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceMultiviewProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSubgroupProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePointClippingProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceProtectedMemoryProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSamplerFilterMinmaxProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceInlineUniformBlockProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceMaintenance3Properties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceMaintenance4Properties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceFloatControlsProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDescriptorIndexingProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceTimelineSemaphoreProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDepthStencilResolveProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkan11Properties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkan12Properties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkan13Properties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkanSC10Properties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderIntegerDotProductProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePrivateDataFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVariablePointerFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceMultiviewFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevice16BitStorageFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSamplerYcbcrConversionFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceProtectedMemoryFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceInlineUniformBlockFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceMaintenance4Features *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderDrawParameterFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderFloat16Int8Features *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceHostQueryResetFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDescriptorIndexingFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceTimelineSemaphoreFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevice8BitStorageFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkanMemoryModelFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderAtomicInt64Features *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceScalarBlockLayoutFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceUniformBufferStandardLayoutFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceBufferDeviceAddressFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceImagelessFramebufferFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePipelineCreationCacheControlFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkan11Features *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkan12Features *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkan13Features *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkanSC10Features *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderIntegerDotProductFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDynamicRenderingFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceASTCDecodeFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDiscardRectanglePropertiesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceConservativeRasterizationPropertiesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDepthClipEnableFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePerformanceQueryPropertiesKHR *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePerformanceQueryFeaturesKHR *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSampleLocationsPropertiesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExternalMemoryHostPropertiesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderClockFeaturesKHR *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePCIBusInfoPropertiesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSubgroupSizeControlPropertiesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSubgroupSizeControlFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceFragmentShadingRatePropertiesKHR *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceFragmentShadingRateFeaturesKHR *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceLineRasterizationPropertiesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceLineRasterizationFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceIndexTypeUint8FeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceRobustness2PropertiesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceRobustness2FeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceCustomBorderColorPropertiesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceCustomBorderColorFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSynchronization2FeaturesKHR *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceImageRobustnessFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevice4444FormatsFeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDriverProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceIDProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceMultiviewProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSubgroupProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePointClippingProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceProtectedMemoryProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSamplerFilterMinmaxProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceInlineUniformBlockProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceMaintenance3Properties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceMaintenance4Properties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceFloatControlsProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDescriptorIndexingProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceTimelineSemaphoreProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDepthStencilResolveProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkan11Properties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkan12Properties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkan13Properties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkanSC10Properties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderIntegerDotProductProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePrivateDataFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVariablePointerFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceMultiviewFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevice16BitStorageFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSamplerYcbcrConversionFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceProtectedMemoryFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceInlineUniformBlockFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceMaintenance4Features *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderDrawParameterFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderFloat16Int8Features *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceHostQueryResetFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDescriptorIndexingFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceTimelineSemaphoreFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevice8BitStorageFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkanMemoryModelFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderAtomicInt64Features *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceScalarBlockLayoutFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceUniformBufferStandardLayoutFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceBufferDeviceAddressFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceImagelessFramebufferFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePipelineCreationCacheControlFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkan11Features *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkan12Features *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkan13Features *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkanSC10Features *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderIntegerDotProductFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDynamicRenderingFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceASTCDecodeFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDiscardRectanglePropertiesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceConservativeRasterizationPropertiesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDepthClipEnableFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePerformanceQueryPropertiesKHR *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePerformanceQueryFeaturesKHR *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSampleLocationsPropertiesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExternalMemoryHostPropertiesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderClockFeaturesKHR *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePCIBusInfoPropertiesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSubgroupSizeControlPropertiesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSubgroupSizeControlFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceFragmentShadingRatePropertiesKHR *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceFragmentShadingRateFeaturesKHR *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceLineRasterizationPropertiesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceLineRasterizationFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceIndexTypeUint8FeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceRobustness2PropertiesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceRobustness2FeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceCustomBorderColorPropertiesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceCustomBorderColorFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSynchronization2FeaturesKHR *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceImageRobustnessFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevice4444FormatsFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *dest); #ifdef VK_USE_PLATFORM_SCI - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExternalSciSyncFeaturesNV *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExternalSciSyncFeaturesNV *dest); #endif // VK_USE_PLATFORM_SCI #ifdef VK_USE_PLATFORM_SCI - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExternalMemorySciBufFeaturesNV *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExternalMemorySciBufFeaturesNV *dest); #endif // VK_USE_PLATFORM_SCI - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceColorWriteEnableFeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceColorWriteEnableFeaturesEXT *dest); #ifdef VK_USE_PLATFORM_SCI - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExternalSciSync2FeaturesNV *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExternalSciSync2FeaturesNV *dest); #endif // VK_USE_PLATFORM_SCI + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR *dest); #ifdef VK_USE_PLATFORM_SCREEN_QNX - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX *dest); #endif // VK_USE_PLATFORM_SCREEN_QNX - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceFeatures *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePortabilitySubsetFeaturesKHR *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceLimits *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSparseProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceToolProperties *dest); - bool GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePortabilitySubsetPropertiesKHR *dest); - - static bool WarnIfNotEqualFloat(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const float new_value, const float old_value, const bool not_modifiable) { + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceFeatures *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePortabilitySubsetFeaturesKHR *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceLimits *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSparseProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceToolProperties *dest); + bool GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePortabilitySubsetPropertiesKHR *dest); + + static bool WarnIfNotEqualFloat(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const float new_value, const float old_value, const bool not_modifiable) { if (std::abs(new_value - old_value) > 0.0001f) { - if (not_modifiable) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' is not modifiable but the profile value (%3.2f) is different from the device (%s) value (%3.2f).\n", cap_name, new_value, device_name, old_value); - } else { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%3.2f) is different from the device (%s) supported value (%3.2f).\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + if (not_modifiable) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' is not modifiable but the profile value (%3.2f) is different from the device (%s) value (%3.2f)\n", cap_name, new_value, device_name, old_value); + } else { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%3.2f) is different from the device (%s) supported value (%3.2f)\n", cap_name, new_value, device_name, old_value); + } } return true; } return false; } - static bool WarnIfNotEqualBool(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const bool new_value, const bool old_value, const bool not_modifiable) { + static bool WarnIfNotEqualBool(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const bool new_value, const bool old_value, const bool not_modifiable) { if (new_value != old_value) { - if (not_modifiable) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' is not modifiable but the profile value (%s) is different from the device (%s) value (%s)\n", cap_name, new_value ? "true" : "false", device_name, old_value ? "true" : "false"); - } else if (new_value) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value is enabled in the profile, but the device (%s) does not support it.\n", cap_name, device_name); + if (enable_warnings) { + if (not_modifiable) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' is not modifiable but the profile value (%s) is different from the device (%s) value (%s)\n", cap_name, new_value ? "true" : "false", device_name, old_value ? "true" : "false"); + } else if (new_value) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value is enabled in the profile, but the device (%s) does not support it\n", cap_name, device_name); + } } return true; } return false; } - static bool WarnIfNotEqualEnum(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const uint32_t new_value, const uint32_t old_value, const bool not_modifiable) { + static bool WarnIfNotEqualEnum(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const uint32_t new_value, const uint32_t old_value, const bool not_modifiable) { if (new_value != old_value) { - if (not_modifiable) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' is not modifiable but the profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ").\n", cap_name, new_value, device_name, old_value); - } else { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ").\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + if (not_modifiable) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' is not modifiable but the profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ")\n", cap_name, new_value, device_name, old_value); + } else { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ")\n", cap_name, new_value, device_name, old_value); + } } return true; } return false; } - static bool WarnIfNotEqual(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const uint32_t new_value, const uint32_t old_value, const bool not_modifiable) { + static bool WarnIfNotEqual(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const uint32_t new_value, const uint32_t old_value, const bool not_modifiable) { if (new_value != old_value) { - if (not_modifiable) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' is not modifiable but the profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ").\n", cap_name, new_value, device_name, old_value); - } else { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ").\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + if (not_modifiable) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' is not modifiable but the profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ")\n", cap_name, new_value, device_name, old_value); + } else { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ")\n", cap_name, new_value, device_name, old_value); + } } return true; } return false; } - static bool WarnIfNotEqual32u(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const uint32_t new_value, const uint32_t old_value, const bool not_modifiable) { + static bool WarnIfNotEqual32u(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const uint32_t new_value, const uint32_t old_value, const bool not_modifiable) { if (new_value != old_value) { - if (not_modifiable) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' is not modifiable but the profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ").\n", cap_name, new_value, device_name, old_value); - } else { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ").\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + if (not_modifiable) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' is not modifiable but the profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ")\n", cap_name, new_value, device_name, old_value); + } else { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ")\n", cap_name, new_value, device_name, old_value); + } } return true; } return false; } - static bool WarnIfNotEqual(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const int32_t new_value, const int32_t old_value, const bool not_modifiable) { + static bool WarnIfNotEqual(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const int32_t new_value, const int32_t old_value, const bool not_modifiable) { if (new_value != old_value) { - if (not_modifiable) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' is not modifiable but the profile value (%" PRIi32 ") is different from the device (%s) value (%" PRIi32 ").\n", cap_name, new_value, device_name, old_value); - } else { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%" PRIi32 ") is different from the device (%s) value (%" PRIi32 ").\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + if (not_modifiable) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' is not modifiable but the profile value (%" PRIi32 ") is different from the device (%s) value (%" PRIi32 ")\n", cap_name, new_value, device_name, old_value); + } else { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%" PRIi32 ") is different from the device (%s) value (%" PRIi32 ")\n", cap_name, new_value, device_name, old_value); + } } return true; } return false; } - static bool WarnIfNotEqual64u(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const uint64_t new_value, const uint64_t old_value, const bool not_modifiable) { + static bool WarnIfNotEqual64u(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const uint64_t new_value, const uint64_t old_value, const bool not_modifiable) { if (new_value != old_value) { - if (not_modifiable) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' is not modifiable but the profile value (%" PRIu64 ") is different from the device (%s) value (%" PRIu64 ").\n", cap_name, new_value, device_name, old_value); - } else { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%" PRIu64 ") is different from the device (%s) value (%" PRIu64 ").\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + if (not_modifiable) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' is not modifiable but the profile value (%" PRIu64 ") is different from the device (%s) value (%" PRIu64 ")\n", cap_name, new_value, device_name, old_value); + } else { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%" PRIu64 ") is different from the device (%s) value (%" PRIu64 ")\n", cap_name, new_value, device_name, old_value); + } } return true; } return false; } - static bool WarnIfNotEquali64(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const int64_t new_value, const int64_t old_value, const bool not_modifiable) { + static bool WarnIfNotEquali64(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const int64_t new_value, const int64_t old_value, const bool not_modifiable) { if (new_value != old_value) { - if (not_modifiable) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' is not modifiable but the profile value (%" PRIi64 ") is different from the device (%s) value (%" PRIi64 ").\n", cap_name, new_value, device_name, old_value); - } else { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%" PRIi64 ") is different from the device (%s) value (%" PRIi64 ").\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + if (not_modifiable) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' is not modifiable but the profile value (%" PRIi64 ") is different from the device (%s) value (%" PRIi64 ")\n", cap_name, new_value, device_name, old_value); + } else { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%" PRIi64 ") is different from the device (%s) value (%" PRIi64 ")\n", cap_name, new_value, device_name, old_value); + } } return true; } return false; } - static bool WarnIfNotEqualSizet(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const size_t new_value, const size_t old_value, const bool not_modifiable) { + static bool WarnIfNotEqualSizet(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const size_t new_value, const size_t old_value, const bool not_modifiable) { if (new_value != old_value) { - if (not_modifiable) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' is not modifiable but the profile value (%" PRIuLEAST64 ") is different from the device (%s) value (%" PRIuLEAST64 ").\n", cap_name, new_value, device_name, old_value); - } else { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%" PRIuLEAST64 ") is different from the device (%s) value (%" PRIuLEAST64 ").\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + if (not_modifiable) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' is not modifiable but the profile value (%" PRIuLEAST64 ") is different from the device (%s) value (%" PRIuLEAST64 ")\n", cap_name, new_value, device_name, old_value); + } else { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%" PRIuLEAST64 ") is different from the device (%s) value (%" PRIuLEAST64 ")\n", cap_name, new_value, device_name, old_value); + } } return true; } return false; } - static bool WarnIfMissingBit(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const uint32_t new_value, const uint32_t old_value, const bool not_modifiable) { + static bool WarnIfMissingBit(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const uint32_t new_value, const uint32_t old_value, const bool not_modifiable) { if ((old_value | new_value) != old_value) { - if (not_modifiable) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' is not modifiable but the profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ").\n", cap_name, new_value, device_name, old_value); - } else { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%" PRIu32 ") has bits set that the device (%s) value (%" PRIu32 ") does not.\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + if (not_modifiable) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' is not modifiable but the profile value (%" PRIu32 ") is different from the device (%s) value (%" PRIu32 ")\n", cap_name, new_value, device_name, old_value); + } else { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%" PRIu32 ") has bits set that the device (%s) value (%" PRIu32 ") does not\n", cap_name, new_value, device_name, old_value); + } } return true; } return false; } - static bool WarnIfGreater(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const uint64_t new_value, const uint64_t old_value, const bool not_modifiable) { + static bool WarnIfGreater(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const uint64_t new_value, const uint64_t old_value, const bool not_modifiable) { + (void)not_modifiable; + if (new_value > old_value) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%" PRIu64 ") is greater than device (%s) value (%" PRIu64 ")\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%" PRIu64 ") is greater than device (%s) value (%" PRIu64 ")\n", cap_name, new_value, device_name, old_value); + } return true; } return false; } - static bool WarnIfGreaterSizet(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const size_t new_value, const size_t old_value, const bool not_modifiable) { + static bool WarnIfGreaterSizet(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const size_t new_value, const size_t old_value, const bool not_modifiable) { + (void)not_modifiable; + if (new_value > old_value) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%" PRIuLEAST64 ") is greater than device (%s) value (%" PRIuLEAST64 ")\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%" PRIuLEAST64 ") is greater than device (%s) value (%" PRIuLEAST64 ")\n", cap_name, new_value, device_name, old_value); + } return true; } return false; } - static bool WarnIfGreaterFloat(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const float new_value, const float old_value, const bool not_modifiable) { + static bool WarnIfGreaterFloat(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const float new_value, const float old_value, const bool not_modifiable) { + (void)not_modifiable; + if (new_value > old_value) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%3.2f) is greater than device (%s) value (%3.2f)\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%3.2f) is greater than device (%s) value (%3.2f)\n", cap_name, new_value, device_name, old_value); + } return true; } return false; } - static bool WarnIfLesser(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const uint64_t new_value, const uint64_t old_value, const bool not_modifiable) { + static bool WarnIfLesser(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const uint64_t new_value, const uint64_t old_value, const bool not_modifiable) { + (void)not_modifiable; + if (new_value < old_value) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + if (enable_warnings) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, "'%s' profile value (%" PRIu64 ") is lesser than device (%s) value (%" PRIu64 ")\n", cap_name, new_value, device_name, old_value); + } return true; } return false; } - static bool WarnIfLesserSizet(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const size_t new_value, const size_t old_value, const bool not_modifiable) { + static bool WarnIfLesserSizet(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const size_t new_value, const size_t old_value, const bool not_modifiable) { + (void)not_modifiable; + if (new_value < old_value) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%" PRIuLEAST64 ") is lesser than device (%s) value (%" PRIuLEAST64 ")\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%" PRIuLEAST64 ") is lesser than device (%s) value (%" PRIuLEAST64 ")\n", cap_name, new_value, device_name, old_value); + } return true; } return false; } - static bool WarnIfLesserFloat(ProfileLayerSettings *layer_settings, const char* device_name, const char *cap_name, const float new_value, const float old_value, const bool not_modifiable) { + static bool WarnIfLesserFloat(ProfileLayerSettings *layer_settings, bool enable_warnings, const char* device_name, const char *cap_name, const float new_value, const float old_value, const bool not_modifiable) { + (void)not_modifiable; + if (new_value < old_value) { - LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, - "'%s' profile value (%3.2f) is lesser than device (%s) value (%3.2f)\n", cap_name, new_value, device_name, old_value); + if (enable_warnings) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "'%s' profile value (%3.2f) is lesser than device (%s) value (%3.2f)\n", cap_name, new_value, device_name, old_value); + } return true; } return false; } - bool GetValue(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, float *dest, bool not_modifiable, - std::function warn_func = nullptr) { + bool GetValue(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, float *dest, bool not_modifiable, bool requested_profile, + std::function warn_func = nullptr) { if (member != name) { return true; } @@ -2489,7 +2515,7 @@ class JsonLoader { bool valid = true; const float new_value = value.asFloat(); if (warn_func) { - if (warn_func(&layer_settings, device_name, name, new_value, *dest, not_modifiable)) { + if (warn_func(&layer_settings, requested_profile, device_name, name, new_value, *dest, not_modifiable)) { valid = false; } } @@ -2500,8 +2526,8 @@ class JsonLoader { return valid; } - bool GetValue(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, uint8_t *dest, bool not_modifiable, - std::function warn_func = nullptr) { + bool GetValue(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, uint8_t *dest, bool not_modifiable, bool requested_profile, + std::function warn_func = nullptr) { if (member != name) { return true; } @@ -2515,7 +2541,7 @@ class JsonLoader { if (value.isBool()) { const bool new_value = value.asBool(); if (warn_func) { - if (warn_func(&layer_settings, device_name, name, new_value, *dest, not_modifiable)) { + if (warn_func(&layer_settings, requested_profile, device_name, name, new_value, *dest, not_modifiable)) { valid = false; } } @@ -2533,7 +2559,7 @@ class JsonLoader { } else if (value.isUInt()) { const uint8_t new_value = static_cast(value.asUInt()); if (warn_func) { - if (warn_func(&layer_settings, device_name, name, new_value, *dest, not_modifiable)) { + if (warn_func(&layer_settings, requested_profile, device_name, name, new_value, *dest, not_modifiable)) { valid = false; } } @@ -2544,8 +2570,8 @@ class JsonLoader { return valid; } - bool GetValue(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, int32_t *dest, bool not_modifiable, - std::function warn_func = nullptr) { + bool GetValue(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, int32_t *dest, bool not_modifiable, bool requested_profile, + std::function warn_func = nullptr) { if (member != name) { return true; } @@ -2561,7 +2587,7 @@ class JsonLoader { bool valid = true; const int32_t new_value = value.asInt(); if (warn_func) { - if (warn_func(&layer_settings, device_name, name, new_value, *dest, not_modifiable)) { + if (warn_func(&layer_settings, requested_profile, device_name, name, new_value, *dest, not_modifiable)) { valid = false; } } @@ -2572,8 +2598,8 @@ class JsonLoader { return valid; } - bool GetValue(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, int64_t *dest, bool not_modifiable, - std::function warn_func = nullptr) { + bool GetValue(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, int64_t *dest, bool not_modifiable, bool requested_profile, + std::function warn_func = nullptr) { if (member != name) { return true; } @@ -2589,7 +2615,7 @@ class JsonLoader { bool valid = true; const int64_t new_value = value.asInt64(); if (warn_func) { - if (warn_func(&layer_settings, device_name, name, new_value, *dest, not_modifiable)) { + if (warn_func(&layer_settings, requested_profile, device_name, name, new_value, *dest, not_modifiable)) { valid = false; } } @@ -2600,8 +2626,8 @@ class JsonLoader { return valid; } - bool GetValue(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, uint32_t *dest, bool not_modifiable, - std::function warn_func = nullptr) { + bool GetValue(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, uint32_t *dest, bool not_modifiable, bool requested_profile, + std::function warn_func = nullptr) { if (member != name) { return true; } @@ -2615,7 +2641,7 @@ class JsonLoader { if (value.isBool()) { const bool new_value = value.asBool(); if (warn_func) { - if (warn_func(&layer_settings, device_name, name, new_value, *dest, not_modifiable)) { + if (warn_func(&layer_settings, requested_profile, device_name, name, new_value, *dest, not_modifiable)) { valid = false; } } @@ -2637,7 +2663,7 @@ class JsonLoader { } else if (value.isUInt()) { const uint32_t new_value = value.asUInt(); if (warn_func) { - if (warn_func(&layer_settings, device_name, name, new_value, *dest, not_modifiable)) { + if (warn_func(&layer_settings, requested_profile, device_name, name, new_value, *dest, not_modifiable)) { valid = false; } } @@ -2649,8 +2675,8 @@ class JsonLoader { return valid; } - bool GetValue(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, uint64_t *dest, bool not_modifiable, - std::function warn_func = nullptr) { + bool GetValue(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, uint64_t *dest, bool not_modifiable, bool requested_profile, + std::function warn_func = nullptr) { if (member != name) { return true; } @@ -2666,7 +2692,7 @@ class JsonLoader { bool valid = true; const uint64_t new_value = value.asUInt64(); if (warn_func) { - if (warn_func(&layer_settings, device_name, name, new_value, *dest, not_modifiable)) { + if (warn_func(&layer_settings, requested_profile, device_name, name, new_value, *dest, not_modifiable)) { valid = false; } } @@ -2677,8 +2703,8 @@ class JsonLoader { return valid; } - bool GetValue(const char* device_name, const Json::Value &pparent, const std::string &member, const char *name, VkExtent2D *dest, bool not_modifiable, - std::function warn_func = nullptr) { + bool GetValue(const char* device_name, const Json::Value &pparent, const std::string &member, const char *name, VkExtent2D *dest, bool not_modifiable, bool requested_profile, + std::function warn_func = nullptr) { if (member != name) { return true; } @@ -2693,14 +2719,14 @@ class JsonLoader { } bool valid = true; for (const auto &prop : parent.getMemberNames()) { - GET_VALUE_WARN(prop, width, not_modifiable, warn_func); - GET_VALUE_WARN(prop, height, not_modifiable, warn_func); + GET_VALUE_WARN(prop, width, not_modifiable, requested_profile, warn_func); + GET_VALUE_WARN(prop, height, not_modifiable, requested_profile, warn_func); } return valid; } - bool GetValue(const char* device_name, const Json::Value &pparent, const std::string &member, const char *name, VkExtent3D *dest, bool not_modifiable, - std::function warn_func = nullptr) { + bool GetValue(const char* device_name, const Json::Value &pparent, const std::string &member, const char *name, VkExtent3D *dest, bool not_modifiable, bool requested_profile, + std::function warn_func = nullptr) { if (member != name) { return true; } @@ -2715,15 +2741,15 @@ class JsonLoader { } bool valid = true; for (const auto &prop : parent.getMemberNames()) { - GET_VALUE_WARN(prop, width, not_modifiable, warn_func); - GET_VALUE_WARN(prop, height, not_modifiable, warn_func); - GET_VALUE_WARN(prop, depth, not_modifiable, warn_func); + GET_VALUE_WARN(prop, width, not_modifiable, requested_profile, warn_func); + GET_VALUE_WARN(prop, height, not_modifiable, requested_profile, warn_func); + GET_VALUE_WARN(prop, depth, not_modifiable, requested_profile, warn_func); } - return true; + return valid; } - bool GetValueSizet(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, size_t *dest, bool not_modifiable, - std::function warn_func = nullptr) { + bool GetValueSizet(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, size_t *dest, bool not_modifiable, bool requested_profile, + std::function warn_func = nullptr) { if (member != name) { return true; } @@ -2737,7 +2763,7 @@ class JsonLoader { if (value.isUInt()) { const size_t new_value = value.asUInt(); if (warn_func) { - if (warn_func(&layer_settings, device_name, name, new_value, *dest, not_modifiable)) { + if (warn_func(&layer_settings, requested_profile, device_name, name, new_value, *dest, not_modifiable)) { valid = false; } } @@ -2750,8 +2776,8 @@ class JsonLoader { } template // for Vulkan enum types - bool GetValueFlag(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, T *dest, bool not_modifiable, - std::function warn_func = nullptr) { + bool GetValueFlag(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, T *dest, bool not_modifiable, bool requested_profile, + std::function warn_func = nullptr) { if (member != name) { return true; } @@ -2770,7 +2796,7 @@ class JsonLoader { } } } - if (WarnIfMissingBit(&layer_settings, device_name, name, new_value, static_cast(*dest), not_modifiable)) { + if (WarnIfMissingBit(&layer_settings, requested_profile, device_name, name, new_value, static_cast(*dest), not_modifiable)) { valid = false; } @@ -2781,8 +2807,8 @@ class JsonLoader { } template // for Vulkan enum types - bool GetValueEnum(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, T *dest, bool not_modifiable, - std::function warn_func = nullptr) { + bool GetValueEnum(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, T *dest, bool not_modifiable, bool requested_profile, + std::function warn_func = nullptr) { if (member != name) { return true; } @@ -2798,11 +2824,11 @@ class JsonLoader { new_value = static_cast(VkStringToUint(value.asString())); } if (warn_func) { - if (warn_func(&layer_settings, device_name, name, new_value, *dest, not_modifiable)) { + if (warn_func(&layer_settings, requested_profile, device_name, name, new_value, *dest, not_modifiable)) { valid = false; } } else { - if (WarnIfNotEqualEnum(&layer_settings, device_name, name, new_value, *dest, not_modifiable)) { + if (WarnIfNotEqualEnum(&layer_settings, requested_profile, device_name, name, new_value, *dest, not_modifiable)) { valid = false; } } @@ -2813,7 +2839,10 @@ class JsonLoader { return valid; } - int GetArray(const Json::Value &parent, const std::string &member, const char *name, uint8_t *dest, bool not_modifiable) { + int GetArray(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, uint8_t *dest, bool not_modifiable) { + (void)not_modifiable; + (void)device_name; + if (member != name) { return -1; } @@ -2829,7 +2858,10 @@ class JsonLoader { return count; } - int GetArray(const Json::Value &parent, const std::string &member, const char *name, uint32_t *dest, bool not_modifiable) { + int GetArray(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, uint32_t *dest, bool not_modifiable) { + (void)not_modifiable; + (void)device_name; + if (member != name) { return -1; } @@ -2845,7 +2877,10 @@ class JsonLoader { return count; } - int GetArray(const Json::Value &parent, const std::string &member, const char *name, float *dest, bool not_modifiable) { + int GetArray(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, float *dest, bool not_modifiable) { + (void)not_modifiable; + (void)device_name; + if (member != name) { return -1; } @@ -2861,7 +2896,10 @@ class JsonLoader { return count; } - int GetArray(const Json::Value &parent, const std::string &member, const char *name, char *dest, bool not_modifiable) { + int GetArray(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, char *dest, bool not_modifiable) { + (void)not_modifiable; + (void)device_name; + if (member != name) { return -1; } @@ -2880,7 +2918,10 @@ class JsonLoader { return count; } - int GetArray(const Json::Value &parent, const std::string &member, const char *name, VkImageLayout *dest, bool not_modifiable) { + int GetArray(const char* device_name, const Json::Value &parent, const std::string &member, const char *name, VkImageLayout *dest, bool not_modifiable) { + (void)not_modifiable; + (void)device_name; + if (member != name) { return -1; } @@ -3047,7 +3088,6 @@ bool JsonLoader::WarnDuplicatedFeature(const Json::Value &parent) { valid &= WarnDuplicated(&layer_settings, parent, {"VkPhysicalDevice8BitStorageFeatures", "VkPhysicalDeviceVulkanSC10Features"}); valid &= WarnDuplicated(&layer_settings, parent, {"VkPhysicalDeviceVulkanMemoryModelFeatures", "VkPhysicalDeviceVulkanSC10Features"}); valid &= WarnDuplicated(&layer_settings, parent, {"VkPhysicalDeviceShaderAtomicInt64Features", "VkPhysicalDeviceVulkanSC10Features"}); - valid &= WarnDuplicated(&layer_settings, parent, {"VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR", "VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT"}); valid &= WarnDuplicated(&layer_settings, parent, {"VkPhysicalDeviceScalarBlockLayoutFeatures", "VkPhysicalDeviceVulkanSC10Features"}); valid &= WarnDuplicated(&layer_settings, parent, {"VkPhysicalDeviceUniformBufferStandardLayoutFeatures", "VkPhysicalDeviceVulkanSC10Features"}); valid &= WarnDuplicated(&layer_settings, parent, {"VkPhysicalDeviceBufferDeviceAddressFeatures", "VkPhysicalDeviceVulkanSC10Features"}); @@ -3091,28 +3131,28 @@ bool JsonLoader::WarnDuplicatedProperty(const Json::Value &parent) { return valid; } -bool JsonLoader::GetFeature(const char *device_name, const Json::Value &features, const std::string &name) { +bool JsonLoader::GetFeature(const char *device_name, bool requested_profile, const Json::Value &features, const std::string &name) { const Json::Value &feature = features[name]; if (name == "VkPhysicalDeviceFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_features_); } else if (name == "VkPhysicalDeviceExternalSciBufFeaturesNV" || name == "VkPhysicalDeviceExternalMemorySciBufFeaturesNV") { #ifdef VK_USE_PLATFORM_SCI auto support = CheckExtensionSupport(VK_NV_EXTERNAL_MEMORY_SCI_BUF_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_external_memory_sci_buf_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_external_memory_sci_buf_features_); #else return false; #endif // VK_USE_PLATFORM_SCI } else if (name == "VkPhysicalDevicePrivateDataFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_private_data_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_private_data_features_); } else if (name == "VkPhysicalDeviceVariablePointerFeatures" || name == "VkPhysicalDeviceVariablePointersFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_variable_pointer_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_variable_pointer_features_); } else if (name == "VkPhysicalDeviceExternalSciSyncFeaturesNV") { #ifdef VK_USE_PLATFORM_SCI auto support = CheckExtensionSupport(VK_NV_EXTERNAL_SCI_SYNC_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_external_sci_sync_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_external_sci_sync_features_); #else return false; #endif // VK_USE_PLATFORM_SCI @@ -3120,195 +3160,207 @@ bool JsonLoader::GetFeature(const char *device_name, const Json::Value &features #ifdef VK_USE_PLATFORM_SCI auto support = CheckExtensionSupport(VK_NV_EXTERNAL_SCI_SYNC_2_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_external_sci_sync_2_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_external_sci_sync_2_features_); #else return false; #endif // VK_USE_PLATFORM_SCI } else if (name == "VkPhysicalDeviceMultiviewFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_multiview_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_multiview_features_); } else if (name == "VkPhysicalDevice16BitStorageFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_16_bit_storage_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_16_bit_storage_features_); } else if (name == "VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_shader_subgroup_extended_types_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_shader_subgroup_extended_types_features_); } else if (name == "VkPhysicalDeviceSamplerYcbcrConversionFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_sampler_ycbcr_conversion_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_sampler_ycbcr_conversion_features_); } else if (name == "VkPhysicalDeviceProtectedMemoryFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_protected_memory_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_protected_memory_features_); } else if (name == "VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_blend_operation_advanced_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_blend_operation_advanced_features_); } else if (name == "VkPhysicalDeviceInlineUniformBlockFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_inline_uniform_block_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_inline_uniform_block_features_); } else if (name == "VkPhysicalDeviceMaintenance4Features") { - return GetStruct(device_name, feature, &pdd_->physical_device_maintenance_4_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_maintenance_4_features_); } else if (name == "VkPhysicalDeviceShaderDrawParameterFeatures" || name == "VkPhysicalDeviceShaderDrawParametersFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_shader_draw_parameter_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_shader_draw_parameter_features_); } else if (name == "VkPhysicalDeviceShaderFloat16Int8Features") { - return GetStruct(device_name, feature, &pdd_->physical_device_float_16_int_8_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_float_16_int_8_features_); } else if (name == "VkPhysicalDeviceHostQueryResetFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_host_query_reset_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_host_query_reset_features_); + } else if (name == "VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR") { + auto support = CheckExtensionSupport(VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME, name); + if (support != ExtensionSupport::SUPPORTED) return valid(support); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_global_priority_query_features_); } else if (name == "VkPhysicalDeviceDescriptorIndexingFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_descriptor_indexing_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_descriptor_indexing_features_); } else if (name == "VkPhysicalDeviceTimelineSemaphoreFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_timeline_semaphore_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_timeline_semaphore_features_); } else if (name == "VkPhysicalDevice8BitStorageFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_8_bit_storage_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_8_bit_storage_features_); } else if (name == "VkPhysicalDeviceVulkanMemoryModelFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_vulkan_memory_model_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_vulkan_memory_model_features_); } else if (name == "VkPhysicalDeviceShaderAtomicInt64Features") { - return GetStruct(device_name, feature, &pdd_->physical_device_shader_atomic_int_64_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_shader_atomic_int_64_features_); } else if (name == "VkPhysicalDeviceShaderAtomicFloatFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_shader_atomic_float_features_); - } else if (name == "VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT" || name == "VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR") { - auto support = CheckExtensionSupport(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, name); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_shader_atomic_float_features_); + } else if (name == "VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR") { + auto support = CheckExtensionSupport(VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_vertex_attribute_divisor_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_vertex_attribute_divisor_features_); } else if (name == "VkPhysicalDeviceASTCDecodeFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_astcdecode_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_astcdecode_features_); } else if (name == "VkPhysicalDeviceScalarBlockLayoutFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_scalar_block_layout_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_scalar_block_layout_features_); } else if (name == "VkPhysicalDeviceUniformBufferStandardLayoutFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_uniform_buffer_standard_layout_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_uniform_buffer_standard_layout_features_); } else if (name == "VkPhysicalDeviceDepthClipEnableFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_depth_clip_enable_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_depth_clip_enable_features_); } else if (name == "VkPhysicalDeviceBufferDeviceAddressFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_buffer_device_address_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_buffer_device_address_features_); } else if (name == "VkPhysicalDeviceImagelessFramebufferFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_imageless_framebuffer_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_imageless_framebuffer_features_); } else if (name == "VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_texture_compression_astchdrfeatures_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_texture_compression_astchdrfeatures_); } else if (name == "VkPhysicalDeviceTextureCompressionASTCHDRFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_texture_compression_astchdrfeatures_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_texture_compression_astchdrfeatures_); } else if (name == "VkPhysicalDeviceYcbcrImageArraysFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_YCBCR_IMAGE_ARRAYS_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_ycbcr_image_arrays_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_ycbcr_image_arrays_features_); } else if (name == "VkPhysicalDevicePerformanceQueryFeaturesKHR") { auto support = CheckExtensionSupport(VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_performance_query_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_performance_query_features_); } else if (name == "VkPhysicalDeviceShaderClockFeaturesKHR") { auto support = CheckExtensionSupport(VK_KHR_SHADER_CLOCK_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_shader_clock_features_); - } else if (name == "VkPhysicalDeviceIndexTypeUint8FeaturesEXT" || name == "VkPhysicalDeviceIndexTypeUint8FeaturesKHR") { + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_shader_clock_features_); + } else if (name == "VkPhysicalDeviceIndexTypeUint8FeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_index_type_uint_8_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_index_type_uint_8_features_); + } else if (name == "VkPhysicalDeviceIndexTypeUint8FeaturesKHR") { + auto support = CheckExtensionSupport(VK_KHR_INDEX_TYPE_UINT8_EXTENSION_NAME, name); + if (support != ExtensionSupport::SUPPORTED) return valid(support); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_index_type_uint_8_features_); } else if (name == "VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_fragment_shader_interlock_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_fragment_shader_interlock_features_); } else if (name == "VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_separate_depth_stencil_layouts_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_separate_depth_stencil_layouts_features_); } else if (name == "VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_shader_demote_to_helper_invocation_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_shader_demote_to_helper_invocation_features_); } else if (name == "VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_shader_demote_to_helper_invocation_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_shader_demote_to_helper_invocation_features_); } else if (name == "VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_TEXEL_BUFFER_ALIGNMENT_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_texel_buffer_alignment_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_texel_buffer_alignment_features_); } else if (name == "VkPhysicalDeviceSubgroupSizeControlFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_subgroup_size_control_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_subgroup_size_control_features_); } else if (name == "VkPhysicalDeviceSubgroupSizeControlFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_subgroup_size_control_features_); - } else if (name == "VkPhysicalDeviceLineRasterizationFeaturesEXT" || name == "VkPhysicalDeviceLineRasterizationFeaturesKHR") { + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_subgroup_size_control_features_); + } else if (name == "VkPhysicalDeviceLineRasterizationFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_line_rasterization_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_line_rasterization_features_); + } else if (name == "VkPhysicalDeviceLineRasterizationFeaturesKHR") { + auto support = CheckExtensionSupport(VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME, name); + if (support != ExtensionSupport::SUPPORTED) return valid(support); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_line_rasterization_features_); } else if (name == "VkPhysicalDevicePipelineCreationCacheControlFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_pipeline_creation_cache_control_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_pipeline_creation_cache_control_features_); } else if (name == "VkPhysicalDeviceVulkan11Features") { - return GetStruct(device_name, feature, &pdd_->physical_device_vulkan_11_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_vulkan_11_features_); } else if (name == "VkPhysicalDeviceVulkan12Features") { - return GetStruct(device_name, feature, &pdd_->physical_device_vulkan_12_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_vulkan_12_features_); } else if (name == "VkPhysicalDeviceVulkan13Features") { - return GetStruct(device_name, feature, &pdd_->physical_device_vulkan_13_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_vulkan_13_features_); } else if (name == "VkPhysicalDeviceCustomBorderColorFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_custom_border_color_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_custom_border_color_features_); } else if (name == "VkPhysicalDeviceExtendedDynamicStateFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_extended_dynamic_state_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_extended_dynamic_state_features_); } else if (name == "VkPhysicalDeviceExtendedDynamicState2FeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_extended_dynamic_state_2_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_extended_dynamic_state_2_features_); } else if (name == "VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_zero_initialize_workgroup_memory_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_zero_initialize_workgroup_memory_features_); } else if (name == "VkPhysicalDeviceRobustness2FeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_robustness_2_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_robustness_2_features_); } else if (name == "VkPhysicalDeviceImageRobustnessFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_IMAGE_ROBUSTNESS_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_image_robustness_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_image_robustness_features_); } else if (name == "VkPhysicalDeviceImageRobustnessFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_image_robustness_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_image_robustness_features_); } else if (name == "VkPhysicalDevice4444FormatsFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_4444_FORMATS_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_4444_formats_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_4444_formats_features_); } else if (name == "VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_shader_image_atomic_int_64_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_shader_image_atomic_int_64_features_); } else if (name == "VkPhysicalDeviceFragmentShadingRateFeaturesKHR") { auto support = CheckExtensionSupport(VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_fragment_shading_rate_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_fragment_shading_rate_features_); } else if (name == "VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR") { auto support = CheckExtensionSupport(VK_KHR_SHADER_TERMINATE_INVOCATION_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_shader_terminate_invocation_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_shader_terminate_invocation_features_); } else if (name == "VkPhysicalDeviceShaderTerminateInvocationFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_shader_terminate_invocation_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_shader_terminate_invocation_features_); } else if (name == "VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_vertex_input_dynamic_state_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_vertex_input_dynamic_state_features_); } else if (name == "VkPhysicalDeviceColorWriteEnableFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_color_write_enable_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_color_write_enable_features_); } else if (name == "VkPhysicalDeviceSynchronization2FeaturesKHR") { auto support = CheckExtensionSupport(VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_synchronization_2_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_synchronization_2_features_); } else if (name == "VkPhysicalDeviceSynchronization2Features") { - return GetStruct(device_name, feature, &pdd_->physical_device_synchronization_2_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_synchronization_2_features_); } else if (name == "VkPhysicalDeviceVulkanSC10Features") { - return GetStruct(device_name, feature, &pdd_->physical_device_vulkan_sc_10_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_vulkan_sc_10_features_); } else if (name == "VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT") { auto support = CheckExtensionSupport(VK_EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_ycbcr_2_plane_444_formats_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_ycbcr_2_plane_444_formats_features_); } else if (name == "VkPhysicalDeviceShaderIntegerDotProductFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_shader_integer_dot_product_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_shader_integer_dot_product_features_); } else if (name == "VkPhysicalDeviceDynamicRenderingFeatures") { - return GetStruct(device_name, feature, &pdd_->physical_device_dynamic_rendering_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_dynamic_rendering_features_); } else if (name == "VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX") { #ifdef VK_USE_PLATFORM_SCREEN_QNX auto support = CheckExtensionSupport(VK_QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, feature, &pdd_->physical_device_external_memory_screen_buffer_features_); + return GetStruct(device_name, requested_profile, feature, &pdd_->physical_device_external_memory_screen_buffer_features_); #else return false; #endif // VK_USE_PLATFORM_SCREEN_QNX @@ -3317,122 +3369,128 @@ bool JsonLoader::GetFeature(const char *device_name, const Json::Value &features return true; } -bool JsonLoader::GetProperty(const char *device_name, const Json::Value &props, const std::string &name) { +bool JsonLoader::GetProperty(const char *device_name, bool requested_profile, const Json::Value &props, const std::string &name) { const Json::Value &property = props[name]; if (name == "VkPhysicalDeviceProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_properties_); } else if (name == "VkPhysicalDeviceSparseProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_properties_.sparseProperties); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_properties_.sparseProperties); } else if (name == "VkPhysicalDeviceLimits") { - return GetStruct(device_name, property, &pdd_->physical_device_properties_.limits); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_properties_.limits); } else if (name == "VkPhysicalDeviceDriverProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_driver_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_driver_properties_); } else if (name == "VkPhysicalDeviceIDProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_idproperties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_idproperties_); } else if (name == "VkPhysicalDeviceMultiviewProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_multiview_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_multiview_properties_); } else if (name == "VkPhysicalDeviceDiscardRectanglePropertiesEXT") { auto support = CheckExtensionSupport(VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_discard_rectangle_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_discard_rectangle_properties_); } else if (name == "VkPhysicalDeviceSubgroupProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_subgroup_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_subgroup_properties_); } else if (name == "VkPhysicalDevicePointClippingProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_point_clipping_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_point_clipping_properties_); } else if (name == "VkPhysicalDeviceProtectedMemoryProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_protected_memory_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_protected_memory_properties_); } else if (name == "VkPhysicalDeviceSamplerFilterMinmaxProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_sampler_filter_minmax_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_sampler_filter_minmax_properties_); } else if (name == "VkPhysicalDeviceSampleLocationsPropertiesEXT") { auto support = CheckExtensionSupport(VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_sample_locations_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_sample_locations_properties_); } else if (name == "VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT") { auto support = CheckExtensionSupport(VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_blend_operation_advanced_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_blend_operation_advanced_properties_); } else if (name == "VkPhysicalDeviceInlineUniformBlockProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_inline_uniform_block_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_inline_uniform_block_properties_); } else if (name == "VkPhysicalDeviceMaintenance3Properties") { - return GetStruct(device_name, property, &pdd_->physical_device_maintenance_3_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_maintenance_3_properties_); } else if (name == "VkPhysicalDeviceMaintenance4Properties") { - return GetStruct(device_name, property, &pdd_->physical_device_maintenance_4_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_maintenance_4_properties_); } else if (name == "VkPhysicalDeviceFloatControlsProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_float_controls_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_float_controls_properties_); } else if (name == "VkPhysicalDeviceExternalMemoryHostPropertiesEXT") { auto support = CheckExtensionSupport(VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_external_memory_host_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_external_memory_host_properties_); } else if (name == "VkPhysicalDeviceConservativeRasterizationPropertiesEXT") { auto support = CheckExtensionSupport(VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_conservative_rasterization_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_conservative_rasterization_properties_); } else if (name == "VkPhysicalDeviceDescriptorIndexingProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_descriptor_indexing_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_descriptor_indexing_properties_); } else if (name == "VkPhysicalDeviceTimelineSemaphoreProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_timeline_semaphore_properties_); - } else if (name == "VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT") { - auto support = CheckExtensionSupport(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, name); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_timeline_semaphore_properties_); + } else if (name == "VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR") { + auto support = CheckExtensionSupport(VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_vertex_attribute_divisor_properties_ext_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_vertex_attribute_divisor_properties_); } else if (name == "VkPhysicalDevicePCIBusInfoPropertiesEXT") { auto support = CheckExtensionSupport(VK_EXT_PCI_BUS_INFO_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_pcibus_info_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_pcibus_info_properties_); } else if (name == "VkPhysicalDeviceDepthStencilResolveProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_depth_stencil_resolve_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_depth_stencil_resolve_properties_); } else if (name == "VkPhysicalDevicePerformanceQueryPropertiesKHR") { auto support = CheckExtensionSupport(VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_performance_query_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_performance_query_properties_); } else if (name == "VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT") { auto support = CheckExtensionSupport(VK_EXT_TEXEL_BUFFER_ALIGNMENT_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_texel_buffer_alignment_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_texel_buffer_alignment_properties_); } else if (name == "VkPhysicalDeviceTexelBufferAlignmentProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_texel_buffer_alignment_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_texel_buffer_alignment_properties_); } else if (name == "VkPhysicalDeviceSubgroupSizeControlPropertiesEXT") { auto support = CheckExtensionSupport(VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_subgroup_size_control_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_subgroup_size_control_properties_); } else if (name == "VkPhysicalDeviceSubgroupSizeControlProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_subgroup_size_control_properties_); - } else if (name == "VkPhysicalDeviceLineRasterizationPropertiesEXT" || name == "VkPhysicalDeviceLineRasterizationPropertiesKHR") { + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_subgroup_size_control_properties_); + } else if (name == "VkPhysicalDeviceLineRasterizationPropertiesEXT") { auto support = CheckExtensionSupport(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_line_rasterization_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_line_rasterization_properties_); + } else if (name == "VkPhysicalDeviceLineRasterizationPropertiesKHR") { + auto support = CheckExtensionSupport(VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME, name); + if (support != ExtensionSupport::SUPPORTED) return valid(support); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_line_rasterization_properties_); } else if (name == "VkPhysicalDeviceVulkan11Properties") { - return GetStruct(device_name, property, &pdd_->physical_device_vulkan_11_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_vulkan_11_properties_); } else if (name == "VkPhysicalDeviceVulkan12Properties") { - return GetStruct(device_name, property, &pdd_->physical_device_vulkan_12_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_vulkan_12_properties_); } else if (name == "VkPhysicalDeviceVulkan13Properties") { - return GetStruct(device_name, property, &pdd_->physical_device_vulkan_13_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_vulkan_13_properties_); } else if (name == "VkPhysicalDeviceToolProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_tool_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_tool_properties_); } else if (name == "VkPhysicalDeviceCustomBorderColorPropertiesEXT") { auto support = CheckExtensionSupport(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_custom_border_color_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_custom_border_color_properties_); } else if (name == "VkPhysicalDeviceRobustness2PropertiesEXT") { auto support = CheckExtensionSupport(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_robustness_2_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_robustness_2_properties_); } else if (name == "VkPhysicalDeviceFragmentShadingRatePropertiesKHR") { auto support = CheckExtensionSupport(VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME, name); if (support != ExtensionSupport::SUPPORTED) return valid(support); - return GetStruct(device_name, property, &pdd_->physical_device_fragment_shading_rate_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_fragment_shading_rate_properties_); } else if (name == "VkPhysicalDeviceVulkanSC10Properties") { - return GetStruct(device_name, property, &pdd_->physical_device_vulkan_sc_10_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_vulkan_sc_10_properties_); } else if (name == "VkPhysicalDeviceShaderIntegerDotProductProperties") { - return GetStruct(device_name, property, &pdd_->physical_device_shader_integer_dot_product_properties_); + return GetStruct(device_name, requested_profile, property, &pdd_->physical_device_shader_integer_dot_product_properties_); } return true; } -bool JsonLoader::GetFormat(const char *device_name, const Json::Value &formats, const std::string &format_name, MapOfVkFormatProperties *dest, +bool JsonLoader::GetFormat(const char *device_name, bool requested_profile, const Json::Value &formats, const std::string &format_name, MapOfVkFormatProperties *dest, MapOfVkFormatProperties3 *dest3) { + (void)requested_profile; + VkFormat format = StringToFormat(format_name); VkFormatProperties profile_properties = {}; VkFormatProperties3 profile_properties_3 = {VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3}; @@ -3597,7 +3655,7 @@ bool JsonLoader::GetQueueFamilyProperties(const char* device_name, const Json::V for (const auto &feature : props["queueFlags"]) { dest->properties_2.queueFamilyProperties.queueFlags |= StringToVkQueueFlags(feature.asString()); } - dest->properties_2.queueFamilyProperties.queueCount = props["queueCount"].asInt(); + dest->properties_2.queueFamilyProperties.queueCount = static_cast(props["queueCount"].asInt()); dest->properties_2.queueFamilyProperties.timestampValidBits = props["timestampValidBits"].asUInt(); const auto &minImagetransferGranularity = props["minImageTransferGranularity"]; dest->properties_2.queueFamilyProperties.minImageTransferGranularity.width = @@ -3611,7 +3669,7 @@ bool JsonLoader::GetQueueFamilyProperties(const char* device_name, const Json::V for (const auto &feature : props2["queueFlags"]) { dest->properties_2.queueFamilyProperties.queueFlags |= StringToVkQueueFlags(feature.asString()); } - dest->properties_2.queueFamilyProperties.queueCount = props2["queueCount"].asInt(); + dest->properties_2.queueFamilyProperties.queueCount = static_cast(props2["queueCount"].asInt()); dest->properties_2.queueFamilyProperties.timestampValidBits = props2["timestampValidBits"].asUInt(); const auto &minImagetransferGranularity = props2["minImageTransferGranularity"]; dest->properties_2.queueFamilyProperties.minImageTransferGranularity.width = @@ -3620,20 +3678,13 @@ bool JsonLoader::GetQueueFamilyProperties(const char* device_name, const Json::V minImagetransferGranularity["height"].asUInt(); dest->properties_2.queueFamilyProperties.minImageTransferGranularity.depth = minImagetransferGranularity["depth"].asUInt(); -#ifdef VULKANSC - } else if (name == "VkQueueFamilyGlobalPriorityPropertiesEXT") { - uint32_t i = 0; - for (const auto &feature : props["priorities"]) { - dest->global_priority_properties_.priorities[i++] = StringToVkQueueGlobalPriorityEXT(feature.asString()); - } - dest->global_priority_properties_.priorityCount = props["priorityCount"].asUInt(); -#else } else if (name == "VkQueueFamilyGlobalPriorityPropertiesKHR" || name == "VkQueueFamilyGlobalPriorityPropertiesEXT") { uint32_t i = 0; for (const auto &feature : props["priorities"]) { dest->global_priority_properties_.priorities[i++] = StringToVkQueueGlobalPriorityKHR(feature.asString()); } dest->global_priority_properties_.priorityCount = props["priorityCount"].asUInt(); +#ifndef VULKANSC } else if (name == "VkQueueFamilyVideoPropertiesKHR") { for (const auto &feature : props["videoCodecOperations"]) { dest->video_properties_.videoCodecOperations |= StringToVkVideoCodecOperationFlagsKHR(feature.asString()); @@ -3684,8 +3735,9 @@ bool JsonLoader::GetQueueFamilyProperties(const char* device_name, const Json::V } if (!supported) { std::string message = - format("Device has no queue family that supports VkQueueFamilyProperties [queueFlags: %s, queueCount: %" PRIu32 + format("Device (%s) has no queue family that supports VkQueueFamilyProperties [queueFlags: %s, queueCount: %" PRIu32 ", timestampValidBits: %" PRIu32 ", minImageTransferGranularity: [%" PRIu32 ", %" PRIu32 ", %" PRIu32 "]]", + device_name, GetQueueFlagsToString(dest->properties_2.queueFamilyProperties.queueFlags).c_str(), dest->properties_2.queueFamilyProperties.queueCount, dest->properties_2.queueFamilyProperties.timestampValidBits, dest->properties_2.queueFamilyProperties.minImageTransferGranularity.width, @@ -3835,7 +3887,7 @@ void JsonLoader::AddPromotedExtensions(uint32_t api_version) { } -VkResult JsonLoader::ReadProfile(const char *device_name, const Json::Value& root, const std::vector> &capabilities) { +VkResult JsonLoader::ReadProfile(const char *device_name, const Json::Value& root, const std::vector> &capabilities, bool requested_profile, bool enable_warnings) { bool failed = false; uint32_t properties_api_version = 0; @@ -3848,14 +3900,14 @@ VkResult JsonLoader::ReadProfile(const char *device_name, const Json::Value& roo const auto &properties = cap_definision["properties"]; if (properties.isMember("VkPhysicalDeviceProperties") && properties["VkPhysicalDeviceProperties"].isMember("apiVersion")) { - properties_api_version = properties["VkPhysicalDeviceProperties"]["apiVersion"].asInt(); + properties_api_version = static_cast(properties["VkPhysicalDeviceProperties"]["apiVersion"].asInt()); simulated_version = properties_api_version; } else if (layer_settings.simulate.capabilities & SIMULATE_API_VERSION_BIT) { simulated_version = profile_api_version_; } } } - if (simulated_version != 0) { + if (simulated_version != 0 && requested_profile) { AddPromotedExtensions(simulated_version); } @@ -3867,7 +3919,8 @@ VkResult JsonLoader::ReadProfile(const char *device_name, const Json::Value& roo if (VK_API_VERSION_PATCH(this->profile_api_version_) > VK_API_VERSION_PATCH(pdd_->physical_device_properties_.apiVersion)) { LogMessage(&layer_settings, DEBUG_REPORT_WARNING_BIT, "Profile apiVersion (%" PRIu32 ".%" PRIu32 ".%" PRIu32 ") is greater than the device apiVersion (%" PRIu32 ".%" PRIu32 ".%" PRIu32 ").\n", - VK_API_VERSION_MAJOR(this->profile_api_version_), VK_API_VERSION_MINOR(this->profile_api_version_), + VK_API_VERSION_MAJOR(this->profile_api_version_), + VK_API_VERSION_MINOR(this->profile_api_version_), VK_API_VERSION_PATCH(this->profile_api_version_), VK_API_VERSION_MAJOR(pdd_->physical_device_properties_.apiVersion), VK_API_VERSION_MINOR(pdd_->physical_device_properties_.apiVersion), @@ -3882,7 +3935,7 @@ VkResult JsonLoader::ReadProfile(const char *device_name, const Json::Value& roo for (const auto &e : extensions.getMemberNames()) { VkExtensionProperties extension; strcpy(extension.extensionName, e.c_str()); - extension.specVersion = extensions[e].asInt(); + extension.specVersion = static_cast(extensions[e].asInt()); bool found = pdd_->map_of_extension_properties_.count(e) > 0; @@ -3923,7 +3976,7 @@ VkResult JsonLoader::ReadProfile(const char *device_name, const Json::Value& roo if (features.isMember("VkPhysicalDeviceVulkan13Features")) { pdd_->vulkan_1_3_features_written_ = true; } - bool success = GetFeature(device_name, features, feature); + bool success = GetFeature(device_name, enable_warnings, features, feature); if (!success) { failed = true; } @@ -3946,7 +3999,7 @@ VkResult JsonLoader::ReadProfile(const char *device_name, const Json::Value& roo pdd_->vulkan_1_3_properties_written_ = true; } for (const auto &prop : properties.getMemberNames()) { - bool success = GetProperty(device_name, properties, prop); + bool success = GetProperty(device_name, enable_warnings, properties, prop); if (!success) { failed = true; } @@ -3957,7 +4010,7 @@ VkResult JsonLoader::ReadProfile(const char *device_name, const Json::Value& roo const auto &formats = cap_definision["formats"]; for (const auto &format : formats.getMemberNames()) { - bool success = GetFormat(device_name, formats, format, &pdd_->map_of_format_properties_, &pdd_->map_of_format_properties_3_); + bool success = GetFormat(device_name, enable_warnings, formats, format, &pdd_->map_of_format_properties_, &pdd_->map_of_format_properties_3_); if (!success) { failed = true; } @@ -3986,22 +4039,24 @@ VkResult JsonLoader::ReadProfile(const char *device_name, const Json::Value& roo } } - if (properties_api_version != 0) { - LogMessage(&layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, - "- VkPhysicalDeviceProperties API version: %" PRIu32 ".%" PRIu32 ".%" PRIu32 ". Using the API version specified by the profile VkPhysicalDeviceProperties structure.\n", - VK_API_VERSION_MAJOR(properties_api_version), VK_API_VERSION_MINOR(properties_api_version), VK_API_VERSION_PATCH(properties_api_version)); - } else if (layer_settings.simulate.capabilities & SIMULATE_API_VERSION_BIT) { - LogMessage(&layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, - "- VkPhysicalDeviceProperties API version: %" PRIu32 ".%" PRIu32 ".%" PRIu32". Using the API version specified by the profile.\n", - VK_API_VERSION_MAJOR(this->profile_api_version_), VK_API_VERSION_MINOR(this->profile_api_version_), VK_API_VERSION_PATCH(this->profile_api_version_)); + if (requested_profile) { + if (properties_api_version != 0) { + LogMessage(&layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, + "- VkPhysicalDeviceProperties API version: %" PRIu32 ".%" PRIu32 ".%" PRIu32 ". Using the API version specified by the profile VkPhysicalDeviceProperties structure.\n", + VK_API_VERSION_MAJOR(properties_api_version), VK_API_VERSION_MINOR(properties_api_version), VK_API_VERSION_PATCH(properties_api_version)); + } else if (layer_settings.simulate.capabilities & SIMULATE_API_VERSION_BIT) { + LogMessage(&layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, + "- VkPhysicalDeviceProperties API version: %" PRIu32 ".%" PRIu32 ".%" PRIu32". Using the API version specified by the profile.\n", + VK_API_VERSION_MAJOR(this->profile_api_version_), VK_API_VERSION_MINOR(this->profile_api_version_), VK_API_VERSION_PATCH(this->profile_api_version_)); - pdd_->physical_device_properties_.apiVersion = this->profile_api_version_; - } else { - LogMessage(&layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, - "- VkPhysicalDeviceProperties API version: %" PRIu32 ".%" PRIu32 ".%" PRIu32 ". Using the device version.\n", - VK_API_VERSION_MAJOR(pdd_->physical_device_properties_.apiVersion), - VK_API_VERSION_MINOR(pdd_->physical_device_properties_.apiVersion), - VK_API_VERSION_PATCH(pdd_->physical_device_properties_.apiVersion)); + pdd_->physical_device_properties_.apiVersion = this->profile_api_version_; + } else { + LogMessage(&layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, + "- VkPhysicalDeviceProperties API version: %" PRIu32 ".%" PRIu32 ".%" PRIu32 ". Using the device version.\n", + VK_API_VERSION_MAJOR(pdd_->physical_device_properties_.apiVersion), + VK_API_VERSION_MINOR(pdd_->physical_device_properties_.apiVersion), + VK_API_VERSION_PATCH(pdd_->physical_device_properties_.apiVersion)); + } } if (failed && layer_settings.log.debug_fail_on_error) { @@ -4012,15 +4067,13 @@ VkResult JsonLoader::ReadProfile(const char *device_name, const Json::Value& roo } VkResult JsonLoader::LoadFile(const std::string& filename) { - LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "JsonLoader::LoadFile(\"%s\")\n", filename.c_str()); - if (filename.empty()) { return VK_SUCCESS; } std::ifstream json_file(filename); if (!json_file) { LogMessage(&layer_settings, DEBUG_REPORT_ERROR_BIT, "Fail to open file \"%s\"\n", filename.c_str()); - return layer_settings.log.debug_fail_on_error ? VK_ERROR_INITIALIZATION_FAILED : VK_SUCCESS; + return VK_SUCCESS; } Json::Value root = Json::nullValue; @@ -4029,14 +4082,28 @@ VkResult JsonLoader::LoadFile(const std::string& filename) { bool success = Json::parseFromStream(builder, json_file, &root, &errs); if (!success) { LogMessage(&layer_settings, DEBUG_REPORT_ERROR_BIT, "Fail to parse file \"%s\" {\n%s}\n", filename.c_str(), errs.c_str()); - return layer_settings.log.debug_fail_on_error ? VK_ERROR_INITIALIZATION_FAILED : VK_SUCCESS; + return VK_SUCCESS; } json_file.close(); if (root.type() != Json::objectValue) { LogMessage(&layer_settings, DEBUG_REPORT_ERROR_BIT, "Json document root is not an object in file \"%s\"\n", filename.c_str()); - return layer_settings.log.debug_fail_on_error ? VK_ERROR_INITIALIZATION_FAILED : VK_SUCCESS; + return VK_SUCCESS; + } + +#ifndef VULKANSC + const Json::Value& schema_node = root["$schema"]; + if (schema_node == Json::Value::nullSingleton()) { + return VK_SUCCESS; + } + + const std::string &schema = schema_node.asCString(); + if (schema.find("https://schema.khronos.org/vulkan/profiles") == std::string::npos) { + return VK_SUCCESS; } +#endif // VULKANSC + + LogMessage(&layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, "Loading \"%s\"\n", filename.c_str()); if (layer_settings.simulate.profile_validation) { JsonValidator validator; @@ -4072,18 +4139,41 @@ VkResult JsonLoader::LoadProfilesDatabase() { const std::string& path = layer_settings.simulate.profile_dirs[i]; for (const auto& entry : fs::directory_iterator(path)) { - VkResult result = this->LoadFile(entry.path().generic_string()); + if (fs::is_directory(entry.path())) { + continue; + } + + const std::string& file_path = entry.path().generic_string(); + if (!EndsWith(file_path, ".json")) { + continue; + } + + VkResult result = this->LoadFile(file_path); if (result != VK_SUCCESS) { continue; } } } + LogFoundProfiles(); + ReadProfileApiVersion(); return VK_SUCCESS; } +void JsonLoader::LogFoundProfiles() { + for (const auto& root : this->profiles_file_roots_) { + LogMessage(&layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, "Profiles found in '%s' file:\n", root.first.c_str()); + + const Json::Value &profiles = root.second["profiles"]; + + for (const std::string &profile : profiles.getMemberNames()) { + LogMessage(&layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, "- %s\n", profile.c_str()); + } + } +} + const Json::Value& JsonLoader::FindRootFromProfileName(const std::string& profile_name) const { for (const auto& root : this->profiles_file_roots_) { const Json::Value &profiles = root.second["profiles"]; @@ -4109,7 +4199,7 @@ void JsonLoader::ReadProfileApiVersion() { uint32_t api_major = 0; uint32_t api_minor = 0; uint32_t api_patch = 0; - std::sscanf(version_string.c_str(), "%d.%d.%d", &api_major, &api_minor, &api_patch); + std::sscanf(version_string.c_str(), "%u.%u.%u", &api_major, &api_minor, &api_patch); #ifdef VULKANSC profile_api_version_ = VK_MAKE_API_VERSION(VKSC_API_VARIANT, api_major, api_minor, api_patch); #else @@ -4126,7 +4216,7 @@ void JsonLoader::ReadProfileApiVersion() { uint32_t api_major = 0; uint32_t api_minor = 0; uint32_t api_patch = 0; - std::sscanf(version_string.c_str(), "%d.%d.%d", &api_major, &api_minor, &api_patch); + std::sscanf(version_string.c_str(), "%u.%u.%u", &api_major, &api_minor, &api_patch); #ifdef VULKANSC profile_api_version_ = VK_MAKE_API_VERSION(VKSC_API_VARIANT, api_major, api_minor, api_patch); #else @@ -4187,8 +4277,20 @@ VkResult JsonLoader::LoadDevice(const char* device_name, PhysicalDeviceData *pdd const auto& root = FindRootFromProfileName(profile_name); if (root == Json::Value::nullSingleton()) { + if (requested_profile_name == profile_name) { + LogMessage(&layer_settings, DEBUG_REPORT_ERROR_BIT, "- '%s' profile not found.\n", profile_name.c_str()); + } else { + LogMessage(&layer_settings, DEBUG_REPORT_ERROR_BIT, "- '%s' profile required by '%s' not found.\n", profile_name.c_str(), requested_profile_name.c_str()); + } + result = VK_ERROR_UNKNOWN; } else { + if (requested_profile_name == profile_name) { + LogMessage(&layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, "- Overriding device capabilities with the '%s' profile capabilities.\n", profile_name.c_str()); + } else { + LogMessage(&layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, "- Overriding device capabilities with the '%s' profile capabilities required by the requested '%s' profile.\n", profile_name.c_str(), requested_profile_name.c_str()); + } + const Json::Value &profiles = root["profiles"]; std::vector> capabilities; @@ -4210,8 +4312,6 @@ VkResult JsonLoader::LoadDevice(const char* device_name, PhysicalDeviceData *pdd } found_profile = true; - LogMessage(&layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, - "- Overriding device capabilities with '%s' profile capabilities.\n", profile.c_str()); break; // load a single profile } } @@ -4231,10 +4331,6 @@ VkResult JsonLoader::LoadDevice(const char* device_name, PhysicalDeviceData *pdd capabilities.push_back(cap_variants); } - LogMessage(&layer_settings, DEBUG_REPORT_WARNING_BIT, - "\"%s\" profile could not be found in \"%s\" file. Loading the default \"%s\" profile of the file.\n", - layer_settings.simulate.profile_name.c_str(), layer_settings.simulate.profile_file.c_str(), profile.c_str()); - break; // Systematically load the first and default profile } } @@ -4263,7 +4359,7 @@ VkResult JsonLoader::LoadDevice(const char* device_name, PhysicalDeviceData *pdd uint32_t version_major = 0; uint32_t version_minor = 0; uint32_t version_patch = 0; - std::sscanf(version.c_str(), "%d.%d.%d", &version_major, &version_minor, &version_patch); + std::sscanf(version.c_str(), "%u.%u.%u", &version_major, &version_minor, &version_patch); if (VK_HEADER_VERSION < version_patch) { LogMessage(&layer_settings, DEBUG_REPORT_WARNING_BIT, "%s is built against Vulkan Header %d but the profile is written against Vulkan Header %d.\n\t- All newer capabilities in the profile will be ignored by the layer.\n", @@ -4275,7 +4371,7 @@ VkResult JsonLoader::LoadDevice(const char* device_name, PhysicalDeviceData *pdd pdd_->simulation_extensions_.clear(); } - tmp_result = ReadProfile(device_name, root, capabilities); + tmp_result = ReadProfile(device_name, root, capabilities, requested_profile_name == profile_name, required_profiles.size() == 1); if (tmp_result != VK_SUCCESS) { result = tmp_result; } @@ -4289,1427 +4385,1535 @@ VkResult JsonLoader::LoadDevice(const char* device_name, PhysicalDeviceData *pdd return result; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDriverProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDriverProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceDriverProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_ENUM_WARN(member, driverID, true, WarnIfNotEqualEnum); - GetArray(parent, member, "driverName", dest->driverName, true); - GetArray(parent, member, "driverInfo", dest->driverInfo, true); + GET_VALUE_ENUM_WARN(member, driverID, true, requested_profile, WarnIfNotEqualEnum); + GetArray(device_name, parent, member, "driverName", dest->driverName, true); + GetArray(device_name, parent, member, "driverInfo", dest->driverInfo, true); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceIDProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceIDProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceIDProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GetArray(parent, member, "deviceUUID", dest->deviceUUID, true); - GetArray(parent, member, "driverUUID", dest->driverUUID, true); - GetArray(parent, member, "deviceLUID", dest->deviceLUID, true); - GET_VALUE_WARN(member, deviceNodeMask, true, WarnIfNotEqual32u); - GET_VALUE_WARN(member, deviceLUIDValid, true, WarnIfNotEqualBool); + GetArray(device_name, parent, member, "deviceUUID", dest->deviceUUID, true); + GetArray(device_name, parent, member, "driverUUID", dest->driverUUID, true); + GetArray(device_name, parent, member, "deviceLUID", dest->deviceLUID, true); + GET_VALUE_WARN(member, deviceNodeMask, true, requested_profile, WarnIfNotEqual32u); + GET_VALUE_WARN(member, deviceLUIDValid, true, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceMultiviewProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceMultiviewProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceMultiviewProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, maxMultiviewViewCount, false, WarnIfGreater); - GET_VALUE_WARN(member, maxMultiviewInstanceIndex, false, WarnIfGreater); + GET_VALUE_WARN(member, maxMultiviewViewCount, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxMultiviewInstanceIndex, false, requested_profile, WarnIfGreater); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSubgroupProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSubgroupProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceSubgroupProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, subgroupSize, false, WarnIfGreater); - GET_VALUE_FLAG_WARN(member, supportedStages, false); - GET_VALUE_FLAG_WARN(member, supportedOperations, false); - GET_VALUE_WARN(member, quadOperationsInAllStages, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, subgroupSize, false, requested_profile, WarnIfGreater); + GET_VALUE_FLAG_WARN(member, supportedStages, false, requested_profile); + GET_VALUE_FLAG_WARN(member, supportedOperations, false, requested_profile); + GET_VALUE_WARN(member, quadOperationsInAllStages, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePointClippingProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePointClippingProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDevicePointClippingProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_ENUM_WARN(member, pointClippingBehavior, true, WarnIfNotEqualEnum); + GET_VALUE_ENUM_WARN(member, pointClippingBehavior, true, requested_profile, WarnIfNotEqualEnum); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceProtectedMemoryProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceProtectedMemoryProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceProtectedMemoryProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, protectedNoFault, true, WarnIfNotEqualBool); + GET_VALUE_WARN(member, protectedNoFault, true, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSamplerFilterMinmaxProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSamplerFilterMinmaxProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceSamplerFilterMinmaxProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, filterMinmaxSingleComponentFormats, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, filterMinmaxImageComponentMapping, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, filterMinmaxSingleComponentFormats, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, filterMinmaxImageComponentMapping, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceInlineUniformBlockProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceInlineUniformBlockProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceInlineUniformBlockProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, maxInlineUniformBlockSize, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorInlineUniformBlocks, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetInlineUniformBlocks, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindInlineUniformBlocks, false, WarnIfGreater); + GET_VALUE_WARN(member, maxInlineUniformBlockSize, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorInlineUniformBlocks, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetInlineUniformBlocks, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindInlineUniformBlocks, false, requested_profile, WarnIfGreater); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceMaintenance3Properties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceMaintenance3Properties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceMaintenance3Properties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, maxPerSetDescriptors, false, WarnIfGreater); - GET_VALUE_WARN(member, maxMemoryAllocationSize, false, WarnIfGreater); + GET_VALUE_WARN(member, maxPerSetDescriptors, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxMemoryAllocationSize, false, requested_profile, WarnIfGreater); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceMaintenance4Properties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceMaintenance4Properties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceMaintenance4Properties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, maxBufferSize, false, WarnIfGreater); + GET_VALUE_WARN(member, maxBufferSize, false, requested_profile, WarnIfGreater); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceFloatControlsProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceFloatControlsProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceFloatControlsProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_ENUM_WARN(member, denormBehaviorIndependence, true, WarnIfNotEqualEnum); - GET_VALUE_ENUM_WARN(member, roundingModeIndependence, true, WarnIfNotEqualEnum); - GET_VALUE_WARN(member, shaderSignedZeroInfNanPreserveFloat16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSignedZeroInfNanPreserveFloat32, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSignedZeroInfNanPreserveFloat64, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDenormPreserveFloat16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDenormPreserveFloat32, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDenormPreserveFloat64, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDenormFlushToZeroFloat16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDenormFlushToZeroFloat32, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDenormFlushToZeroFloat64, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderRoundingModeRTEFloat16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderRoundingModeRTEFloat32, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderRoundingModeRTEFloat64, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderRoundingModeRTZFloat16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderRoundingModeRTZFloat32, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderRoundingModeRTZFloat64, false, WarnIfNotEqualBool); + GET_VALUE_ENUM_WARN(member, denormBehaviorIndependence, true, requested_profile, WarnIfNotEqualEnum); + GET_VALUE_ENUM_WARN(member, roundingModeIndependence, true, requested_profile, WarnIfNotEqualEnum); + GET_VALUE_WARN(member, shaderSignedZeroInfNanPreserveFloat16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSignedZeroInfNanPreserveFloat32, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSignedZeroInfNanPreserveFloat64, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDenormPreserveFloat16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDenormPreserveFloat32, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDenormPreserveFloat64, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDenormFlushToZeroFloat16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDenormFlushToZeroFloat32, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDenormFlushToZeroFloat64, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderRoundingModeRTEFloat16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderRoundingModeRTEFloat32, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderRoundingModeRTEFloat64, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderRoundingModeRTZFloat16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderRoundingModeRTZFloat32, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderRoundingModeRTZFloat64, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDescriptorIndexingProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDescriptorIndexingProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceDescriptorIndexingProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, maxUpdateAfterBindDescriptorsInAllPools, false, WarnIfGreater); - GET_VALUE_WARN(member, shaderUniformBufferArrayNonUniformIndexingNative, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSampledImageArrayNonUniformIndexingNative, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageBufferArrayNonUniformIndexingNative, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageImageArrayNonUniformIndexingNative, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderInputAttachmentArrayNonUniformIndexingNative, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, robustBufferAccessUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, quadDivergentImplicitLod, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindSamplers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindUniformBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindStorageBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindSampledImages, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindStorageImages, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindInputAttachments, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageUpdateAfterBindResources, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindSamplers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindUniformBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindUniformBuffersDynamic, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindStorageBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindStorageBuffersDynamic, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindSampledImages, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindStorageImages, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindInputAttachments, false, WarnIfGreater); + GET_VALUE_WARN(member, maxUpdateAfterBindDescriptorsInAllPools, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, shaderUniformBufferArrayNonUniformIndexingNative, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSampledImageArrayNonUniformIndexingNative, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageBufferArrayNonUniformIndexingNative, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageImageArrayNonUniformIndexingNative, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderInputAttachmentArrayNonUniformIndexingNative, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, robustBufferAccessUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, quadDivergentImplicitLod, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindSamplers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindUniformBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindStorageBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindSampledImages, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindStorageImages, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindInputAttachments, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageUpdateAfterBindResources, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindSamplers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindUniformBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindUniformBuffersDynamic, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindStorageBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindStorageBuffersDynamic, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindSampledImages, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindStorageImages, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindInputAttachments, false, requested_profile, WarnIfGreater); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceTimelineSemaphoreProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceTimelineSemaphoreProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceTimelineSemaphoreProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, maxTimelineSemaphoreValueDifference, false, WarnIfGreater); + GET_VALUE_WARN(member, maxTimelineSemaphoreValueDifference, false, requested_profile, WarnIfGreater); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDepthStencilResolveProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDepthStencilResolveProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceDepthStencilResolveProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_FLAG_WARN(member, supportedDepthResolveModes, false); - GET_VALUE_FLAG_WARN(member, supportedStencilResolveModes, false); - GET_VALUE_WARN(member, independentResolveNone, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, independentResolve, false, WarnIfNotEqualBool); + GET_VALUE_FLAG_WARN(member, supportedDepthResolveModes, false, requested_profile); + GET_VALUE_FLAG_WARN(member, supportedStencilResolveModes, false, requested_profile); + GET_VALUE_WARN(member, independentResolveNone, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, independentResolve, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkan11Properties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkan11Properties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVulkan11Properties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GetArray(parent, member, "deviceUUID", dest->deviceUUID, true); - GetArray(parent, member, "driverUUID", dest->driverUUID, true); - GetArray(parent, member, "deviceLUID", dest->deviceLUID, true); - GET_VALUE_WARN(member, deviceNodeMask, true, WarnIfNotEqual32u); - GET_VALUE_WARN(member, deviceLUIDValid, true, WarnIfNotEqualBool); - GET_VALUE_WARN(member, subgroupSize, false, WarnIfGreater); - GET_VALUE_FLAG_WARN(member, subgroupSupportedStages, false); - GET_VALUE_FLAG_WARN(member, subgroupSupportedOperations, false); - GET_VALUE_WARN(member, subgroupQuadOperationsInAllStages, false, WarnIfNotEqualBool); - GET_VALUE_ENUM_WARN(member, pointClippingBehavior, true, WarnIfNotEqualEnum); - GET_VALUE_WARN(member, maxMultiviewViewCount, false, WarnIfGreater); - GET_VALUE_WARN(member, maxMultiviewInstanceIndex, false, WarnIfGreater); - GET_VALUE_WARN(member, protectedNoFault, true, WarnIfNotEqualBool); - GET_VALUE_WARN(member, maxPerSetDescriptors, false, WarnIfGreater); - GET_VALUE_WARN(member, maxMemoryAllocationSize, false, WarnIfGreater); + GetArray(device_name, parent, member, "deviceUUID", dest->deviceUUID, true); + GetArray(device_name, parent, member, "driverUUID", dest->driverUUID, true); + GetArray(device_name, parent, member, "deviceLUID", dest->deviceLUID, true); + GET_VALUE_WARN(member, deviceNodeMask, true, requested_profile, WarnIfNotEqual32u); + GET_VALUE_WARN(member, deviceLUIDValid, true, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, subgroupSize, false, requested_profile, WarnIfGreater); + GET_VALUE_FLAG_WARN(member, subgroupSupportedStages, false, requested_profile); + GET_VALUE_FLAG_WARN(member, subgroupSupportedOperations, false, requested_profile); + GET_VALUE_WARN(member, subgroupQuadOperationsInAllStages, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_ENUM_WARN(member, pointClippingBehavior, true, requested_profile, WarnIfNotEqualEnum); + GET_VALUE_WARN(member, maxMultiviewViewCount, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxMultiviewInstanceIndex, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, protectedNoFault, true, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, maxPerSetDescriptors, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxMemoryAllocationSize, false, requested_profile, WarnIfGreater); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkan12Properties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkan12Properties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVulkan12Properties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_ENUM_WARN(member, driverID, true, WarnIfNotEqualEnum); - GetArray(parent, member, "driverName", dest->driverName, true); - GetArray(parent, member, "driverInfo", dest->driverInfo, true); - GET_VALUE_ENUM_WARN(member, denormBehaviorIndependence, true, WarnIfNotEqualEnum); - GET_VALUE_ENUM_WARN(member, roundingModeIndependence, true, WarnIfNotEqualEnum); - GET_VALUE_WARN(member, shaderSignedZeroInfNanPreserveFloat16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSignedZeroInfNanPreserveFloat32, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSignedZeroInfNanPreserveFloat64, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDenormPreserveFloat16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDenormPreserveFloat32, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDenormPreserveFloat64, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDenormFlushToZeroFloat16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDenormFlushToZeroFloat32, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDenormFlushToZeroFloat64, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderRoundingModeRTEFloat16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderRoundingModeRTEFloat32, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderRoundingModeRTEFloat64, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderRoundingModeRTZFloat16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderRoundingModeRTZFloat32, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderRoundingModeRTZFloat64, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, maxUpdateAfterBindDescriptorsInAllPools, false, WarnIfGreater); - GET_VALUE_WARN(member, shaderUniformBufferArrayNonUniformIndexingNative, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSampledImageArrayNonUniformIndexingNative, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageBufferArrayNonUniformIndexingNative, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageImageArrayNonUniformIndexingNative, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderInputAttachmentArrayNonUniformIndexingNative, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, robustBufferAccessUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, quadDivergentImplicitLod, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindSamplers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindUniformBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindStorageBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindSampledImages, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindStorageImages, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindInputAttachments, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageUpdateAfterBindResources, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindSamplers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindUniformBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindUniformBuffersDynamic, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindStorageBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindStorageBuffersDynamic, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindSampledImages, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindStorageImages, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindInputAttachments, false, WarnIfGreater); - GET_VALUE_FLAG_WARN(member, supportedDepthResolveModes, false); - GET_VALUE_FLAG_WARN(member, supportedStencilResolveModes, false); - GET_VALUE_WARN(member, independentResolveNone, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, independentResolve, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, filterMinmaxSingleComponentFormats, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, filterMinmaxImageComponentMapping, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, maxTimelineSemaphoreValueDifference, false, WarnIfGreater); - GET_VALUE_FLAG_WARN(member, framebufferIntegerColorSampleCounts, false); + GET_VALUE_ENUM_WARN(member, driverID, true, requested_profile, WarnIfNotEqualEnum); + GetArray(device_name, parent, member, "driverName", dest->driverName, true); + GetArray(device_name, parent, member, "driverInfo", dest->driverInfo, true); + GET_VALUE_ENUM_WARN(member, denormBehaviorIndependence, true, requested_profile, WarnIfNotEqualEnum); + GET_VALUE_ENUM_WARN(member, roundingModeIndependence, true, requested_profile, WarnIfNotEqualEnum); + GET_VALUE_WARN(member, shaderSignedZeroInfNanPreserveFloat16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSignedZeroInfNanPreserveFloat32, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSignedZeroInfNanPreserveFloat64, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDenormPreserveFloat16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDenormPreserveFloat32, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDenormPreserveFloat64, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDenormFlushToZeroFloat16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDenormFlushToZeroFloat32, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDenormFlushToZeroFloat64, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderRoundingModeRTEFloat16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderRoundingModeRTEFloat32, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderRoundingModeRTEFloat64, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderRoundingModeRTZFloat16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderRoundingModeRTZFloat32, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderRoundingModeRTZFloat64, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, maxUpdateAfterBindDescriptorsInAllPools, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, shaderUniformBufferArrayNonUniformIndexingNative, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSampledImageArrayNonUniformIndexingNative, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageBufferArrayNonUniformIndexingNative, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageImageArrayNonUniformIndexingNative, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderInputAttachmentArrayNonUniformIndexingNative, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, robustBufferAccessUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, quadDivergentImplicitLod, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindSamplers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindUniformBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindStorageBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindSampledImages, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindStorageImages, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindInputAttachments, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageUpdateAfterBindResources, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindSamplers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindUniformBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindUniformBuffersDynamic, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindStorageBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindStorageBuffersDynamic, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindSampledImages, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindStorageImages, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindInputAttachments, false, requested_profile, WarnIfGreater); + GET_VALUE_FLAG_WARN(member, supportedDepthResolveModes, false, requested_profile); + GET_VALUE_FLAG_WARN(member, supportedStencilResolveModes, false, requested_profile); + GET_VALUE_WARN(member, independentResolveNone, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, independentResolve, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, filterMinmaxSingleComponentFormats, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, filterMinmaxImageComponentMapping, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, maxTimelineSemaphoreValueDifference, false, requested_profile, WarnIfGreater); + GET_VALUE_FLAG_WARN(member, framebufferIntegerColorSampleCounts, false, requested_profile); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkan13Properties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkan13Properties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVulkan13Properties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, minSubgroupSize, false, WarnIfLesser); - GET_VALUE_WARN(member, maxSubgroupSize, false, WarnIfGreater); - GET_VALUE_WARN(member, maxComputeWorkgroupSubgroups, false, WarnIfGreater); - GET_VALUE_FLAG_WARN(member, requiredSubgroupSizeStages, false); - GET_VALUE_WARN(member, maxInlineUniformBlockSize, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorInlineUniformBlocks, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetInlineUniformBlocks, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindInlineUniformBlocks, false, WarnIfGreater); - GET_VALUE_WARN(member, maxInlineUniformTotalSize, false, WarnIfGreater); - GET_VALUE_WARN(member, integerDotProduct8BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct8BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct8BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct4x8BitPackedUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct4x8BitPackedSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct4x8BitPackedMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct16BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct16BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct16BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct32BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct32BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct32BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct64BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct64BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct64BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating8BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating8BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating16BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating16BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating32BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating32BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating64BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating64BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, storageTexelBufferOffsetAlignmentBytes, false, WarnIfLesser); - GET_VALUE_WARN(member, storageTexelBufferOffsetSingleTexelAlignment, true, WarnIfNotEqualBool); - GET_VALUE_WARN(member, uniformTexelBufferOffsetAlignmentBytes, false, WarnIfLesser); - GET_VALUE_WARN(member, uniformTexelBufferOffsetSingleTexelAlignment, true, WarnIfNotEqualBool); - GET_VALUE_WARN(member, maxBufferSize, false, WarnIfGreater); + GET_VALUE_WARN(member, minSubgroupSize, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, maxSubgroupSize, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxComputeWorkgroupSubgroups, false, requested_profile, WarnIfGreater); + GET_VALUE_FLAG_WARN(member, requiredSubgroupSizeStages, false, requested_profile); + GET_VALUE_WARN(member, maxInlineUniformBlockSize, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorInlineUniformBlocks, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetInlineUniformBlocks, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUpdateAfterBindInlineUniformBlocks, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxInlineUniformTotalSize, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, integerDotProduct8BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct8BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct8BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct4x8BitPackedUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct4x8BitPackedSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct4x8BitPackedMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct16BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct16BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct16BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct32BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct32BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct32BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct64BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct64BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct64BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating8BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating8BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating16BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating16BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating32BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating32BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating64BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating64BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, storageTexelBufferOffsetAlignmentBytes, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, storageTexelBufferOffsetSingleTexelAlignment, true, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, uniformTexelBufferOffsetAlignmentBytes, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, uniformTexelBufferOffsetSingleTexelAlignment, true, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, maxBufferSize, false, requested_profile, WarnIfGreater); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkanSC10Properties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkanSC10Properties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVulkanSC10Properties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, deviceNoDynamicHostAllocations, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, deviceDestroyFreesMemory, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, commandPoolMultipleCommandBuffersRecording, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, commandPoolResetCommandBuffer, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, commandBufferSimultaneousUse, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, secondaryCommandBufferNullOrImagelessFramebuffer, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, recycleDescriptorSetMemory, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, recyclePipelineMemory, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, maxRenderPassSubpasses, false, WarnIfGreater); - GET_VALUE_WARN(member, maxRenderPassDependencies, false, WarnIfGreater); - GET_VALUE_WARN(member, maxSubpassInputAttachments, false, WarnIfGreater); - GET_VALUE_WARN(member, maxSubpassPreserveAttachments, false, WarnIfGreater); - GET_VALUE_WARN(member, maxFramebufferAttachments, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetLayoutBindings, false, WarnIfGreater); - GET_VALUE_WARN(member, maxQueryFaultCount, false, WarnIfGreater); - GET_VALUE_WARN(member, maxCallbackFaultCount, false, WarnIfGreater); - GET_VALUE_WARN(member, maxCommandPoolCommandBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxCommandBufferSize, false, WarnIfGreater); + GET_VALUE_WARN(member, deviceNoDynamicHostAllocations, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, deviceDestroyFreesMemory, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, commandPoolMultipleCommandBuffersRecording, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, commandPoolResetCommandBuffer, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, commandBufferSimultaneousUse, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, secondaryCommandBufferNullOrImagelessFramebuffer, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, recycleDescriptorSetMemory, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, recyclePipelineMemory, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, maxRenderPassSubpasses, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxRenderPassDependencies, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxSubpassInputAttachments, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxSubpassPreserveAttachments, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxFramebufferAttachments, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetLayoutBindings, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxQueryFaultCount, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxCallbackFaultCount, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxCommandPoolCommandBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxCommandBufferSize, false, requested_profile, WarnIfGreater); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderIntegerDotProductProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderIntegerDotProductProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceShaderIntegerDotProductProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, integerDotProduct8BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct8BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct8BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct4x8BitPackedUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct4x8BitPackedSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct4x8BitPackedMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct16BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct16BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct16BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct32BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct32BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct32BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct64BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct64BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProduct64BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating8BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating8BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating16BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating16BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating32BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating32BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating64BitUnsignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating64BitSignedAccelerated, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct8BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct8BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct8BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct4x8BitPackedUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct4x8BitPackedSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct4x8BitPackedMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct16BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct16BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct16BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct32BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct32BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct32BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct64BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct64BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProduct64BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating8BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating8BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating16BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating16BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating32BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating32BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating64BitUnsignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating64BitSignedAccelerated, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePrivateDataFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePrivateDataFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDevicePrivateDataFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, privateData, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, privateData, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVariablePointerFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVariablePointerFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVariablePointerFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, variablePointersStorageBuffer, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, variablePointers, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, variablePointersStorageBuffer, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, variablePointers, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceMultiviewFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceMultiviewFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceMultiviewFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, multiview, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, multiviewGeometryShader, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, multiviewTessellationShader, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, multiview, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, multiviewGeometryShader, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, multiviewTessellationShader, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevice16BitStorageFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevice16BitStorageFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDevice16BitStorageFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, storageBuffer16BitAccess, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, uniformAndStorageBuffer16BitAccess, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, storagePushConstant16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, storageInputOutput16, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, storageBuffer16BitAccess, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, uniformAndStorageBuffer16BitAccess, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, storagePushConstant16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, storageInputOutput16, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderSubgroupExtendedTypes, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSubgroupExtendedTypes, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSamplerYcbcrConversionFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSamplerYcbcrConversionFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceSamplerYcbcrConversionFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, samplerYcbcrConversion, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, samplerYcbcrConversion, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceProtectedMemoryFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceProtectedMemoryFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceProtectedMemoryFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, protectedMemory, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, protectedMemory, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceInlineUniformBlockFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceInlineUniformBlockFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceInlineUniformBlockFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, inlineUniformBlock, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingInlineUniformBlockUpdateAfterBind, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, inlineUniformBlock, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingInlineUniformBlockUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceMaintenance4Features *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceMaintenance4Features *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceMaintenance4Features)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, maintenance4, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, maintenance4, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderDrawParameterFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderDrawParameterFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceShaderDrawParameterFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderDrawParameters, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDrawParameters, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderFloat16Int8Features *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderFloat16Int8Features *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceShaderFloat16Int8Features)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderFloat16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderInt8, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderFloat16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderInt8, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceHostQueryResetFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceHostQueryResetFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceHostQueryResetFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, hostQueryReset, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, hostQueryReset, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDescriptorIndexingFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDescriptorIndexingFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceDescriptorIndexingFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderInputAttachmentArrayDynamicIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderUniformTexelBufferArrayDynamicIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageTexelBufferArrayDynamicIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderUniformBufferArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSampledImageArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageBufferArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageImageArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderInputAttachmentArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderUniformTexelBufferArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageTexelBufferArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingUniformBufferUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingSampledImageUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingStorageImageUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingStorageBufferUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingUniformTexelBufferUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingStorageTexelBufferUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingUpdateUnusedWhilePending, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingPartiallyBound, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingVariableDescriptorCount, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, runtimeDescriptorArray, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderInputAttachmentArrayDynamicIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderUniformTexelBufferArrayDynamicIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageTexelBufferArrayDynamicIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderUniformBufferArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSampledImageArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageBufferArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageImageArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderInputAttachmentArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderUniformTexelBufferArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageTexelBufferArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingUniformBufferUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingSampledImageUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingStorageImageUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingStorageBufferUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingUniformTexelBufferUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingStorageTexelBufferUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingUpdateUnusedWhilePending, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingPartiallyBound, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingVariableDescriptorCount, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, runtimeDescriptorArray, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceTimelineSemaphoreFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceTimelineSemaphoreFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceTimelineSemaphoreFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, timelineSemaphore, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, timelineSemaphore, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevice8BitStorageFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevice8BitStorageFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDevice8BitStorageFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, storageBuffer8BitAccess, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, uniformAndStorageBuffer8BitAccess, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, storagePushConstant8, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, storageBuffer8BitAccess, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, uniformAndStorageBuffer8BitAccess, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, storagePushConstant8, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkanMemoryModelFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkanMemoryModelFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVulkanMemoryModelFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, vulkanMemoryModel, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, vulkanMemoryModelDeviceScope, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, vulkanMemoryModelAvailabilityVisibilityChains, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, vulkanMemoryModel, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, vulkanMemoryModelDeviceScope, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, vulkanMemoryModelAvailabilityVisibilityChains, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderAtomicInt64Features *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderAtomicInt64Features *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceShaderAtomicInt64Features)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderBufferInt64Atomics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSharedInt64Atomics, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderBufferInt64Atomics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSharedInt64Atomics, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceScalarBlockLayoutFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceScalarBlockLayoutFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceScalarBlockLayoutFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, scalarBlockLayout, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, scalarBlockLayout, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceUniformBufferStandardLayoutFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceUniformBufferStandardLayoutFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceUniformBufferStandardLayoutFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, uniformBufferStandardLayout, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, uniformBufferStandardLayout, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceBufferDeviceAddressFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceBufferDeviceAddressFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceBufferDeviceAddressFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, bufferDeviceAddress, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, bufferDeviceAddressCaptureReplay, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, bufferDeviceAddressMultiDevice, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, bufferDeviceAddress, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, bufferDeviceAddressCaptureReplay, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, bufferDeviceAddressMultiDevice, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceImagelessFramebufferFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceImagelessFramebufferFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceImagelessFramebufferFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, imagelessFramebuffer, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, imagelessFramebuffer, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, separateDepthStencilLayouts, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, separateDepthStencilLayouts, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePipelineCreationCacheControlFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePipelineCreationCacheControlFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDevicePipelineCreationCacheControlFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, pipelineCreationCacheControl, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, pipelineCreationCacheControl, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkan11Features *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkan11Features *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVulkan11Features)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, storageBuffer16BitAccess, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, uniformAndStorageBuffer16BitAccess, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, storagePushConstant16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, storageInputOutput16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, multiview, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, multiviewGeometryShader, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, multiviewTessellationShader, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, variablePointersStorageBuffer, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, variablePointers, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, protectedMemory, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, samplerYcbcrConversion, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDrawParameters, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, storageBuffer16BitAccess, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, uniformAndStorageBuffer16BitAccess, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, storagePushConstant16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, storageInputOutput16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, multiview, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, multiviewGeometryShader, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, multiviewTessellationShader, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, variablePointersStorageBuffer, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, variablePointers, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, protectedMemory, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, samplerYcbcrConversion, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDrawParameters, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkan12Features *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkan12Features *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVulkan12Features)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, samplerMirrorClampToEdge, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, drawIndirectCount, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, storageBuffer8BitAccess, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, uniformAndStorageBuffer8BitAccess, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, storagePushConstant8, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderBufferInt64Atomics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSharedInt64Atomics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderFloat16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderInt8, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderInputAttachmentArrayDynamicIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderUniformTexelBufferArrayDynamicIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageTexelBufferArrayDynamicIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderUniformBufferArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSampledImageArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageBufferArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageImageArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderInputAttachmentArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderUniformTexelBufferArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageTexelBufferArrayNonUniformIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingUniformBufferUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingSampledImageUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingStorageImageUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingStorageBufferUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingUniformTexelBufferUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingStorageTexelBufferUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingUpdateUnusedWhilePending, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingPartiallyBound, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingVariableDescriptorCount, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, runtimeDescriptorArray, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, samplerFilterMinmax, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, scalarBlockLayout, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, imagelessFramebuffer, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, uniformBufferStandardLayout, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSubgroupExtendedTypes, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, separateDepthStencilLayouts, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, hostQueryReset, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, timelineSemaphore, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, bufferDeviceAddress, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, bufferDeviceAddressCaptureReplay, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, bufferDeviceAddressMultiDevice, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, vulkanMemoryModel, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, vulkanMemoryModelDeviceScope, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, vulkanMemoryModelAvailabilityVisibilityChains, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderOutputViewportIndex, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderOutputLayer, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, subgroupBroadcastDynamicId, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, samplerMirrorClampToEdge, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, drawIndirectCount, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, storageBuffer8BitAccess, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, uniformAndStorageBuffer8BitAccess, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, storagePushConstant8, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderBufferInt64Atomics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSharedInt64Atomics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderFloat16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderInt8, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderInputAttachmentArrayDynamicIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderUniformTexelBufferArrayDynamicIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageTexelBufferArrayDynamicIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderUniformBufferArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSampledImageArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageBufferArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageImageArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderInputAttachmentArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderUniformTexelBufferArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageTexelBufferArrayNonUniformIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingUniformBufferUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingSampledImageUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingStorageImageUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingStorageBufferUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingUniformTexelBufferUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingStorageTexelBufferUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingUpdateUnusedWhilePending, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingPartiallyBound, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingVariableDescriptorCount, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, runtimeDescriptorArray, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, samplerFilterMinmax, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, scalarBlockLayout, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, imagelessFramebuffer, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, uniformBufferStandardLayout, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSubgroupExtendedTypes, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, separateDepthStencilLayouts, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, hostQueryReset, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, timelineSemaphore, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, bufferDeviceAddress, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, bufferDeviceAddressCaptureReplay, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, bufferDeviceAddressMultiDevice, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, vulkanMemoryModel, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, vulkanMemoryModelDeviceScope, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, vulkanMemoryModelAvailabilityVisibilityChains, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderOutputViewportIndex, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderOutputLayer, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, subgroupBroadcastDynamicId, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkan13Features *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkan13Features *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVulkan13Features)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, robustImageAccess, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, inlineUniformBlock, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, descriptorBindingInlineUniformBlockUpdateAfterBind, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, pipelineCreationCacheControl, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, privateData, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDemoteToHelperInvocation, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderTerminateInvocation, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, subgroupSizeControl, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, computeFullSubgroups, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, synchronization2, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, textureCompressionASTC_HDR, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderZeroInitializeWorkgroupMemory, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, dynamicRendering, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderIntegerDotProduct, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, maintenance4, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, robustImageAccess, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, inlineUniformBlock, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, descriptorBindingInlineUniformBlockUpdateAfterBind, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, pipelineCreationCacheControl, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, privateData, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDemoteToHelperInvocation, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderTerminateInvocation, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, subgroupSizeControl, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, computeFullSubgroups, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, synchronization2, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, textureCompressionASTC_HDR, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderZeroInitializeWorkgroupMemory, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, dynamicRendering, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderIntegerDotProduct, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, maintenance4, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderZeroInitializeWorkgroupMemory, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderZeroInitializeWorkgroupMemory, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVulkanSC10Features *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVulkanSC10Features *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVulkanSC10Features)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderAtomicInstructions, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderAtomicInstructions, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderIntegerDotProductFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderIntegerDotProductFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceShaderIntegerDotProductFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderIntegerDotProduct, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderIntegerDotProduct, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDynamicRenderingFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDynamicRenderingFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceDynamicRenderingFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, dynamicRendering, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, dynamicRendering, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, textureCompressionASTC_HDR, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, textureCompressionASTC_HDR, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceASTCDecodeFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceASTCDecodeFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceASTCDecodeFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, decodeModeSharedExponent, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, decodeModeSharedExponent, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDiscardRectanglePropertiesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDiscardRectanglePropertiesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceDiscardRectanglePropertiesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, maxDiscardRectangles, false, WarnIfGreater); + GET_VALUE_WARN(member, maxDiscardRectangles, false, requested_profile, WarnIfGreater); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceConservativeRasterizationPropertiesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceConservativeRasterizationPropertiesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceConservativeRasterizationPropertiesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, primitiveOverestimationSize, true, WarnIfNotEqualFloat); - GET_VALUE_WARN(member, maxExtraPrimitiveOverestimationSize, false, WarnIfGreaterFloat); - GET_VALUE_WARN(member, extraPrimitiveOverestimationSizeGranularity, false, WarnIfLesserFloat); - GET_VALUE_WARN(member, primitiveUnderestimation, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, conservativePointAndLineRasterization, true, WarnIfNotEqualBool); - GET_VALUE_WARN(member, degenerateTrianglesRasterized, true, WarnIfNotEqualBool); - GET_VALUE_WARN(member, degenerateLinesRasterized, true, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fullyCoveredFragmentShaderInputVariable, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, conservativeRasterizationPostDepthCoverage, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, primitiveOverestimationSize, true, requested_profile, WarnIfNotEqualFloat); + GET_VALUE_WARN(member, maxExtraPrimitiveOverestimationSize, false, requested_profile, WarnIfGreaterFloat); + GET_VALUE_WARN(member, extraPrimitiveOverestimationSizeGranularity, false, requested_profile, WarnIfLesserFloat); + GET_VALUE_WARN(member, primitiveUnderestimation, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, conservativePointAndLineRasterization, true, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, degenerateTrianglesRasterized, true, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, degenerateLinesRasterized, true, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fullyCoveredFragmentShaderInputVariable, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, conservativeRasterizationPostDepthCoverage, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceDepthClipEnableFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceDepthClipEnableFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceDepthClipEnableFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, depthClipEnable, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, depthClipEnable, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePerformanceQueryPropertiesKHR *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePerformanceQueryPropertiesKHR *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDevicePerformanceQueryPropertiesKHR)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, allowCommandBufferQueryCopies, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, allowCommandBufferQueryCopies, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePerformanceQueryFeaturesKHR *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePerformanceQueryFeaturesKHR *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDevicePerformanceQueryFeaturesKHR)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, performanceCounterQueryPools, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, performanceCounterMultipleQueryPools, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, performanceCounterQueryPools, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, performanceCounterMultipleQueryPools, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSampleLocationsPropertiesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSampleLocationsPropertiesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceSampleLocationsPropertiesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_FLAG_WARN(member, sampleLocationSampleCounts, false); - GET_VALUE_WARN(member, maxSampleLocationGridSize, false, WarnIfGreater); - GetArray(parent, member, "sampleLocationCoordinateRange", dest->sampleLocationCoordinateRange, false); - GET_VALUE_WARN(member, sampleLocationSubPixelBits, false, WarnIfGreater); - GET_VALUE_WARN(member, variableSampleLocations, false, WarnIfNotEqualBool); + GET_VALUE_FLAG_WARN(member, sampleLocationSampleCounts, false, requested_profile); + GET_VALUE_WARN(member, maxSampleLocationGridSize, false, requested_profile, WarnIfGreater); + GetArray(device_name, parent, member, "sampleLocationCoordinateRange", dest->sampleLocationCoordinateRange, false); + GET_VALUE_WARN(member, sampleLocationSubPixelBits, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, variableSampleLocations, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, advancedBlendMaxColorAttachments, false, WarnIfGreater); - GET_VALUE_WARN(member, advancedBlendIndependentBlend, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, advancedBlendNonPremultipliedSrcColor, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, advancedBlendNonPremultipliedDstColor, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, advancedBlendCorrelatedOverlap, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, advancedBlendAllOperations, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, advancedBlendMaxColorAttachments, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, advancedBlendIndependentBlend, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, advancedBlendNonPremultipliedSrcColor, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, advancedBlendNonPremultipliedDstColor, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, advancedBlendCorrelatedOverlap, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, advancedBlendAllOperations, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, advancedBlendCoherentOperations, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, advancedBlendCoherentOperations, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExternalMemoryHostPropertiesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExternalMemoryHostPropertiesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceExternalMemoryHostPropertiesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, minImportedHostPointerAlignment, false, WarnIfLesser); + GET_VALUE_WARN(member, minImportedHostPointerAlignment, false, requested_profile, WarnIfLesser); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderClockFeaturesKHR *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderClockFeaturesKHR *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceShaderClockFeaturesKHR)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderSubgroupClock, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderDeviceClock, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSubgroupClock, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDeviceClock, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *dest) { (void)dest; - LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT)\n"); + (void)requested_profile; + LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, maxVertexAttribDivisor, false, WarnIfGreater); + GET_VALUE_WARN(member, globalPriorityQuery, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *dest) { - (void)dest; - LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT)\n"); - bool valid = true; - for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, vertexAttributeInstanceRateDivisor, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, vertexAttributeInstanceRateZeroDivisor, false, WarnIfNotEqualBool); - } - return valid; -} - -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePCIBusInfoPropertiesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePCIBusInfoPropertiesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDevicePCIBusInfoPropertiesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, pciDomain, true, WarnIfNotEqual32u); - GET_VALUE_WARN(member, pciBus, true, WarnIfNotEqual32u); - GET_VALUE_WARN(member, pciDevice, true, WarnIfNotEqual32u); - GET_VALUE_WARN(member, pciFunction, true, WarnIfNotEqual32u); + GET_VALUE_WARN(member, pciDomain, true, requested_profile, WarnIfNotEqual32u); + GET_VALUE_WARN(member, pciBus, true, requested_profile, WarnIfNotEqual32u); + GET_VALUE_WARN(member, pciDevice, true, requested_profile, WarnIfNotEqual32u); + GET_VALUE_WARN(member, pciFunction, true, requested_profile, WarnIfNotEqual32u); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderTerminateInvocation, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderTerminateInvocation, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSubgroupSizeControlPropertiesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSubgroupSizeControlPropertiesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceSubgroupSizeControlPropertiesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, minSubgroupSize, false, WarnIfLesser); - GET_VALUE_WARN(member, maxSubgroupSize, false, WarnIfGreater); - GET_VALUE_WARN(member, maxComputeWorkgroupSubgroups, false, WarnIfGreater); - GET_VALUE_FLAG_WARN(member, requiredSubgroupSizeStages, false); + GET_VALUE_WARN(member, minSubgroupSize, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, maxSubgroupSize, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxComputeWorkgroupSubgroups, false, requested_profile, WarnIfGreater); + GET_VALUE_FLAG_WARN(member, requiredSubgroupSizeStages, false, requested_profile); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSubgroupSizeControlFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSubgroupSizeControlFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceSubgroupSizeControlFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, subgroupSizeControl, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, computeFullSubgroups, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, subgroupSizeControl, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, computeFullSubgroups, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceFragmentShadingRatePropertiesKHR *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceFragmentShadingRatePropertiesKHR *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceFragmentShadingRatePropertiesKHR)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, minFragmentShadingRateAttachmentTexelSize, false, WarnIfLesser); - GET_VALUE_WARN(member, maxFragmentShadingRateAttachmentTexelSize, false, WarnIfGreater); - GET_VALUE_WARN(member, maxFragmentShadingRateAttachmentTexelSizeAspectRatio, false, WarnIfGreater); - GET_VALUE_WARN(member, primitiveFragmentShadingRateWithMultipleViewports, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, layeredShadingRateAttachments, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fragmentShadingRateNonTrivialCombinerOps, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, maxFragmentSize, false, WarnIfGreater); - GET_VALUE_WARN(member, maxFragmentSizeAspectRatio, false, WarnIfGreater); - GET_VALUE_WARN(member, maxFragmentShadingRateCoverageSamples, false, WarnIfGreater); - GET_VALUE_ENUM_WARN(member, maxFragmentShadingRateRasterizationSamples, false, WarnIfNotEqualEnum); - GET_VALUE_WARN(member, fragmentShadingRateWithShaderDepthStencilWrites, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fragmentShadingRateWithSampleMask, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fragmentShadingRateWithShaderSampleMask, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fragmentShadingRateWithConservativeRasterization, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fragmentShadingRateWithFragmentShaderInterlock, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fragmentShadingRateWithCustomSampleLocations, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fragmentShadingRateStrictMultiplyCombiner, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, minFragmentShadingRateAttachmentTexelSize, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, maxFragmentShadingRateAttachmentTexelSize, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxFragmentShadingRateAttachmentTexelSizeAspectRatio, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, primitiveFragmentShadingRateWithMultipleViewports, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, layeredShadingRateAttachments, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fragmentShadingRateNonTrivialCombinerOps, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, maxFragmentSize, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxFragmentSizeAspectRatio, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxFragmentShadingRateCoverageSamples, false, requested_profile, WarnIfGreater); + GET_VALUE_ENUM_WARN(member, maxFragmentShadingRateRasterizationSamples, false, requested_profile, WarnIfNotEqualEnum); + GET_VALUE_WARN(member, fragmentShadingRateWithShaderDepthStencilWrites, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fragmentShadingRateWithSampleMask, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fragmentShadingRateWithShaderSampleMask, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fragmentShadingRateWithConservativeRasterization, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fragmentShadingRateWithFragmentShaderInterlock, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fragmentShadingRateWithCustomSampleLocations, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fragmentShadingRateStrictMultiplyCombiner, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceFragmentShadingRateFeaturesKHR *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceFragmentShadingRateFeaturesKHR *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceFragmentShadingRateFeaturesKHR)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, pipelineFragmentShadingRate, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, primitiveFragmentShadingRate, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, attachmentFragmentShadingRate, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, pipelineFragmentShadingRate, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, primitiveFragmentShadingRate, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, attachmentFragmentShadingRate, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderImageInt64Atomics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sparseImageInt64Atomics, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderImageInt64Atomics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sparseImageInt64Atomics, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, fragmentShaderSampleInterlock, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fragmentShaderPixelInterlock, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fragmentShaderShadingRateInterlock, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fragmentShaderSampleInterlock, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fragmentShaderPixelInterlock, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fragmentShaderShadingRateInterlock, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceYcbcrImageArraysFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceYcbcrImageArraysFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, ycbcrImageArrays, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, ycbcrImageArrays, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceLineRasterizationPropertiesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceLineRasterizationPropertiesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceLineRasterizationPropertiesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, lineSubPixelPrecisionBits, false, WarnIfGreater); + GET_VALUE_WARN(member, lineSubPixelPrecisionBits, false, requested_profile, WarnIfGreater); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceLineRasterizationFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceLineRasterizationFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceLineRasterizationFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, rectangularLines, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, bresenhamLines, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, smoothLines, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, stippledRectangularLines, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, stippledBresenhamLines, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, stippledSmoothLines, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, rectangularLines, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, bresenhamLines, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, smoothLines, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, stippledRectangularLines, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, stippledBresenhamLines, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, stippledSmoothLines, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderAtomicFloatFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceShaderAtomicFloatFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderBufferFloat32Atomics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderBufferFloat32AtomicAdd, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderBufferFloat64Atomics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderBufferFloat64AtomicAdd, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSharedFloat32Atomics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSharedFloat32AtomicAdd, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSharedFloat64Atomics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSharedFloat64AtomicAdd, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderImageFloat32Atomics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderImageFloat32AtomicAdd, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sparseImageFloat32Atomics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sparseImageFloat32AtomicAdd, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderBufferFloat32Atomics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderBufferFloat32AtomicAdd, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderBufferFloat64Atomics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderBufferFloat64AtomicAdd, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSharedFloat32Atomics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSharedFloat32AtomicAdd, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSharedFloat64Atomics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSharedFloat64AtomicAdd, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderImageFloat32Atomics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderImageFloat32AtomicAdd, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sparseImageFloat32Atomics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sparseImageFloat32AtomicAdd, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceIndexTypeUint8FeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceIndexTypeUint8FeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceIndexTypeUint8FeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, indexTypeUint8, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, indexTypeUint8, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceExtendedDynamicStateFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, extendedDynamicState, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, extendedDynamicState, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, shaderDemoteToHelperInvocation, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderDemoteToHelperInvocation, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, storageTexelBufferOffsetAlignmentBytes, false, WarnIfLesser); - GET_VALUE_WARN(member, storageTexelBufferOffsetSingleTexelAlignment, true, WarnIfNotEqualBool); - GET_VALUE_WARN(member, uniformTexelBufferOffsetAlignmentBytes, false, WarnIfLesser); - GET_VALUE_WARN(member, uniformTexelBufferOffsetSingleTexelAlignment, true, WarnIfNotEqualBool); + GET_VALUE_WARN(member, storageTexelBufferOffsetAlignmentBytes, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, storageTexelBufferOffsetSingleTexelAlignment, true, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, uniformTexelBufferOffsetAlignmentBytes, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, uniformTexelBufferOffsetSingleTexelAlignment, true, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, texelBufferAlignment, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, texelBufferAlignment, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceRobustness2PropertiesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceRobustness2PropertiesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceRobustness2PropertiesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, robustStorageBufferAccessSizeAlignment, false, WarnIfLesser); - GET_VALUE_WARN(member, robustUniformBufferAccessSizeAlignment, false, WarnIfLesser); + GET_VALUE_WARN(member, robustStorageBufferAccessSizeAlignment, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, robustUniformBufferAccessSizeAlignment, false, requested_profile, WarnIfLesser); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceRobustness2FeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceRobustness2FeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceRobustness2FeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, robustBufferAccess2, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, robustImageAccess2, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, nullDescriptor, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, robustBufferAccess2, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, robustImageAccess2, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, nullDescriptor, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceCustomBorderColorPropertiesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceCustomBorderColorPropertiesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceCustomBorderColorPropertiesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, maxCustomBorderColorSamplers, false, WarnIfGreater); + GET_VALUE_WARN(member, maxCustomBorderColorSamplers, false, requested_profile, WarnIfGreater); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceCustomBorderColorFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceCustomBorderColorFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceCustomBorderColorFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, customBorderColors, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, customBorderColorWithoutFormat, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, customBorderColors, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, customBorderColorWithoutFormat, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSynchronization2FeaturesKHR *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSynchronization2FeaturesKHR *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceSynchronization2FeaturesKHR)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, synchronization2, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, synchronization2, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, ycbcr2plane444Formats, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, ycbcr2plane444Formats, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceImageRobustnessFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceImageRobustnessFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceImageRobustnessFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, robustImageAccess, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, robustImageAccess, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevice4444FormatsFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevice4444FormatsFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDevice4444FormatsFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, formatA4R4G4B4, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, formatA4B4G4R4, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, formatA4R4G4B4, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, formatA4B4G4R4, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, vertexInputDynamicState, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, vertexInputDynamicState, false, requested_profile, WarnIfNotEqualBool); } return valid; } #ifdef VK_USE_PLATFORM_SCI -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExternalSciSyncFeaturesNV *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExternalSciSyncFeaturesNV *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceExternalSciSyncFeaturesNV)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, sciSyncFence, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sciSyncSemaphore, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sciSyncImport, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sciSyncExport, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sciSyncFence, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sciSyncSemaphore, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sciSyncImport, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sciSyncExport, false, requested_profile, WarnIfNotEqualBool); } return valid; } #endif // VK_USE_PLATFORM_SCI #ifdef VK_USE_PLATFORM_SCI -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExternalMemorySciBufFeaturesNV *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExternalMemorySciBufFeaturesNV *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceExternalMemorySciBufFeaturesNV)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, sciBufImport, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sciBufExport, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sciBufImport, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sciBufExport, false, requested_profile, WarnIfNotEqualBool); } return valid; } #endif // VK_USE_PLATFORM_SCI -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExtendedDynamicState2FeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceExtendedDynamicState2FeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, extendedDynamicState2, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, extendedDynamicState2LogicOp, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, extendedDynamicState2PatchControlPoints, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, extendedDynamicState2, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, extendedDynamicState2LogicOp, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, extendedDynamicState2PatchControlPoints, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceColorWriteEnableFeaturesEXT *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceColorWriteEnableFeaturesEXT *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceColorWriteEnableFeaturesEXT)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, colorWriteEnable, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, colorWriteEnable, false, requested_profile, WarnIfNotEqualBool); } return valid; } #ifdef VK_USE_PLATFORM_SCI -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExternalSciSync2FeaturesNV *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExternalSciSync2FeaturesNV *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceExternalSciSync2FeaturesNV)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, sciSyncFence, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sciSyncSemaphore2, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sciSyncImport, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sciSyncExport, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sciSyncFence, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sciSyncSemaphore2, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sciSyncImport, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sciSyncExport, false, requested_profile, WarnIfNotEqualBool); } return valid; } #endif // VK_USE_PLATFORM_SCI +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR *dest) { + (void)dest; + (void)requested_profile; + LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR)\n"); + bool valid = true; + for (const auto &member : parent.getMemberNames()) { + GET_VALUE_WARN(member, maxVertexAttribDivisor, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, supportsNonZeroFirstInstance, false, requested_profile, WarnIfNotEqualBool); + } + return valid; +} + +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR *dest) { + (void)dest; + (void)requested_profile; + LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR)\n"); + bool valid = true; + for (const auto &member : parent.getMemberNames()) { + GET_VALUE_WARN(member, vertexAttributeInstanceRateDivisor, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, vertexAttributeInstanceRateZeroDivisor, false, requested_profile, WarnIfNotEqualBool); + } + return valid; +} + #ifdef VK_USE_PLATFORM_SCREEN_QNX -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, screenBufferImport, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, screenBufferImport, false, requested_profile, WarnIfNotEqualBool); } return valid; } #endif // VK_USE_PLATFORM_SCREEN_QNX -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceFeatures *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceFeatures *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceFeatures)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, robustBufferAccess, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fullDrawIndexUint32, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, imageCubeArray, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, independentBlend, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, geometryShader, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, tessellationShader, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sampleRateShading, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, dualSrcBlend, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, logicOp, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, multiDrawIndirect, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, drawIndirectFirstInstance, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, depthClamp, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, depthBiasClamp, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fillModeNonSolid, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, depthBounds, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, wideLines, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, largePoints, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, alphaToOne, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, multiViewport, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, samplerAnisotropy, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, textureCompressionETC2, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, textureCompressionASTC_LDR, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, textureCompressionBC, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, occlusionQueryPrecise, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, pipelineStatisticsQuery, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, vertexPipelineStoresAndAtomics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, fragmentStoresAndAtomics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderTessellationAndGeometryPointSize, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderImageGatherExtended, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageImageExtendedFormats, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageImageMultisample, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageImageReadWithoutFormat, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageImageWriteWithoutFormat, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderUniformBufferArrayDynamicIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSampledImageArrayDynamicIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageBufferArrayDynamicIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderStorageImageArrayDynamicIndexing, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderClipDistance, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderCullDistance, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderFloat64, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderInt64, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderInt16, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderResourceResidency, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderResourceMinLod, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sparseBinding, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sparseResidencyBuffer, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sparseResidencyImage2D, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sparseResidencyImage3D, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sparseResidency2Samples, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sparseResidency4Samples, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sparseResidency8Samples, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sparseResidency16Samples, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, sparseResidencyAliased, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, variableMultisampleRate, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, inheritedQueries, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, robustBufferAccess, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fullDrawIndexUint32, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, imageCubeArray, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, independentBlend, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, geometryShader, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, tessellationShader, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sampleRateShading, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, dualSrcBlend, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, logicOp, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, multiDrawIndirect, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, drawIndirectFirstInstance, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, depthClamp, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, depthBiasClamp, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fillModeNonSolid, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, depthBounds, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, wideLines, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, largePoints, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, alphaToOne, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, multiViewport, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, samplerAnisotropy, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, textureCompressionETC2, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, textureCompressionASTC_LDR, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, textureCompressionBC, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, occlusionQueryPrecise, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, pipelineStatisticsQuery, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, vertexPipelineStoresAndAtomics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, fragmentStoresAndAtomics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderTessellationAndGeometryPointSize, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderImageGatherExtended, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageImageExtendedFormats, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageImageMultisample, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageImageReadWithoutFormat, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageImageWriteWithoutFormat, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderUniformBufferArrayDynamicIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSampledImageArrayDynamicIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageBufferArrayDynamicIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderStorageImageArrayDynamicIndexing, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderClipDistance, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderCullDistance, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderFloat64, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderInt64, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderInt16, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderResourceResidency, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderResourceMinLod, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sparseBinding, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sparseResidencyBuffer, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sparseResidencyImage2D, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sparseResidencyImage3D, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sparseResidency2Samples, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sparseResidency4Samples, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sparseResidency8Samples, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sparseResidency16Samples, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, sparseResidencyAliased, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, variableMultisampleRate, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, inheritedQueries, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePortabilitySubsetFeaturesKHR *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePortabilitySubsetFeaturesKHR *dest) { LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDevicePortabilitySubsetFeaturesKHR)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { @@ -5730,194 +5934,197 @@ bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, V dest->triangleFans = layer_settings.portability.triangleFans; dest->vertexAttributeAccessBeyondStride = layer_settings.portability.vertexAttributeAccessBeyondStride; } else { - GET_VALUE_WARN(member, constantAlphaColorBlendFactors, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, events, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, imageViewFormatReinterpretation, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, imageViewFormatSwizzle, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, imageView2DOn3DImage, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, multisampleArrayImage, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, mutableComparisonSamplers, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, pointPolygons, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, samplerMipLodBias, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, separateStencilMaskRef, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, shaderSampleRateInterpolationFunctions, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, tessellationIsolines, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, tessellationPointMode, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, triangleFans, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, vertexAttributeAccessBeyondStride, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, constantAlphaColorBlendFactors, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, events, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, imageViewFormatReinterpretation, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, imageViewFormatSwizzle, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, imageView2DOn3DImage, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, multisampleArrayImage, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, mutableComparisonSamplers, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, pointPolygons, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, samplerMipLodBias, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, separateStencilMaskRef, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, shaderSampleRateInterpolationFunctions, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, tessellationIsolines, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, tessellationPointMode, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, triangleFans, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, vertexAttributeAccessBeyondStride, false, requested_profile, WarnIfNotEqualBool); } } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceProperties *dest) { LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceProperties)\n"); bool valid = true; - if (!GetStruct(device_name, parent["limits"], &dest->limits)) { + if (!GetStruct(device_name, requested_profile, parent["limits"], &dest->limits)) { valid = false; } - if (!GetStruct(device_name, parent["sparseProperties"], &dest->sparseProperties)) { + if (!GetStruct(device_name, requested_profile, parent["sparseProperties"], &dest->sparseProperties)) { valid = false; } for (const auto &prop : parent.getMemberNames()) { - GET_VALUE(prop, apiVersion, false); - GET_VALUE(prop, driverVersion, true); - GET_VALUE(prop, vendorID, true); - GET_VALUE(prop, deviceID, true); - GET_VALUE_ENUM_WARN(prop, deviceType, true, WarnIfNotEqualEnum); - GetArray(parent, prop, "deviceName", dest->deviceName, true); // size < VK_MAX_PHYSICAL_DEVICE_NAME_SIZE - GetArray(parent, prop, "pipelineCacheUUID", dest->pipelineCacheUUID, true); // size == VK_UUID_SIZE*/ + GET_VALUE(prop, apiVersion, false, requested_profile); + GET_VALUE(prop, driverVersion, true, requested_profile); + GET_VALUE(prop, vendorID, true, requested_profile); + GET_VALUE(prop, deviceID, true, requested_profile); + GET_VALUE_ENUM_WARN(prop, deviceType, true, requested_profile, WarnIfNotEqualEnum); + GetArray(device_name, parent, prop, "deviceName", dest->deviceName, true); // size < VK_MAX_PHYSICAL_DEVICE_NAME_SIZE + GetArray(device_name, parent, prop, "pipelineCacheUUID", dest->pipelineCacheUUID, true); // size == VK_UUID_SIZE*/ } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceLimits *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceLimits *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceLimits)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, maxImageDimension1D, false, WarnIfGreater); - GET_VALUE_WARN(member, maxImageDimension2D, false, WarnIfGreater); - GET_VALUE_WARN(member, maxImageDimension3D, false, WarnIfGreater); - GET_VALUE_WARN(member, maxImageDimensionCube, false, WarnIfGreater); - GET_VALUE_WARN(member, maxImageArrayLayers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxTexelBufferElements, false, WarnIfGreater); - GET_VALUE_WARN(member, maxUniformBufferRange, false, WarnIfGreater); - GET_VALUE_WARN(member, maxStorageBufferRange, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPushConstantsSize, false, WarnIfGreater); - GET_VALUE_WARN(member, maxMemoryAllocationCount, false, WarnIfGreater); - GET_VALUE_WARN(member, maxSamplerAllocationCount, false, WarnIfGreater); - GET_VALUE_WARN(member, bufferImageGranularity, false, WarnIfLesser); - GET_VALUE_WARN(member, sparseAddressSpaceSize, false, WarnIfGreater); - GET_VALUE_WARN(member, maxBoundDescriptorSets, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorSamplers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorUniformBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorStorageBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorSampledImages, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorStorageImages, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageDescriptorInputAttachments, false, WarnIfGreater); - GET_VALUE_WARN(member, maxPerStageResources, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetSamplers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUniformBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetUniformBuffersDynamic, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetStorageBuffers, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetStorageBuffersDynamic, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetSampledImages, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetStorageImages, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDescriptorSetInputAttachments, false, WarnIfGreater); - GET_VALUE_WARN(member, maxVertexInputAttributes, false, WarnIfGreater); - GET_VALUE_WARN(member, maxVertexInputBindings, false, WarnIfGreater); - GET_VALUE_WARN(member, maxVertexInputAttributeOffset, false, WarnIfGreater); - GET_VALUE_WARN(member, maxVertexInputBindingStride, false, WarnIfGreater); - GET_VALUE_WARN(member, maxVertexOutputComponents, false, WarnIfGreater); - GET_VALUE_WARN(member, maxTessellationGenerationLevel, false, WarnIfGreater); - GET_VALUE_WARN(member, maxTessellationPatchSize, false, WarnIfGreater); - GET_VALUE_WARN(member, maxTessellationControlPerVertexInputComponents, false, WarnIfGreater); - GET_VALUE_WARN(member, maxTessellationControlPerVertexOutputComponents, false, WarnIfGreater); - GET_VALUE_WARN(member, maxTessellationControlPerPatchOutputComponents, false, WarnIfGreater); - GET_VALUE_WARN(member, maxTessellationControlTotalOutputComponents, false, WarnIfGreater); - GET_VALUE_WARN(member, maxTessellationEvaluationInputComponents, false, WarnIfGreater); - GET_VALUE_WARN(member, maxTessellationEvaluationOutputComponents, false, WarnIfGreater); - GET_VALUE_WARN(member, maxGeometryShaderInvocations, false, WarnIfGreater); - GET_VALUE_WARN(member, maxGeometryInputComponents, false, WarnIfGreater); - GET_VALUE_WARN(member, maxGeometryOutputComponents, false, WarnIfGreater); - GET_VALUE_WARN(member, maxGeometryOutputVertices, false, WarnIfGreater); - GET_VALUE_WARN(member, maxGeometryTotalOutputComponents, false, WarnIfGreater); - GET_VALUE_WARN(member, maxFragmentInputComponents, false, WarnIfGreater); - GET_VALUE_WARN(member, maxFragmentOutputAttachments, false, WarnIfGreater); - GET_VALUE_WARN(member, maxFragmentDualSrcAttachments, false, WarnIfGreater); - GET_VALUE_WARN(member, maxFragmentCombinedOutputResources, false, WarnIfGreater); - GET_VALUE_WARN(member, maxComputeSharedMemorySize, false, WarnIfGreater); - GetArray(parent, member, "maxComputeWorkGroupCount", dest->maxComputeWorkGroupCount, false); - GET_VALUE_WARN(member, maxComputeWorkGroupInvocations, false, WarnIfGreater); - GetArray(parent, member, "maxComputeWorkGroupSize", dest->maxComputeWorkGroupSize, false); - GET_VALUE_WARN(member, subPixelPrecisionBits, false, WarnIfGreater); - GET_VALUE_WARN(member, subTexelPrecisionBits, false, WarnIfGreater); - GET_VALUE_WARN(member, mipmapPrecisionBits, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDrawIndexedIndexValue, false, WarnIfGreater); - GET_VALUE_WARN(member, maxDrawIndirectCount, false, WarnIfGreater); - GET_VALUE_WARN(member, maxSamplerLodBias, false, WarnIfGreaterFloat); - GET_VALUE_WARN(member, maxSamplerAnisotropy, false, WarnIfGreaterFloat); - GET_VALUE_WARN(member, maxViewports, false, WarnIfGreater); - GetArray(parent, member, "maxViewportDimensions", dest->maxViewportDimensions, false); - GetArray(parent, member, "viewportBoundsRange", dest->viewportBoundsRange, false); - GET_VALUE_WARN(member, viewportSubPixelBits, false, WarnIfGreater); - GET_VALUE_SIZE_T_WARN(member, minMemoryMapAlignment, false, WarnIfLesserSizet); - GET_VALUE_WARN(member, minTexelBufferOffsetAlignment, false, WarnIfLesser); - GET_VALUE_WARN(member, minUniformBufferOffsetAlignment, false, WarnIfLesser); - GET_VALUE_WARN(member, minStorageBufferOffsetAlignment, false, WarnIfLesser); - GET_VALUE_WARN(member, minTexelOffset, false, WarnIfLesser); - GET_VALUE_WARN(member, maxTexelOffset, false, WarnIfGreater); - GET_VALUE_WARN(member, minTexelGatherOffset, false, WarnIfLesser); - GET_VALUE_WARN(member, maxTexelGatherOffset, false, WarnIfGreater); - GET_VALUE_WARN(member, minInterpolationOffset, false, WarnIfLesserFloat); - GET_VALUE_WARN(member, maxInterpolationOffset, false, WarnIfGreaterFloat); - GET_VALUE_WARN(member, subPixelInterpolationOffsetBits, false, WarnIfGreater); - GET_VALUE_WARN(member, maxFramebufferWidth, false, WarnIfGreater); - GET_VALUE_WARN(member, maxFramebufferHeight, false, WarnIfGreater); - GET_VALUE_WARN(member, maxFramebufferLayers, false, WarnIfGreater); - GET_VALUE_FLAG_WARN(member, framebufferColorSampleCounts, false); - GET_VALUE_FLAG_WARN(member, framebufferDepthSampleCounts, false); - GET_VALUE_FLAG_WARN(member, framebufferStencilSampleCounts, false); - GET_VALUE_FLAG_WARN(member, framebufferNoAttachmentsSampleCounts, false); - GET_VALUE_WARN(member, maxColorAttachments, false, WarnIfGreater); - GET_VALUE_FLAG_WARN(member, sampledImageColorSampleCounts, false); - GET_VALUE_FLAG_WARN(member, sampledImageIntegerSampleCounts, false); - GET_VALUE_FLAG_WARN(member, sampledImageDepthSampleCounts, false); - GET_VALUE_FLAG_WARN(member, sampledImageStencilSampleCounts, false); - GET_VALUE_FLAG_WARN(member, storageImageSampleCounts, false); - GET_VALUE_WARN(member, maxSampleMaskWords, false, WarnIfGreater); - GET_VALUE_WARN(member, timestampComputeAndGraphics, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, timestampPeriod, true, WarnIfNotEqualFloat); - GET_VALUE_WARN(member, maxClipDistances, false, WarnIfGreater); - GET_VALUE_WARN(member, maxCullDistances, false, WarnIfGreater); - GET_VALUE_WARN(member, maxCombinedClipAndCullDistances, false, WarnIfGreater); - GET_VALUE_WARN(member, discreteQueuePriorities, false, WarnIfGreater); - GetArray(parent, member, "pointSizeRange", dest->pointSizeRange, false); - GetArray(parent, member, "lineWidthRange", dest->lineWidthRange, false); - GET_VALUE_WARN(member, pointSizeGranularity, false, WarnIfLesserFloat); - GET_VALUE_WARN(member, lineWidthGranularity, false, WarnIfLesserFloat); - GET_VALUE_WARN(member, strictLines, true, WarnIfNotEqualBool); - GET_VALUE_WARN(member, standardSampleLocations, true, WarnIfNotEqualBool); - GET_VALUE_WARN(member, optimalBufferCopyOffsetAlignment, false, WarnIfLesser); - GET_VALUE_WARN(member, optimalBufferCopyRowPitchAlignment, false, WarnIfLesser); - GET_VALUE_WARN(member, nonCoherentAtomSize, false, WarnIfLesser); + GET_VALUE_WARN(member, maxImageDimension1D, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxImageDimension2D, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxImageDimension3D, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxImageDimensionCube, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxImageArrayLayers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxTexelBufferElements, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxUniformBufferRange, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxStorageBufferRange, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPushConstantsSize, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxMemoryAllocationCount, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxSamplerAllocationCount, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, bufferImageGranularity, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, sparseAddressSpaceSize, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxBoundDescriptorSets, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorSamplers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorUniformBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorStorageBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorSampledImages, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorStorageImages, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageDescriptorInputAttachments, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxPerStageResources, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetSamplers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUniformBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetUniformBuffersDynamic, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetStorageBuffers, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetStorageBuffersDynamic, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetSampledImages, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetStorageImages, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDescriptorSetInputAttachments, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxVertexInputAttributes, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxVertexInputBindings, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxVertexInputAttributeOffset, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxVertexInputBindingStride, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxVertexOutputComponents, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxTessellationGenerationLevel, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxTessellationPatchSize, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxTessellationControlPerVertexInputComponents, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxTessellationControlPerVertexOutputComponents, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxTessellationControlPerPatchOutputComponents, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxTessellationControlTotalOutputComponents, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxTessellationEvaluationInputComponents, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxTessellationEvaluationOutputComponents, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxGeometryShaderInvocations, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxGeometryInputComponents, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxGeometryOutputComponents, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxGeometryOutputVertices, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxGeometryTotalOutputComponents, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxFragmentInputComponents, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxFragmentOutputAttachments, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxFragmentDualSrcAttachments, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxFragmentCombinedOutputResources, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxComputeSharedMemorySize, false, requested_profile, WarnIfGreater); + GetArray(device_name, parent, member, "maxComputeWorkGroupCount", dest->maxComputeWorkGroupCount, false); + GET_VALUE_WARN(member, maxComputeWorkGroupInvocations, false, requested_profile, WarnIfGreater); + GetArray(device_name, parent, member, "maxComputeWorkGroupSize", dest->maxComputeWorkGroupSize, false); + GET_VALUE_WARN(member, subPixelPrecisionBits, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, subTexelPrecisionBits, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, mipmapPrecisionBits, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDrawIndexedIndexValue, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxDrawIndirectCount, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxSamplerLodBias, false, requested_profile, WarnIfGreaterFloat); + GET_VALUE_WARN(member, maxSamplerAnisotropy, false, requested_profile, WarnIfGreaterFloat); + GET_VALUE_WARN(member, maxViewports, false, requested_profile, WarnIfGreater); + GetArray(device_name, parent, member, "maxViewportDimensions", dest->maxViewportDimensions, false); + GetArray(device_name, parent, member, "viewportBoundsRange", dest->viewportBoundsRange, false); + GET_VALUE_WARN(member, viewportSubPixelBits, false, requested_profile, WarnIfGreater); + GET_VALUE_SIZE_T_WARN(member, minMemoryMapAlignment, false, requested_profile, WarnIfLesserSizet); + GET_VALUE_WARN(member, minTexelBufferOffsetAlignment, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, minUniformBufferOffsetAlignment, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, minStorageBufferOffsetAlignment, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, minTexelOffset, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, maxTexelOffset, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, minTexelGatherOffset, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, maxTexelGatherOffset, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, minInterpolationOffset, false, requested_profile, WarnIfLesserFloat); + GET_VALUE_WARN(member, maxInterpolationOffset, false, requested_profile, WarnIfGreaterFloat); + GET_VALUE_WARN(member, subPixelInterpolationOffsetBits, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxFramebufferWidth, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxFramebufferHeight, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxFramebufferLayers, false, requested_profile, WarnIfGreater); + GET_VALUE_FLAG_WARN(member, framebufferColorSampleCounts, false, requested_profile); + GET_VALUE_FLAG_WARN(member, framebufferDepthSampleCounts, false, requested_profile); + GET_VALUE_FLAG_WARN(member, framebufferStencilSampleCounts, false, requested_profile); + GET_VALUE_FLAG_WARN(member, framebufferNoAttachmentsSampleCounts, false, requested_profile); + GET_VALUE_WARN(member, maxColorAttachments, false, requested_profile, WarnIfGreater); + GET_VALUE_FLAG_WARN(member, sampledImageColorSampleCounts, false, requested_profile); + GET_VALUE_FLAG_WARN(member, sampledImageIntegerSampleCounts, false, requested_profile); + GET_VALUE_FLAG_WARN(member, sampledImageDepthSampleCounts, false, requested_profile); + GET_VALUE_FLAG_WARN(member, sampledImageStencilSampleCounts, false, requested_profile); + GET_VALUE_FLAG_WARN(member, storageImageSampleCounts, false, requested_profile); + GET_VALUE_WARN(member, maxSampleMaskWords, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, timestampComputeAndGraphics, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, timestampPeriod, true, requested_profile, WarnIfNotEqualFloat); + GET_VALUE_WARN(member, maxClipDistances, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxCullDistances, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, maxCombinedClipAndCullDistances, false, requested_profile, WarnIfGreater); + GET_VALUE_WARN(member, discreteQueuePriorities, false, requested_profile, WarnIfGreater); + GetArray(device_name, parent, member, "pointSizeRange", dest->pointSizeRange, false); + GetArray(device_name, parent, member, "lineWidthRange", dest->lineWidthRange, false); + GET_VALUE_WARN(member, pointSizeGranularity, false, requested_profile, WarnIfLesserFloat); + GET_VALUE_WARN(member, lineWidthGranularity, false, requested_profile, WarnIfLesserFloat); + GET_VALUE_WARN(member, strictLines, true, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, standardSampleLocations, true, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, optimalBufferCopyOffsetAlignment, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, optimalBufferCopyRowPitchAlignment, false, requested_profile, WarnIfLesser); + GET_VALUE_WARN(member, nonCoherentAtomSize, false, requested_profile, WarnIfLesser); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceSparseProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceSparseProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceSparseProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, residencyStandard2DBlockShape, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, residencyStandard2DMultisampleBlockShape, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, residencyStandard3DBlockShape, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, residencyAlignedMipSize, false, WarnIfNotEqualBool); - GET_VALUE_WARN(member, residencyNonResidentStrict, false, WarnIfNotEqualBool); + GET_VALUE_WARN(member, residencyStandard2DBlockShape, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, residencyStandard2DMultisampleBlockShape, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, residencyStandard3DBlockShape, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, residencyAlignedMipSize, false, requested_profile, WarnIfNotEqualBool); + GET_VALUE_WARN(member, residencyNonResidentStrict, false, requested_profile, WarnIfNotEqualBool); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDeviceToolProperties *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDeviceToolProperties *dest) { (void)dest; + (void)requested_profile; LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDeviceToolProperties)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GetArray(parent, member, "name", dest->name, true); - GetArray(parent, member, "version", dest->version, true); - GetArray(parent, member, "description", dest->description, true); - GetArray(parent, member, "layer", dest->layer, true); + GetArray(device_name, parent, member, "name", dest->name, true); + GetArray(device_name, parent, member, "version", dest->version, true); + GetArray(device_name, parent, member, "description", dest->description, true); + GetArray(device_name, parent, member, "layer", dest->layer, true); } return valid; } -bool JsonLoader::GetStruct(const char* device_name, const Json::Value &parent, VkPhysicalDevicePortabilitySubsetPropertiesKHR *dest) { +bool JsonLoader::GetStruct(const char* device_name, bool requested_profile, const Json::Value &parent, VkPhysicalDevicePortabilitySubsetPropertiesKHR *dest) { LogMessage(&layer_settings, DEBUG_REPORT_DEBUG_BIT, "\tJsonLoader::GetStruct(VkPhysicalDevicePortabilitySubsetPropertiesKHR)\n"); bool valid = true; for (const auto &member : parent.getMemberNames()) { - GET_VALUE_WARN(member, minVertexInputBindingStrideAlignment, false, WarnIfLesser); + GET_VALUE_WARN(member, minVertexInputBindingStrideAlignment, false, requested_profile, WarnIfLesser); } return valid; } @@ -5977,8 +6184,9 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateInstance(const VkInstanceCreateInfo *pCreat } } + bool changed_version = false; - if (!layer_settings->simulate.profile_file.empty() || layer_settings->simulate.profile_dirs.empty()) { + if (!layer_settings->simulate.profile_file.empty() || !layer_settings->simulate.profile_dirs.empty()) { const uint32_t profile_api_version = json_loader.GetProfileApiVersion(); if (VK_API_VERSION_MAJOR(requested_version) < VK_API_VERSION_MAJOR(profile_api_version) || VK_API_VERSION_MINOR(requested_version) < VK_API_VERSION_MINOR(profile_api_version)) { @@ -6639,19 +6847,11 @@ void FillPNextChain(PhysicalDeviceData *physicalDeviceData, void *place) { data->pNext = pNext; } break; - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT: - if ((PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME))) { - VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *data = (VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT *)place; - void *pNext = data->pNext; - *data = physicalDeviceData->physical_device_vertex_attribute_divisor_properties_ext_; - data->pNext = pNext; - } - break; - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: - if ((PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME))) { - VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *data = (VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT *)place; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR: + if ((PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME))) { + VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *data = (VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *)place; void *pNext = data->pNext; - *data = physicalDeviceData->physical_device_vertex_attribute_divisor_features_; + *data = physicalDeviceData->physical_device_global_priority_query_features_; data->pNext = pNext; } break; @@ -6728,7 +6928,7 @@ void FillPNextChain(PhysicalDeviceData *physicalDeviceData, void *place) { } break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT: - if ((PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME))) { + if ((PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME) || PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME))) { VkPhysicalDeviceLineRasterizationPropertiesEXT *data = (VkPhysicalDeviceLineRasterizationPropertiesEXT *)place; void *pNext = data->pNext; *data = physicalDeviceData->physical_device_line_rasterization_properties_; @@ -6736,7 +6936,7 @@ void FillPNextChain(PhysicalDeviceData *physicalDeviceData, void *place) { } break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT: - if ((PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME))) { + if ((PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME) || PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME))) { VkPhysicalDeviceLineRasterizationFeaturesEXT *data = (VkPhysicalDeviceLineRasterizationFeaturesEXT *)place; void *pNext = data->pNext; *data = physicalDeviceData->physical_device_line_rasterization_features_; @@ -6752,7 +6952,7 @@ void FillPNextChain(PhysicalDeviceData *physicalDeviceData, void *place) { } break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: - if ((PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME))) { + if ((PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME) || PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_KHR_INDEX_TYPE_UINT8_EXTENSION_NAME))) { VkPhysicalDeviceIndexTypeUint8FeaturesEXT *data = (VkPhysicalDeviceIndexTypeUint8FeaturesEXT *)place; void *pNext = data->pNext; *data = physicalDeviceData->physical_device_index_type_uint_8_features_; @@ -6909,6 +7109,22 @@ void FillPNextChain(PhysicalDeviceData *physicalDeviceData, void *place) { } break; #endif // VK_USE_PLATFORM_SCI + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR: + if ((PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME))) { + VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR *data = (VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR *)place; + void *pNext = data->pNext; + *data = physicalDeviceData->physical_device_vertex_attribute_divisor_properties_; + data->pNext = pNext; + } + break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR: + if ((PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME))) { + VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR *data = (VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR *)place; + void *pNext = data->pNext; + *data = physicalDeviceData->physical_device_vertex_attribute_divisor_features_; + data->pNext = pNext; + } + break; #ifdef VK_USE_PLATFORM_SCREEN_QNX case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX: if ((PhysicalDeviceData::HasSimulatedExtension(physicalDeviceData, VK_QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME))) { @@ -6934,6 +7150,12 @@ void FillQueueFamilyPropertiesPNextChain(PhysicalDeviceData *physicalDeviceData, VkBaseOutStructure *structure = (VkBaseOutStructure *)place; switch (structure->sType) { + case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR: { + VkQueueFamilyGlobalPriorityPropertiesKHR *data = (VkQueueFamilyGlobalPriorityPropertiesKHR *)place; + void *pNext = data->pNext; + *data = physicalDeviceData->arrayof_queue_family_properties_[i].global_priority_properties_; + data->pNext = pNext; + } break; case VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV: { VkQueueFamilyCheckpointProperties2NV *data = (VkQueueFamilyCheckpointProperties2NV *)place; void *pNext = data->pNext; @@ -7037,7 +7259,11 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceLayerProperties(uint32_t *pCount VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pCount, VkExtensionProperties *pProperties) { if (pLayerName && !strcmp(pLayerName, kLayerName)) { +#ifdef VULKANSC return EnumerateProperties(0, (VkExtensionProperties*)nullptr, pCount, pProperties); +#else + return EnumerateProperties(kInstanceExtensionPropertiesCount, kInstanceExtensionProperties, pCount, pProperties); +#endif } return VK_ERROR_LAYER_NOT_PRESENT; } @@ -7875,13 +8101,10 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(VkInstance instance, uin feature_chain.pNext = &(pdd.physical_device_shader_clock_features_); } - if (PhysicalDeviceData::HasExtension(&pdd, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME)) { - pdd.physical_device_vertex_attribute_divisor_properties_ext_.pNext = property_chain.pNext; + if (PhysicalDeviceData::HasExtension(&pdd, VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME)) { + pdd.physical_device_global_priority_query_features_.pNext = feature_chain.pNext; - property_chain.pNext = &(pdd.physical_device_vertex_attribute_divisor_properties_ext_); - pdd.physical_device_vertex_attribute_divisor_features_.pNext = feature_chain.pNext; - - feature_chain.pNext = &(pdd.physical_device_vertex_attribute_divisor_features_); + feature_chain.pNext = &(pdd.physical_device_global_priority_query_features_); } if (PhysicalDeviceData::HasExtension(&pdd, VK_EXT_PCI_BUS_INFO_EXTENSION_NAME)) { @@ -7932,7 +8155,7 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(VkInstance instance, uin feature_chain.pNext = &(pdd.physical_device_ycbcr_image_arrays_features_); } - if (PhysicalDeviceData::HasExtension(&pdd, VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME)) { + if (PhysicalDeviceData::HasExtension(&pdd, VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME) || PhysicalDeviceData::HasExtension(&pdd, VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME)) { pdd.physical_device_line_rasterization_properties_.pNext = property_chain.pNext; property_chain.pNext = &(pdd.physical_device_line_rasterization_properties_); @@ -7947,7 +8170,7 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(VkInstance instance, uin feature_chain.pNext = &(pdd.physical_device_shader_atomic_float_features_); } - if (PhysicalDeviceData::HasExtension(&pdd, VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME)) { + if (PhysicalDeviceData::HasExtension(&pdd, VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME) || PhysicalDeviceData::HasExtension(&pdd, VK_KHR_INDEX_TYPE_UINT8_EXTENSION_NAME)) { pdd.physical_device_index_type_uint_8_features_.pNext = feature_chain.pNext; feature_chain.pNext = &(pdd.physical_device_index_type_uint_8_features_); @@ -8057,6 +8280,15 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(VkInstance instance, uin feature_chain.pNext = &(pdd.physical_device_external_sci_sync_2_features_); } #endif // VK_USE_PLATFORM_SCI + + if (PhysicalDeviceData::HasExtension(&pdd, VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME)) { + pdd.physical_device_vertex_attribute_divisor_properties_.pNext = property_chain.pNext; + + property_chain.pNext = &(pdd.physical_device_vertex_attribute_divisor_properties_); + pdd.physical_device_vertex_attribute_divisor_features_.pNext = feature_chain.pNext; + + feature_chain.pNext = &(pdd.physical_device_vertex_attribute_divisor_features_); + } #ifdef VK_USE_PLATFORM_SCREEN_QNX if (PhysicalDeviceData::HasExtension(&pdd, VK_QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME)) { @@ -8379,9 +8611,9 @@ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices(VkInstance instance, uin pdd.physical_device_memory_properties_ = memory_chain.memoryProperties; } - ::device_has_astc = pdd.physical_device_features_.textureCompressionASTC_LDR; - ::device_has_bc = pdd.physical_device_features_.textureCompressionBC; - ::device_has_etc2 = pdd.physical_device_features_.textureCompressionETC2; + ::device_has_astc = pdd.physical_device_features_.textureCompressionASTC_LDR == VK_TRUE; + ::device_has_bc = pdd.physical_device_features_.textureCompressionBC == VK_TRUE; + ::device_has_etc2 = pdd.physical_device_features_.textureCompressionETC2 == VK_TRUE; if (layer_settings->simulate.capabilities & SIMULATE_FORMATS_BIT) { LoadDeviceFormats(instance, &pdd, physical_device, &pdd.device_formats_, &pdd.device_formats_3_); diff --git a/devsim/profiles_json.h b/devsim/profiles_json.h index e76fb262f..2ec866bff 100644 --- a/devsim/profiles_json.h +++ b/devsim/profiles_json.h @@ -25,7 +25,7 @@ #include "profiles_settings.h" struct JsonValidator { - JsonValidator(){}; + JsonValidator(){} ~JsonValidator(); bool Init(); diff --git a/devsim/profiles_settings.cpp b/devsim/profiles_settings.cpp index 33cf8e145..1d623c88c 100644 --- a/devsim/profiles_settings.cpp +++ b/devsim/profiles_settings.cpp @@ -48,6 +48,8 @@ void WarnMissingFormatFeatures2(ProfileLayerSettings *layer_settings, const char format_device_support_string(device_features).c_str(), features.c_str()); } + + std::string GetDebugActionsLog(DebugActionFlags flags) { std::string result = {}; @@ -116,11 +118,12 @@ void LogMessage(ProfileLayerSettings *layer_settings, DebugReportBits report, co char log[STRING_BUFFER]; snprintf(log, STRING_BUFFER, "%s", GetLogPrefix(report)); + std::size_t len = std::strlen(log); va_list list; va_start(list, message); - vsnprintf(log, STRING_BUFFER, message, list); + vsnprintf(log + len, STRING_BUFFER, message, list); va_end(list); if (layer_settings->log.debug_actions & DEBUG_ACTION_STDOUT_BIT) { @@ -202,6 +205,7 @@ void InitProfilesLayerSettings(const VkInstanceCreateInfo *pCreateInfo, const Vk ProfileLayerSettings *layer_settings) { assert(layer_settings != nullptr); +#ifdef VULKANSC // We use a simplified configuration interface for Vulkan SC const char *devsim_profile_file = std::getenv("VKSC_DEVSIM_PROFILE_FILE"); if (devsim_profile_file) { @@ -216,4 +220,319 @@ void InitProfilesLayerSettings(const VkInstanceCreateInfo *pCreateInfo, const Vk layer_settings->simulate.emulate_portability = false; layer_settings->log.debug_reports = DEBUG_REPORT_ERROR_BIT; } +#else + const VkLayerSettingsCreateInfoEXT *create_info = vkuFindLayerSettingsCreateInfo(pCreateInfo); + + VkuLayerSettingSet layerSettingSet = VK_NULL_HANDLE; + vkuCreateLayerSettingSet(kLayerName, create_info, pAllocator, nullptr, &layerSettingSet); + + // Check if there is unknown settings if API settings are set + if (create_info != nullptr) { + static const char *setting_names[] = {kLayerSettingsProfileEmulation, + kLayerSettingsProfileFile, + kLayerSettingsProfileDirs, + kLayerSettingsProfileName, + kLayerSettingsProfileValidation, + kLayerSettingsEmulatePortability, + kLayerSettings_constantAlphaColorBlendFactors, + kLayerSettings_events, + kLayerSettings_imageViewFormatReinterpretation, + kLayerSettings_imageViewFormatSwizzle, + kLayerSettings_imageView2DOn3DImage, + kLayerSettings_multisampleArrayImage, + kLayerSettings_mutableComparisonSamplers, + kLayerSettings_pointPolygons, + kLayerSettings_samplerMipLodBias, + kLayerSettings_separateStencilMaskRef, + kLayerSettings_shaderSampleRateInterpolationFunctions, + kLayerSettings_tessellationIsolines, + kLayerSettings_tessellationPointMode, + kLayerSettings_triangleFans, + kLayerSettings_vertexAttributeAccessBeyondStride, + kLayerSettings_minVertexInputBindingStrideAlignment, + kLayerSettingsSimulateCapabilities, + kLayerSettingsDebugActions, + kLayerSettingsDebugFilename, + kLayerSettingsDebugFileClear, + kLayerSettingsDebugFailOnError, + kLayerSettingsDebugReports, + kLayerSettingsExcludeDeviceExtensions, + kLayerSettingsExcludeFormats, + kLayerSettingsDefaultFeatureValues, + kLayerSettingsForceDevice, + kLayerSettingsForceDeviceUUID, + kLayerSettingsForceDeviceName}; + uint32_t setting_name_count = static_cast(std::size(setting_names)); + + std::vector unknown_settings; + vkuGetUnknownSettings(create_info, setting_name_count, setting_names, unknown_settings); + + for (std::size_t i = 0, n = unknown_settings.size(); i < n; ++i) { + LogMessage(layer_settings, DEBUG_REPORT_WARNING_BIT, + "Unknown %s setting listed in VkLayerSettingsCreateInfoEXT, this setting is ignored.\n", + unknown_settings[i]); + } + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsProfileEmulation)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettingsProfileEmulation, layer_settings->simulate.profile_emulation); + } + + if (layer_settings->simulate.profile_emulation) { + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsProfileDirs)) { + layer_settings->simulate.profile_dirs.clear(); + + std::vector profile_dirs_list; + vkuGetLayerSettingValues(layerSettingSet, kLayerSettingsProfileDirs, profile_dirs_list); + for (std::size_t i = 0, n = profile_dirs_list.size(); i < n; ++i) { + std::vector profile_dirs = Split(profile_dirs_list[i], ","); + layer_settings->simulate.profile_dirs.insert( + layer_settings->simulate.profile_dirs.end(), profile_dirs.begin(), profile_dirs.end()); + } + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsProfileFile)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettingsProfileFile, layer_settings->simulate.profile_file); + } + } + + if (!layer_settings->simulate.profile_dirs.empty() || !layer_settings->simulate.profile_file.empty()) { + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsProfileName)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettingsProfileName, layer_settings->simulate.profile_name); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsProfileValidation)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettingsProfileValidation, layer_settings->simulate.profile_validation); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsSimulateCapabilities)) { + std::vector values; + vkuGetLayerSettingValues(layerSettingSet, kLayerSettingsSimulateCapabilities, values); + for (std::size_t i = 0, n = values.size(); i < n; ++i) { + values[i] = ToUpper(values[i]); + } + layer_settings->simulate.capabilities = GetSimulateCapabilityFlags(values); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsDefaultFeatureValues)) { + std::string value; + vkuGetLayerSettingValue(layerSettingSet, kLayerSettingsDefaultFeatureValues, value); + layer_settings->simulate.default_feature_values = GetDefaultFeatureValues(ToUpper(value)); + } + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsExcludeDeviceExtensions)) { + vkuGetLayerSettingValues(layerSettingSet, kLayerSettingsExcludeDeviceExtensions, + layer_settings->simulate.exclude_device_extensions); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsExcludeFormats)) { + vkuGetLayerSettingValues(layerSettingSet, kLayerSettingsExcludeFormats, layer_settings->simulate.exclude_formats); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsEmulatePortability)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettingsEmulatePortability, layer_settings->simulate.emulate_portability); + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_constantAlphaColorBlendFactors)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_constantAlphaColorBlendFactors, + layer_settings->portability.constantAlphaColorBlendFactors); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_events)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_events, layer_settings->portability.events); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_imageViewFormatReinterpretation)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_imageViewFormatReinterpretation, + layer_settings->portability.imageViewFormatReinterpretation); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_imageViewFormatSwizzle)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_imageViewFormatSwizzle, + layer_settings->portability.imageViewFormatSwizzle); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_imageView2DOn3DImage)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_imageView2DOn3DImage, + layer_settings->portability.imageView2DOn3DImage); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_multisampleArrayImage)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_multisampleArrayImage, + layer_settings->portability.multisampleArrayImage); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_mutableComparisonSamplers)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_mutableComparisonSamplers, + layer_settings->portability.mutableComparisonSamplers); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_pointPolygons)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_pointPolygons, layer_settings->portability.pointPolygons); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_samplerMipLodBias)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_samplerMipLodBias, + layer_settings->portability.samplerMipLodBias); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_separateStencilMaskRef)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_separateStencilMaskRef, + layer_settings->portability.separateStencilMaskRef); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_shaderSampleRateInterpolationFunctions)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_shaderSampleRateInterpolationFunctions, + layer_settings->portability.shaderSampleRateInterpolationFunctions); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_tessellationIsolines)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_tessellationIsolines, + layer_settings->portability.tessellationIsolines); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_tessellationPointMode)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_tessellationPointMode, + layer_settings->portability.tessellationPointMode); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_triangleFans)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_triangleFans, layer_settings->portability.triangleFans); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_vertexAttributeAccessBeyondStride)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_vertexAttributeAccessBeyondStride, + layer_settings->portability.vertexAttributeAccessBeyondStride); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettings_minVertexInputBindingStrideAlignment)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettings_minVertexInputBindingStrideAlignment, + layer_settings->portability.minVertexInputBindingStrideAlignment); + } + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsForceDevice)) { + std::string value; + vkuGetLayerSettingValue(layerSettingSet, kLayerSettingsForceDevice, value); + layer_settings->device.force_device = GetForceDevice(ToUpper(value)); + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsForceDeviceUUID)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettingsForceDeviceUUID, layer_settings->device.force_device_uuid); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsForceDeviceName)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettingsForceDeviceName, layer_settings->device.force_device_name); + } + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsDebugFailOnError)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettingsDebugFailOnError, layer_settings->log.debug_fail_on_error); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsDebugActions)) { + std::vector values; + vkuGetLayerSettingValues(layerSettingSet, kLayerSettingsDebugActions, values); + for (std::size_t i = 0, n = values.size(); i < n; ++i) { + values[i] = ToUpper(values[i]); + } + layer_settings->log.debug_actions = GetDebugActionFlags(values); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsDebugFilename)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettingsDebugFilename, layer_settings->log.debug_filename); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsDebugFileClear)) { + vkuGetLayerSettingValue(layerSettingSet, kLayerSettingsDebugFileClear, layer_settings->log.debug_file_discard); + } + + if (vkuHasLayerSetting(layerSettingSet, kLayerSettingsDebugReports)) { + std::vector values; + vkuGetLayerSettingValues(layerSettingSet, kLayerSettingsDebugReports, values); + for (std::size_t i = 0, n = values.size(); i < n; ++i) { + values[i] = ToUpper(values[i]); + } + layer_settings->log.debug_reports = GetDebugReportFlags(values); + } + + if (layer_settings->log.debug_actions & DEBUG_ACTION_FILE_BIT && layer_settings->log.profiles_log_file == nullptr) { + layer_settings->log.profiles_log_file = + fopen(layer_settings->log.debug_filename.c_str(), layer_settings->log.debug_file_discard ? "w" : "w+"); + if (layer_settings->log.profiles_log_file == nullptr) { + layer_settings->log.debug_actions &= ~DEBUG_ACTION_FILE_BIT; + layer_settings->log.debug_actions |= DEBUG_ACTION_STDOUT_BIT; + LogMessage(layer_settings, DEBUG_REPORT_ERROR_BIT, + "Could not open %s, log to file is being overridden by log to stdout.\n", + layer_settings->log.debug_filename.c_str()); + } else { + LogMessage(layer_settings, DEBUG_REPORT_DEBUG_BIT, "Log file %s opened\n", layer_settings->log.debug_filename.c_str()); + } + } else { + LogMessage(layer_settings, DEBUG_REPORT_DEBUG_BIT, "No need to open the log file %s\n", + layer_settings->log.debug_filename.c_str()); + } + + const std::string profile_dirs = GetString(layer_settings->simulate.profile_dirs); + const std::string simulation_capabilities_log = GetSimulateCapabilitiesLog(layer_settings->simulate.capabilities); + const std::string default_feature_values = GetDefaultFeatureValuesString(layer_settings->simulate.default_feature_values); + const std::string debug_actions_log = GetDebugActionsLog(layer_settings->log.debug_actions); + const std::string debug_reports_log = GetDebugReportsLog(layer_settings->log.debug_reports); + + std::string settings_log; + settings_log += format("\t%s: %s\n", kLayerSettingsProfileEmulation, layer_settings->simulate.profile_emulation ? "true" : "false"); + settings_log += format("\t%s: %s\n", kLayerSettingsProfileFile, layer_settings->simulate.profile_file.c_str()); + settings_log += format("\t%s: %s\n", kLayerSettingsProfileDirs, profile_dirs.c_str()); + settings_log += format("\t%s: %s\n", kLayerSettingsProfileName, layer_settings->simulate.profile_name.c_str()); + settings_log += + format("\t%s: %s\n", kLayerSettingsProfileValidation, layer_settings->simulate.profile_validation ? "true" : "false"); + settings_log += format("\t%s: %s\n", kLayerSettingsSimulateCapabilities, simulation_capabilities_log.c_str()); + settings_log += format("\t%s: %s\n", kLayerSettingsDefaultFeatureValues, default_feature_values.c_str()); + + settings_log += + format("\t%s: %s\n", kLayerSettingsEmulatePortability, layer_settings->simulate.emulate_portability ? "true" : "false"); + if (layer_settings->simulate.emulate_portability) { + settings_log += format("\t\t%s: %s\n", kLayerSettings_constantAlphaColorBlendFactors, + layer_settings->portability.constantAlphaColorBlendFactors ? "true" : "false"); + settings_log += format("\t\t%s: %s\n", kLayerSettings_events, layer_settings->portability.events ? "true" : "false"); + settings_log += format("\t\t%s: %s\n", kLayerSettings_imageViewFormatReinterpretation, + layer_settings->portability.imageViewFormatReinterpretation ? "true" : "false"); + settings_log += format("\t\t%s: %s\n", kLayerSettings_imageViewFormatSwizzle, + layer_settings->portability.imageViewFormatSwizzle ? "true" : "false"); + settings_log += format("\t\t%s: %s\n", kLayerSettings_imageView2DOn3DImage, + layer_settings->portability.imageView2DOn3DImage ? "true" : "false"); + settings_log += format("\t\t%s: %s\n", kLayerSettings_multisampleArrayImage, + layer_settings->portability.multisampleArrayImage ? "true" : "false"); + settings_log += format("\t\t%s: %s\n", kLayerSettings_mutableComparisonSamplers, + layer_settings->portability.mutableComparisonSamplers ? "true" : "false"); + settings_log += + format("\t\t%s: %s\n", kLayerSettings_pointPolygons, layer_settings->portability.pointPolygons ? "true" : "false"); + settings_log += format("\t\t%s: %s\n", kLayerSettings_samplerMipLodBias, + layer_settings->portability.samplerMipLodBias ? "true" : "false"); + settings_log += format("\t\t%s: %s\n", kLayerSettings_separateStencilMaskRef, + layer_settings->portability.separateStencilMaskRef ? "true" : "false"); + settings_log += format("\t\t%s: %s\n", kLayerSettings_shaderSampleRateInterpolationFunctions, + layer_settings->portability.shaderSampleRateInterpolationFunctions ? "true" : "false"); + settings_log += format("\t\t%s: %s\n", kLayerSettings_tessellationIsolines, + layer_settings->portability.tessellationIsolines ? "true" : "false"); + settings_log += + format("\t\t%s: %s\n", kLayerSettings_triangleFans, layer_settings->portability.triangleFans ? "true" : "false"); + settings_log += format("\t\t%s: %s\n", kLayerSettings_vertexAttributeAccessBeyondStride, + layer_settings->portability.vertexAttributeAccessBeyondStride ? "true" : "false"); + settings_log += format("\t\t%s: %d\n", kLayerSettings_minVertexInputBindingStrideAlignment, + static_cast(layer_settings->portability.minVertexInputBindingStrideAlignment)); + } + settings_log += format("\t%s: %s\n", kLayerSettingsDebugActions, debug_actions_log.c_str()); + settings_log += format("\t%s: %s\n", kLayerSettingsDebugFilename, layer_settings->log.debug_filename.c_str()); + settings_log += format("\t%s: %s\n", kLayerSettingsDebugFileClear, layer_settings->log.debug_file_discard ? "true" : "false"); + settings_log += + format("\t%s: %s\n", kLayerSettingsDebugFailOnError, layer_settings->log.debug_fail_on_error ? "true" : "false"); + settings_log += format("\t%s: %s\n", kLayerSettingsDebugReports, debug_reports_log.c_str()); + settings_log += format("\t%s: %s\n", kLayerSettingsExcludeDeviceExtensions, + GetString(layer_settings->simulate.exclude_device_extensions).c_str()); + settings_log += format("\t%s: %s\n", kLayerSettingsExcludeFormats, GetString(layer_settings->simulate.exclude_formats).c_str()); + + LogMessage(layer_settings, DEBUG_REPORT_NOTIFICATION_BIT, "Profile Layers Settings: {\n%s}\n", settings_log.c_str()); + + vkuDestroyLayerSettingSet(layerSettingSet, pAllocator); +#endif // VULKANSC } diff --git a/devsim/profiles_settings.h b/devsim/profiles_settings.h index b05f1d6a4..c5eb9ec4c 100644 --- a/devsim/profiles_settings.h +++ b/devsim/profiles_settings.h @@ -66,7 +66,11 @@ static DebugActionFlags GetDebugActionFlags(const std::vector &valu static std::vector GetDebugActionStrings(DebugActionFlags flags) { static const char *table[] = { - "DEBUG_ACTION_FILE_BIT", "DEBUG_ACTION_STDOUT_BIT", "DEBUG_ACTION_OUTPUT_BIT", "DEBUG_ACTION_BREAKPOINT_BIT"}; + "DEBUG_ACTION_FILE_BIT", + "DEBUG_ACTION_STDOUT_BIT", + "DEBUG_ACTION_OUTPUT_BIT", + "DEBUG_ACTION_BREAKPOINT_BIT" + }; std::vector result; @@ -78,6 +82,7 @@ static std::vector GetDebugActionStrings(DebugActionFlags flags) { return result; } + std::string GetDebugActionsLog(DebugActionFlags flags); enum DebugReportBits { @@ -114,6 +119,7 @@ enum DefaultFeatureValues { DEFAULT_FEATURE_VALUES_DEVICE }; + static DefaultFeatureValues GetDefaultFeatureValues(const std::string &value) { if (value == "DEFAULT_FEATURE_VALUES_FALSE") { return DEFAULT_FEATURE_VALUES_FALSE; diff --git a/devsim/profiles_util.cpp b/devsim/profiles_util.cpp index 3e3e0789d..8e9019170 100644 --- a/devsim/profiles_util.cpp +++ b/devsim/profiles_util.cpp @@ -28,7 +28,7 @@ std::string format(const char *message, ...) { std::size_t const STRING_BUFFER(4096); assert(message != nullptr); - assert(strlen(message) >= 0 && strlen(message) < STRING_BUFFER); + assert(strlen(message) < STRING_BUFFER); char buffer[STRING_BUFFER]; va_list list; @@ -74,6 +74,11 @@ std::string GetString(const std::vector &strings) { return result; } +bool EndsWith(std::string const &value, std::string const &ending) { + if (ending.size() > value.size()) return false; + return std::equal(ending.rbegin(), ending.rend(), value.rbegin()); +} + std::string GetUUIDString(const uint8_t deviceUUID[VK_UUID_SIZE]) { std::string result; diff --git a/devsim/profiles_util.h b/devsim/profiles_util.h index 8245b1ed5..e24914208 100644 --- a/devsim/profiles_util.h +++ b/devsim/profiles_util.h @@ -50,6 +50,8 @@ std::string format(const char *message, ...); std::string GetString(const std::vector &strings); std::string GetUUIDString(const uint8_t deviceUUID[VK_UUID_SIZE]); +bool EndsWith(std::string const &value, std::string const &ending); + std::string format_device_support_string(VkFormatFeatureFlags format_features); std::string format_device_support_string(VkFormatFeatureFlags2 format_features); diff --git a/icd/VkICD_mock_icd.json.in b/icd/VkICD_mock_icd.json.in index 8f5d684da..b2d56577a 100644 --- a/icd/VkICD_mock_icd.json.in +++ b/icd/VkICD_mock_icd.json.in @@ -2,6 +2,6 @@ "file_format_version": "1.0.1", "ICD": { "library_path": "@JSON_LIBRARY_PATH@", - "api_version": "1.3.278" + "api_version": "1.3.285" } } \ No newline at end of file diff --git a/icd/VkICD_mock_icd_vksc.json.in b/icd/VkICD_mock_icd_vksc.json.in index 0f6f70219..f48462853 100644 --- a/icd/VkICD_mock_icd_vksc.json.in +++ b/icd/VkICD_mock_icd_vksc.json.in @@ -2,6 +2,6 @@ "file_format_version": "1.0.1", "ICD": { "library_path": "@JSON_LIBRARY_PATH@", - "api_version": "1.0.14" + "api_version": "1.0.15" } } \ No newline at end of file diff --git a/icd/generated-vksc/function_declarations.h b/icd/generated-vksc/function_declarations.h index f5c6179d4..bda32e3a8 100644 --- a/icd/generated-vksc/function_declarations.h +++ b/icd/generated-vksc/function_declarations.h @@ -71,11 +71,9 @@ static const std::unordered_map device_extension_map = { {"VK_EXT_post_depth_coverage", 1}, {"VK_EXT_image_drm_format_modifier", 2}, {"VK_EXT_filter_cubic", 3}, - {"VK_EXT_global_priority", 2}, {"VK_EXT_external_memory_host", 1}, {"VK_KHR_shader_clock", 1}, - {"VK_EXT_calibrated_timestamps", 2}, - {"VK_EXT_vertex_attribute_divisor", 3}, + {"VK_KHR_global_priority", 1}, {"VK_KHR_swapchain_mutable_format", 1}, {"VK_EXT_pci_bus_info", 2}, {"VK_KHR_shader_terminate_invocation", 1}, @@ -99,13 +97,18 @@ static const std::unordered_map device_extension_map = { {"VK_EXT_image_robustness", 1}, {"VK_KHR_copy_commands2", 1}, {"VK_EXT_4444_formats", 1}, + {"VK_NV_acquire_winrt_display", 1}, {"VK_EXT_vertex_input_dynamic_state", 2}, {"VK_NV_external_sci_sync", 2}, {"VK_NV_external_memory_sci_buf", 2}, {"VK_EXT_extended_dynamic_state2", 1}, {"VK_EXT_color_write_enable", 1}, {"VK_NV_external_sci_sync2", 1}, + {"VK_KHR_vertex_attribute_divisor", 1}, {"VK_QNX_external_memory_screen_buffer", 1}, + {"VK_KHR_index_type_uint8", 1}, + {"VK_KHR_line_rasterization", 1}, + {"VK_KHR_calibrated_timestamps", 1}, }; @@ -1439,6 +1442,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneCapabilities2KHR( + static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceFragmentShadingRatesKHR( VkPhysicalDevice physicalDevice, uint32_t* pFragmentShadingRateCount, @@ -1532,6 +1536,27 @@ static VKAPI_ATTR void VKAPI_CALL CmdResolveImage2KHR( +static VKAPI_ATTR void VKAPI_CALL CmdSetLineStippleKHR( + VkCommandBuffer commandBuffer, + uint32_t lineStippleFactor, + uint16_t lineStipplePattern); + + +static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCalibrateableTimeDomainsKHR( + VkPhysicalDevice physicalDevice, + uint32_t* pTimeDomainCount, + VkTimeDomainKHR* pTimeDomains); + +static VKAPI_ATTR VkResult VKAPI_CALL GetCalibratedTimestampsKHR( + VkDevice device, + uint32_t timestampCount, + const VkCalibratedTimestampInfoKHR* pTimestampInfos, + uint64_t* pTimestamps, + uint64_t* pMaxDeviation); + + + + static VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT( @@ -1665,7 +1690,6 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetImageDrmFormatModifierPropertiesEXT( - static VKAPI_ATTR VkResult VKAPI_CALL GetMemoryHostPointerPropertiesEXT( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, @@ -1673,20 +1697,6 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetMemoryHostPointerPropertiesEXT( VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties); -static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCalibrateableTimeDomainsEXT( - VkPhysicalDevice physicalDevice, - uint32_t* pTimeDomainCount, - VkTimeDomainKHR* pTimeDomains); - -static VKAPI_ATTR VkResult VKAPI_CALL GetCalibratedTimestampsEXT( - VkDevice device, - uint32_t timestampCount, - const VkCalibratedTimestampInfoKHR* pTimestampInfos, - uint64_t* pTimestamps, - uint64_t* pMaxDeviation); - - - @@ -1775,6 +1785,18 @@ static VKAPI_ATTR void VKAPI_CALL CmdSetStencilOpEXT( +#ifdef VK_USE_PLATFORM_WIN32_KHR + +static VKAPI_ATTR VkResult VKAPI_CALL AcquireWinrtDisplayNV( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display); + +static VKAPI_ATTR VkResult VKAPI_CALL GetWinrtDisplayNV( + VkPhysicalDevice physicalDevice, + uint32_t deviceRelativeId, + VkDisplayKHR* pDisplay); +#endif /* VK_USE_PLATFORM_WIN32_KHR */ + static VKAPI_ATTR void VKAPI_CALL CmdSetVertexInputEXT( VkCommandBuffer commandBuffer, @@ -2139,6 +2161,9 @@ static const std::unordered_map name_to_funcptr_map = { {"vkCmdCopyImageToBuffer2KHR", (void*)CmdCopyImageToBuffer2KHR}, {"vkCmdBlitImage2KHR", (void*)CmdBlitImage2KHR}, {"vkCmdResolveImage2KHR", (void*)CmdResolveImage2KHR}, + {"vkCmdSetLineStippleKHR", (void*)CmdSetLineStippleKHR}, + {"vkGetPhysicalDeviceCalibrateableTimeDomainsKHR", (void*)GetPhysicalDeviceCalibrateableTimeDomainsKHR}, + {"vkGetCalibratedTimestampsKHR", (void*)GetCalibratedTimestampsKHR}, {"vkReleaseDisplayEXT", (void*)ReleaseDisplayEXT}, {"vkGetPhysicalDeviceSurfaceCapabilities2EXT", (void*)GetPhysicalDeviceSurfaceCapabilities2EXT}, {"vkDisplayPowerControlEXT", (void*)DisplayPowerControlEXT}, @@ -2164,8 +2189,6 @@ static const std::unordered_map name_to_funcptr_map = { {"vkGetPhysicalDeviceMultisamplePropertiesEXT", (void*)GetPhysicalDeviceMultisamplePropertiesEXT}, {"vkGetImageDrmFormatModifierPropertiesEXT", (void*)GetImageDrmFormatModifierPropertiesEXT}, {"vkGetMemoryHostPointerPropertiesEXT", (void*)GetMemoryHostPointerPropertiesEXT}, - {"vkGetPhysicalDeviceCalibrateableTimeDomainsEXT", (void*)GetPhysicalDeviceCalibrateableTimeDomainsEXT}, - {"vkGetCalibratedTimestampsEXT", (void*)GetCalibratedTimestampsEXT}, {"vkCreateHeadlessSurfaceEXT", (void*)CreateHeadlessSurfaceEXT}, {"vkCmdSetLineStippleEXT", (void*)CmdSetLineStippleEXT}, {"vkCmdSetCullModeEXT", (void*)CmdSetCullModeEXT}, @@ -2180,6 +2203,12 @@ static const std::unordered_map name_to_funcptr_map = { {"vkCmdSetDepthBoundsTestEnableEXT", (void*)CmdSetDepthBoundsTestEnableEXT}, {"vkCmdSetStencilTestEnableEXT", (void*)CmdSetStencilTestEnableEXT}, {"vkCmdSetStencilOpEXT", (void*)CmdSetStencilOpEXT}, +#ifdef VK_USE_PLATFORM_WIN32_KHR + {"vkAcquireWinrtDisplayNV", (void*)AcquireWinrtDisplayNV}, +#endif +#ifdef VK_USE_PLATFORM_WIN32_KHR + {"vkGetWinrtDisplayNV", (void*)GetWinrtDisplayNV}, +#endif {"vkCmdSetVertexInputEXT", (void*)CmdSetVertexInputEXT}, #ifdef VK_USE_PLATFORM_SCI {"vkGetFenceSciSyncFenceNV", (void*)GetFenceSciSyncFenceNV}, diff --git a/icd/generated-vksc/function_definitions.h b/icd/generated-vksc/function_definitions.h index f42758e54..d49bb37a8 100644 --- a/icd/generated-vksc/function_definitions.h +++ b/icd/generated-vksc/function_definitions.h @@ -386,7 +386,16 @@ static VKAPI_ATTR VkResult VKAPI_CALL QueueSubmit( const VkSubmitInfo* pSubmits, VkFence fence) { -//Not a CREATE or DESTROY function + // Special way to cause DEVICE_LOST + // Picked VkExportFenceCreateInfo because needed some struct that wouldn't get cleared by validation Safe Struct + // ... TODO - It would be MUCH nicer to have a layer or other setting control when this occured + // For now this is used to allow Validation Layers test reacting to device losts + if (submitCount > 0 && pSubmits) { + auto pNext = reinterpret_cast(pSubmits[0].pNext); + if (pNext && pNext->sType == VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO && pNext->pNext == nullptr) { + return VK_ERROR_DEVICE_LOST; + } + } return VK_SUCCESS; } @@ -1669,14 +1678,6 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2( pProperties->properties.limits.maxDescriptorSetInputAttachments; } - auto *props_13 = lvl_find_mod_in_chain(pProperties->pNext); - if (props_13) { - props_13->storageTexelBufferOffsetSingleTexelAlignment = VK_TRUE; - props_13->uniformTexelBufferOffsetSingleTexelAlignment = VK_TRUE; - props_13->storageTexelBufferOffsetAlignmentBytes = 16; - props_13->uniformTexelBufferOffsetAlignmentBytes = 16; - } - auto *protected_memory_props = lvl_find_mod_in_chain(pProperties->pNext); if (protected_memory_props) { protected_memory_props->protectedNoFault = VK_FALSE; @@ -1714,7 +1715,7 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2( blend_op_advanced_props->advancedBlendAllOperations = VK_FALSE; } - auto *vertex_attrib_div_props = lvl_find_mod_in_chain(pProperties->pNext); + auto *vertex_attrib_div_props = lvl_find_mod_in_chain(pProperties->pNext); if (vertex_attrib_div_props) { vertex_attrib_div_props->maxVertexAttribDivisor = 65535; } @@ -2814,6 +2815,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneCapabilities2KHR( + static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceFragmentShadingRatesKHR( VkPhysicalDevice physicalDevice, uint32_t* pFragmentShadingRateCount, @@ -2970,6 +2972,43 @@ static VKAPI_ATTR void VKAPI_CALL CmdResolveImage2KHR( +static VKAPI_ATTR void VKAPI_CALL CmdSetLineStippleKHR( + VkCommandBuffer commandBuffer, + uint32_t lineStippleFactor, + uint16_t lineStipplePattern) +{ +//Not a CREATE or DESTROY function +} + + +static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCalibrateableTimeDomainsKHR( + VkPhysicalDevice physicalDevice, + uint32_t* pTimeDomainCount, + VkTimeDomainKHR* pTimeDomains) +{ + if (!pTimeDomains) { + *pTimeDomainCount = 1; + } else { + // arbitrary + *pTimeDomains = VK_TIME_DOMAIN_DEVICE_KHR; + } + return VK_SUCCESS; +} + +static VKAPI_ATTR VkResult VKAPI_CALL GetCalibratedTimestampsKHR( + VkDevice device, + uint32_t timestampCount, + const VkCalibratedTimestampInfoKHR* pTimestampInfos, + uint64_t* pTimestamps, + uint64_t* pMaxDeviation) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} + + + + static VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT( @@ -3190,7 +3229,6 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetImageDrmFormatModifierPropertiesEXT( - static VKAPI_ATTR VkResult VKAPI_CALL GetMemoryHostPointerPropertiesEXT( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, @@ -3202,33 +3240,6 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetMemoryHostPointerPropertiesEXT( } -static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCalibrateableTimeDomainsEXT( - VkPhysicalDevice physicalDevice, - uint32_t* pTimeDomainCount, - VkTimeDomainKHR* pTimeDomains) -{ - if (!pTimeDomains) { - *pTimeDomainCount = 1; - } else { - // arbitrary - *pTimeDomains = VK_TIME_DOMAIN_DEVICE_EXT; - } - return VK_SUCCESS; -} - -static VKAPI_ATTR VkResult VKAPI_CALL GetCalibratedTimestampsEXT( - VkDevice device, - uint32_t timestampCount, - const VkCalibratedTimestampInfoKHR* pTimestampInfos, - uint64_t* pTimestamps, - uint64_t* pMaxDeviation) -{ -//Not a CREATE or DESTROY function - return VK_SUCCESS; -} - - - @@ -3361,6 +3372,26 @@ static VKAPI_ATTR void VKAPI_CALL CmdSetStencilOpEXT( +#ifdef VK_USE_PLATFORM_WIN32_KHR + +static VKAPI_ATTR VkResult VKAPI_CALL AcquireWinrtDisplayNV( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} + +static VKAPI_ATTR VkResult VKAPI_CALL GetWinrtDisplayNV( + VkPhysicalDevice physicalDevice, + uint32_t deviceRelativeId, + VkDisplayKHR* pDisplay) +{ +//Not a CREATE or DESTROY function + return VK_SUCCESS; +} +#endif /* VK_USE_PLATFORM_WIN32_KHR */ + static VKAPI_ATTR void VKAPI_CALL CmdSetVertexInputEXT( VkCommandBuffer commandBuffer, diff --git a/icd/generated-vksc/vk_typemap_helper.h b/icd/generated-vksc/vk_typemap_helper.h index a2466fb3c..b7fd79b1a 100644 --- a/icd/generated-vksc/vk_typemap_helper.h +++ b/icd/generated-vksc/vk_typemap_helper.h @@ -2307,6 +2307,33 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkDeviceQueueGlobalPriorityCreateInfoKHR Type; +}; + +// Map type VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR Type; +}; + +// Map type VkQueueFamilyGlobalPriorityPropertiesKHR to id VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkQueueFamilyGlobalPriorityPropertiesKHR Type; +}; + // Map type VkFragmentShadingRateAttachmentInfoKHR to id VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR; @@ -2379,6 +2406,78 @@ template <> struct LvlSTypeMap { typedef VkCheckpointData2NV Type; }; +// Map type VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR Type; +}; + +// Map type VkPipelineVertexInputDivisorStateCreateInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPipelineVertexInputDivisorStateCreateInfoKHR Type; +}; + +// Map type VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR Type; +}; + +// Map type VkPhysicalDeviceIndexTypeUint8FeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceIndexTypeUint8FeaturesKHR Type; +}; + +// Map type VkPhysicalDeviceLineRasterizationFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceLineRasterizationFeaturesKHR Type; +}; + +// Map type VkPhysicalDeviceLineRasterizationPropertiesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceLineRasterizationPropertiesKHR Type; +}; + +// Map type VkPipelineRasterizationLineStateCreateInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkPipelineRasterizationLineStateCreateInfoKHR Type; +}; + +// Map type VkCalibratedTimestampInfoKHR to id VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR; +}; + +template <> struct LvlSTypeMap { + typedef VkCalibratedTimestampInfoKHR Type; +}; + // Map type VkImageViewASTCDecodeModeEXT to id VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT; @@ -2694,15 +2793,6 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkDeviceQueueGlobalPriorityCreateInfoKHR Type; -}; - // Map type VkImportMemoryHostPointerInfoEXT to id VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT; @@ -2730,42 +2820,6 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkCalibratedTimestampInfoKHR Type; -}; - -// Map type VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT Type; -}; - -// Map type VkPipelineVertexInputDivisorStateCreateInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkPipelineVertexInputDivisorStateCreateInfoKHR Type; -}; - -// Map type VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR Type; -}; - // Map type VkPhysicalDevicePCIBusInfoPropertiesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT; @@ -2829,33 +2883,6 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceLineRasterizationFeaturesKHR Type; -}; - -// Map type VkPhysicalDeviceLineRasterizationPropertiesKHR to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceLineRasterizationPropertiesKHR Type; -}; - -// Map type VkPipelineRasterizationLineStateCreateInfoKHR to id VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_KHR -template <> struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkPipelineRasterizationLineStateCreateInfoKHR Type; -}; - // Map type VkPhysicalDeviceShaderAtomicFloatFeaturesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT; @@ -2865,15 +2892,6 @@ template <> struct LvlSTypeMap struct LvlTypeMap { - static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_KHR; -}; - -template <> struct LvlSTypeMap { - typedef VkPhysicalDeviceIndexTypeUint8FeaturesKHR Type; -}; - // Map type VkPhysicalDeviceExtendedDynamicStateFeaturesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; diff --git a/icd/generated/function_declarations.h b/icd/generated/function_declarations.h index acd50a12f..cb5231931 100644 --- a/icd/generated/function_declarations.h +++ b/icd/generated/function_declarations.h @@ -284,7 +284,7 @@ static const std::unordered_map device_extension_map = { {"VK_QCOM_render_pass_store_ops", 2}, {"VK_NV_cuda_kernel_launch", 2}, {"VK_NV_low_latency", 1}, - {"VK_EXT_metal_objects", 1}, + {"VK_EXT_metal_objects", 2}, {"VK_KHR_synchronization2", 1}, {"VK_EXT_descriptor_buffer", 1}, {"VK_EXT_graphics_pipeline_library", 1}, @@ -363,7 +363,7 @@ static const std::unordered_map device_extension_map = { {"VK_EXT_shader_module_identifier", 1}, {"VK_EXT_rasterization_order_attachment_access", 1}, {"VK_NV_optical_flow", 1}, - {"VK_EXT_legacy_dithering", 1}, + {"VK_EXT_legacy_dithering", 2}, {"VK_EXT_pipeline_protected_access", 1}, {"VK_ANDROID_external_format_resolve", 1}, {"VK_KHR_maintenance5", 1}, @@ -375,6 +375,7 @@ static const std::unordered_map device_extension_map = { {"VK_NV_ray_tracing_invocation_reorder", 1}, {"VK_NV_extended_sparse_address_space", 1}, {"VK_EXT_mutable_descriptor_type", 1}, + {"VK_EXT_legacy_vertex_attributes", 1}, {"VK_ARM_shader_core_builtins", 2}, {"VK_EXT_pipeline_library_group_handles", 1}, {"VK_EXT_dynamic_rendering_unused_attachments", 1}, @@ -400,7 +401,10 @@ static const std::unordered_map device_extension_map = { {"VK_KHR_shader_expect_assume", 1}, {"VK_KHR_maintenance6", 1}, {"VK_NV_descriptor_pool_overallocation", 1}, + {"VK_NV_raw_access_chains", 1}, {"VK_NV_shader_atomic_float16_vector", 1}, + {"VK_NV_ray_tracing_validation", 1}, + {"VK_MESA_image_alignment_control", 1}, }; @@ -4303,6 +4307,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetDynamicRenderingTilePropertiesQCOM( + static VKAPI_ATTR VkResult VKAPI_CALL SetLatencySleepModeNV( VkDevice device, VkSwapchainKHR swapchain, @@ -4350,6 +4355,9 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetScreenBufferPropertiesQNX( + + + static VKAPI_ATTR VkResult VKAPI_CALL CreateAccelerationStructureKHR( VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo, diff --git a/icd/generated/function_definitions.h b/icd/generated/function_definitions.h index d0e1b4166..60e08af45 100644 --- a/icd/generated/function_definitions.h +++ b/icd/generated/function_definitions.h @@ -377,7 +377,16 @@ static VKAPI_ATTR VkResult VKAPI_CALL QueueSubmit( const VkSubmitInfo* pSubmits, VkFence fence) { -//Not a CREATE or DESTROY function + // Special way to cause DEVICE_LOST + // Picked VkExportFenceCreateInfo because needed some struct that wouldn't get cleared by validation Safe Struct + // ... TODO - It would be MUCH nicer to have a layer or other setting control when this occured + // For now this is used to allow Validation Layers test reacting to device losts + if (submitCount > 0 && pSubmits) { + auto pNext = reinterpret_cast(pSubmits[0].pNext); + if (pNext && pNext->sType == VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO && pNext->pNext == nullptr) { + return VK_ERROR_DEVICE_LOST; + } + } return VK_SUCCESS; } @@ -3577,10 +3586,9 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2KHR { auto *external_image_prop = lvl_find_mod_in_chain(pImageFormatProperties->pNext); auto *external_image_format = lvl_find_in_chain(pImageFormatInfo->pNext); - if (external_image_prop && external_image_format && external_image_format->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) { + if (external_image_prop && external_image_format) { external_image_prop->externalMemoryProperties.externalMemoryFeatures = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT | VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT; external_image_prop->externalMemoryProperties.compatibleHandleTypes = external_image_format->handleType; - external_image_prop->externalMemoryProperties.compatibleHandleTypes = external_image_format->handleType; } GetPhysicalDeviceImageFormatProperties(physicalDevice, pImageFormatInfo->format, pImageFormatInfo->type, pImageFormatInfo->tiling, pImageFormatInfo->usage, pImageFormatInfo->flags, &pImageFormatProperties->imageFormatProperties); @@ -3748,7 +3756,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandlePropertiesKHR( HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) { -//Not a CREATE or DESTROY function + pMemoryWin32HandleProperties->memoryTypeBits = 0xFFFF; return VK_SUCCESS; } #endif /* VK_USE_PLATFORM_WIN32_KHR */ @@ -7518,6 +7526,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetDynamicRenderingTilePropertiesQCOM( + static VKAPI_ATTR VkResult VKAPI_CALL SetLatencySleepModeNV( VkDevice device, VkSwapchainKHR swapchain, @@ -7589,6 +7598,9 @@ static VKAPI_ATTR VkResult VKAPI_CALL GetScreenBufferPropertiesQNX( + + + static VKAPI_ATTR VkResult VKAPI_CALL CreateAccelerationStructureKHR( VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo, diff --git a/icd/generated/vk_typemap_helper.h b/icd/generated/vk_typemap_helper.h index dd412aaf4..4426a87ac 100644 --- a/icd/generated/vk_typemap_helper.h +++ b/icd/generated/vk_typemap_helper.h @@ -7685,6 +7685,24 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT Type; +}; + +// Map type VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT Type; +}; + // Map type VkLayerSettingsCreateInfoEXT to id VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT; @@ -8001,6 +8019,15 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAW_ACCESS_CHAINS_FEATURES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceRawAccessChainsFeaturesNV Type; +}; + // Map type VkPhysicalDeviceShaderAtomicFloat16VectorFeaturesNV to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT16_VECTOR_FEATURES_NV; @@ -8010,6 +8037,42 @@ template <> struct LvlSTypeMap struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_VALIDATION_FEATURES_NV; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceRayTracingValidationFeaturesNV Type; +}; + +// Map type VkPhysicalDeviceImageAlignmentControlFeaturesMESA to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_FEATURES_MESA; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceImageAlignmentControlFeaturesMESA Type; +}; + +// Map type VkPhysicalDeviceImageAlignmentControlPropertiesMESA to id VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_PROPERTIES_MESA +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ALIGNMENT_CONTROL_PROPERTIES_MESA; +}; + +template <> struct LvlSTypeMap { + typedef VkPhysicalDeviceImageAlignmentControlPropertiesMESA Type; +}; + +// Map type VkImageAlignmentControlCreateInfoMESA to id VK_STRUCTURE_TYPE_IMAGE_ALIGNMENT_CONTROL_CREATE_INFO_MESA +template <> struct LvlTypeMap { + static const VkStructureType kSType = VK_STRUCTURE_TYPE_IMAGE_ALIGNMENT_CONTROL_CREATE_INFO_MESA; +}; + +template <> struct LvlSTypeMap { + typedef VkImageAlignmentControlCreateInfoMESA Type; +}; + // Map type VkAccelerationStructureGeometryTrianglesDataKHR to id VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR template <> struct LvlTypeMap { static const VkStructureType kSType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR; diff --git a/scripts/known_good.json b/scripts/known_good.json index 0f53039a6..e9bd2aff5 100644 --- a/scripts/known_good.json +++ b/scripts/known_good.json @@ -7,7 +7,7 @@ "sub_dir": "Vulkan-Headers", "build_dir": "Vulkan-Headers/build", "install_dir": "Vulkan-Headers/build/install", - "commit": "v1.3.278" + "commit": "v1.3.285" }, { "name": "Vulkan-Headers", @@ -19,7 +19,7 @@ "cmake_options": [ "-DGEN_VULKANSC_COMBINED=ON" ], - "commit": "fb874b731b9097af396411c0d19362419f798200" + "commit": "vksc1.0.15" }, { "name": "Vulkan-Utility-Libraries", @@ -28,7 +28,7 @@ "sub_dir": "Vulkan-Utility-Libraries", "build_dir": "Vulkan-Utility-Libraries/build", "install_dir": "Vulkan-Utility-Libraries/build/install", - "commit": "7dc142c45f5a37e2b0e60c202863579b33443052", + "commit": "vksc1.0.15", "deps": [ { "var_name": "VULKAN_HEADERS_INSTALL_DIR", @@ -42,7 +42,7 @@ "sub_dir": "MoltenVK", "build_dir": "MoltenVK", "install_dir": "MoltenVK", - "commit": "v1.2.7", + "commit": "v1.2.8", "custom_build": [ "./fetchDependencies --macos", "xcodebuild -project MoltenVKPackaging.xcodeproj GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS MVK_CONFIG_LOG_LEVEL=1' -scheme \"MoltenVK Package (macOS only)\" build" @@ -61,7 +61,7 @@ "cmake_options": [ "-DVOLK_INSTALL=ON" ], - "commit": "vulkan-sdk-1.3.275", + "commit": "vulkan-sdk-1.3.283", "deps": [ { "var_name": "VULKAN_HEADERS_INSTALL_DIR", @@ -126,7 +126,7 @@ "cmake_options": [ "-DLOADER_USE_UNSAFE_FILE_SEARCH=ON" ], - "commit": "v1.3.278", + "commit": "v1.3.285", "build_platforms": [ "windows", "linux", @@ -149,7 +149,7 @@ "cmake_options": [ "-DLOADER_USE_UNSAFE_FILE_SEARCH=ON" ], - "commit": "86492711fec3dcc37fc38b14fbad2bcff3042ad6", + "commit": "vksc1.0.15", "build_platforms": [ "windows", "linux", diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py index 0955539c0..e1ca16256 100644 --- a/scripts/mock_icd_generator.py +++ b/scripts/mock_icd_generator.py @@ -531,10 +531,9 @@ 'vkGetPhysicalDeviceImageFormatProperties2KHR': ''' auto *external_image_prop = lvl_find_mod_in_chain(pImageFormatProperties->pNext); auto *external_image_format = lvl_find_in_chain(pImageFormatInfo->pNext); - if (external_image_prop && external_image_format && external_image_format->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) { + if (external_image_prop && external_image_format) { external_image_prop->externalMemoryProperties.externalMemoryFeatures = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT | VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT; external_image_prop->externalMemoryProperties.compatibleHandleTypes = external_image_format->handleType; - external_image_prop->externalMemoryProperties.compatibleHandleTypes = external_image_format->handleType; } GetPhysicalDeviceImageFormatProperties(physicalDevice, pImageFormatInfo->format, pImageFormatInfo->type, pImageFormatInfo->tiling, pImageFormatInfo->usage, pImageFormatInfo->flags, &pImageFormatProperties->imageFormatProperties); @@ -1654,6 +1653,23 @@ *pFence = (VkFence)global_unique_handle++; return VK_SUCCESS; ''', +'vkQueueSubmit': ''' + // Special way to cause DEVICE_LOST + // Picked VkExportFenceCreateInfo because needed some struct that wouldn't get cleared by validation Safe Struct + // ... TODO - It would be MUCH nicer to have a layer or other setting control when this occured + // For now this is used to allow Validation Layers test reacting to device losts + if (submitCount > 0 && pSubmits) { + auto pNext = reinterpret_cast(pSubmits[0].pNext); + if (pNext && pNext->sType == VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO && pNext->pNext == nullptr) { + return VK_ERROR_DEVICE_LOST; + } + } + return VK_SUCCESS; +''', +'vkGetMemoryWin32HandlePropertiesKHR': ''' + pMemoryWin32HandleProperties->memoryTypeBits = 0xFFFF; + return VK_SUCCESS; +''' } CUSTOM_VKSC_INTERCEPT_RENAMES = { @@ -1782,14 +1798,6 @@ pProperties->properties.limits.maxDescriptorSetInputAttachments; } - auto *props_13 = lvl_find_mod_in_chain(pProperties->pNext); - if (props_13) { - props_13->storageTexelBufferOffsetSingleTexelAlignment = VK_TRUE; - props_13->uniformTexelBufferOffsetSingleTexelAlignment = VK_TRUE; - props_13->storageTexelBufferOffsetAlignmentBytes = 16; - props_13->uniformTexelBufferOffsetAlignmentBytes = 16; - } - auto *protected_memory_props = lvl_find_mod_in_chain(pProperties->pNext); if (protected_memory_props) { protected_memory_props->protectedNoFault = VK_FALSE; @@ -1827,7 +1835,7 @@ blend_op_advanced_props->advancedBlendAllOperations = VK_FALSE; } - auto *vertex_attrib_div_props = lvl_find_mod_in_chain(pProperties->pNext); + auto *vertex_attrib_div_props = lvl_find_mod_in_chain(pProperties->pNext); if (vertex_attrib_div_props) { vertex_attrib_div_props->maxVertexAttribDivisor = 65535; } diff --git a/scripts/update_deps.py b/scripts/update_deps.py index ad7af1b68..933e56115 100755 --- a/scripts/update_deps.py +++ b/scripts/update_deps.py @@ -492,11 +492,12 @@ def CMakeConfig(self, repos): # Use the CMake -A option to select the platform architecture # without needing a Visual Studio generator. if platform.system() == 'Windows' and self._args.generator != "Ninja": + cmake_cmd.append('-A') if self._args.arch.lower() == '64' or self._args.arch == 'x64' or self._args.arch == 'win64': - cmake_cmd.append('-A') cmake_cmd.append('x64') + elif self._args.arch == 'arm64': + cmake_cmd.append('arm64') else: - cmake_cmd.append('-A') cmake_cmd.append('Win32') # Apply a generator, if one is specified. This can be used to supply @@ -677,7 +678,7 @@ def main(): parser.add_argument( '--arch', dest='arch', - choices=['32', '64', 'x86', 'x64', 'win32', 'win64'], + choices=['32', '64', 'x86', 'x64', 'win32', 'win64', 'arm64'], type=str.lower, help="Set build files architecture (Visual Studio Generator Only)", default='64') diff --git a/scripts/vulkaninfo_generator.py b/scripts/vulkaninfo_generator.py index 6da959663..a4b3238ef 100644 --- a/scripts/vulkaninfo_generator.py +++ b/scripts/vulkaninfo_generator.py @@ -656,7 +656,7 @@ def PrintStructure(struct, types_to_gen): out += ' }\n' else: # dynamic array length based on other member out += f' if (obj.{v.arrayLength} == 0) {{\n' - out += f' p.PrintKeyValue("{v.name}", "NULL");\n' + out += f' p.PrintKeyString("{v.name}", "NULL");\n' out += ' } else {\n' out += f' ArrayWrapper arr(p,"{v.name}", obj.{v.arrayLength});\n' out += f' for (uint32_t i = 0; i < obj.{v.arrayLength}; i++) {{\n' diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 01860b503..be62490b0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -35,21 +35,6 @@ endif() find_package(VulkanLoader CONFIG) -# setup binary_locations_$.h.in using binary_locations.h.in as a source -file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/binary_locations_$.h" INPUT "${CMAKE_CURRENT_SOURCE_DIR}/binary_locations.h.in") - -# copy binary_locations_$ to the build directory -add_custom_command( - PRE_BUILD - COMMAND ${CMAKE_COMMAND} "-E" "copy_if_different" "${CMAKE_CURRENT_BINARY_DIR}/binary_locations_$.h" "${CMAKE_CURRENT_BINARY_DIR}/binary_locations.h" - VERBATIM - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/binary_locations_$.h" - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/binary_locations.h" - COMMENT "creating binary_locations.h file ({event: PRE_BUILD}, {filename: binary_locations.h })" - ) -add_custom_target (generate_binary_locations DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/binary_locations.h") -add_dependencies (generate_binary_locations vkcube vkcubepp VkICD_mock_icd vulkaninfo) - find_package(GTest REQUIRED CONFIG QUIET) add_executable(vulkan_tools_tests) @@ -61,14 +46,16 @@ target_sources(vulkan_tools_tests PRIVATE get_target_property(TEST_SOURCES vulkan_tools_tests SOURCES) source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${TEST_SOURCES}) -target_include_directories(vulkan_tools_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) +target_include_directories(vulkan_tools_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(vulkan_tools_tests GTest::gtest Vulkan::Headers Vulkan::Loader) -add_dependencies(vulkan_tools_tests generate_binary_locations) if (WIN32) target_compile_definitions(vulkan_tools_tests PUBLIC -DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN -DNOMINMAX) endif() set_target_properties(vulkan_tools_tests PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") +# Set the exact path to Mock JSON ICD +target_compile_definitions(vulkan_tools_tests PRIVATE MOCK_ICD_JSON_MANIFEST_PATH="$") + if (DEFINED GIT_BRANCH_NAME AND DEFINED GIT_TAG_INFO) target_compile_definitions(vulkan_tools_tests PRIVATE GIT_BRANCH_NAME="${GIT_BRANCH_NAME}" GIT_TAG_INFO="${GIT_TAG_INFO}") endif() diff --git a/tests/binary_locations.h.in b/tests/binary_locations.h.in deleted file mode 100644 index acdd9b83b..000000000 --- a/tests/binary_locations.h.in +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 The Khronos Group Inc. - * Copyright (c) 2023 Valve Corporation - * Copyright (c) 2023 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#define MOCK_ICD_JSON_MANIFEST_PATH "$" diff --git a/tests/test_common.h b/tests/test_common.h index de06a7844..72df90670 100644 --- a/tests/test_common.h +++ b/tests/test_common.h @@ -26,9 +26,6 @@ #include "gtest/gtest.h" #include "vulkan/vulkan.h" -// Location of the built binaries in this repo -#include "binary_locations.h" - #if defined(WIN32) #include inline int set_environment_var(const char* name, const char* value) { return SetEnvironmentVariable(name, value); } diff --git a/vulkaninfo/generated-vksc/vulkaninfo.hpp b/vulkaninfo/generated-vksc/vulkaninfo.hpp index 6950d494d..6b8c3d9a1 100644 --- a/vulkaninfo/generated-vksc/vulkaninfo.hpp +++ b/vulkaninfo/generated-vksc/vulkaninfo.hpp @@ -100,6 +100,7 @@ std::string VkDriverIdString(VkDriverId value) { case (VK_DRIVER_ID_MESA_NVK): return "DRIVER_ID_MESA_NVK"; case (VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA): return "DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA"; case (VK_DRIVER_ID_MESA_AGXV): return "DRIVER_ID_MESA_AGXV"; + case (VK_DRIVER_ID_RESERVED_27): return "DRIVER_ID_RESERVED_27"; default: return std::string("UNKNOWN_VkDriverId_value") + std::to_string(value); } } @@ -358,7 +359,7 @@ std::string VkFormatString(VkFormat value) { case (VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG): return "FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG"; case (VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG): return "FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG"; case (VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG): return "FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG"; - case (VK_FORMAT_R16G16_S10_5_NV): return "FORMAT_R16G16_S10_5_NV"; + case (VK_FORMAT_R16G16_SFIXED5_NV): return "FORMAT_R16G16_SFIXED5_NV"; case (VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR): return "FORMAT_A1B5G5R5_UNORM_PACK16_KHR"; case (VK_FORMAT_A8_UNORM_KHR): return "FORMAT_A8_UNORM_KHR"; default: return std::string("UNKNOWN_VkFormat_value") + std::to_string(value); @@ -430,6 +431,21 @@ void DumpVkPresentModeKHR(Printer &p, std::string name, VkPresentModeKHR value) else p.PrintKeyString(name, VkPresentModeKHRString(value)); } +std::string VkQueueGlobalPriorityKHRString(VkQueueGlobalPriorityKHR value) { + switch (value) { + case (VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR): return "QUEUE_GLOBAL_PRIORITY_LOW_KHR"; + case (VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR): return "QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR"; + case (VK_QUEUE_GLOBAL_PRIORITY_HIGH_KHR): return "QUEUE_GLOBAL_PRIORITY_HIGH_KHR"; + case (VK_QUEUE_GLOBAL_PRIORITY_REALTIME_KHR): return "QUEUE_GLOBAL_PRIORITY_REALTIME_KHR"; + default: return std::string("UNKNOWN_VkQueueGlobalPriorityKHR_value") + std::to_string(value); + } +} +void DumpVkQueueGlobalPriorityKHR(Printer &p, std::string name, VkQueueGlobalPriorityKHR value) { + if (p.Type() == OutputType::json) + p.PrintKeyString(name, std::string("VK_") + VkQueueGlobalPriorityKHRString(value)); + else + p.PrintKeyString(name, VkQueueGlobalPriorityKHRString(value)); +} std::string VkResultString(VkResult value) { switch (value) { case (VK_SUCCESS): return "SUCCESS"; @@ -1526,6 +1542,11 @@ void DumpVkPhysicalDeviceFragmentShadingRatePropertiesKHR(Printer &p, std::strin p.PrintKeyBool("fragmentShadingRateWithCustomSampleLocations", static_cast(obj.fragmentShadingRateWithCustomSampleLocations)); p.PrintKeyBool("fragmentShadingRateStrictMultiplyCombiner", static_cast(obj.fragmentShadingRateStrictMultiplyCombiner)); } +void DumpVkPhysicalDeviceGlobalPriorityQueryFeaturesKHR(Printer &p, std::string name, const VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(19); + p.PrintKeyBool("globalPriorityQuery", static_cast(obj.globalPriorityQuery)); +} void DumpVkPhysicalDeviceHostQueryResetFeatures(Printer &p, std::string name, const VkPhysicalDeviceHostQueryResetFeatures &obj) { ObjectWrapper object{p, name}; p.SetMinKeyWidth(14); @@ -2042,10 +2063,11 @@ void DumpVkPhysicalDeviceVertexAttributeDivisorFeaturesKHR(Printer &p, std::stri p.PrintKeyBool("vertexAttributeInstanceRateDivisor", static_cast(obj.vertexAttributeInstanceRateDivisor)); p.PrintKeyBool("vertexAttributeInstanceRateZeroDivisor", static_cast(obj.vertexAttributeInstanceRateZeroDivisor)); } -void DumpVkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(Printer &p, std::string name, const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT &obj) { +void DumpVkPhysicalDeviceVertexAttributeDivisorPropertiesKHR(Printer &p, std::string name, const VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR &obj) { ObjectWrapper object{p, name}; - p.SetMinKeyWidth(22); + p.SetMinKeyWidth(28); p.PrintKeyValue("maxVertexAttribDivisor", obj.maxVertexAttribDivisor); + p.PrintKeyBool("supportsNonZeroFirstInstance", static_cast(obj.supportsNonZeroFirstInstance)); } void DumpVkPhysicalDeviceVertexInputDynamicStateFeaturesEXT(Printer &p, std::string name, const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT &obj) { ObjectWrapper object{p, name}; @@ -2313,6 +2335,18 @@ void DumpVkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures(Printer &p, std:: p.SetMinKeyWidth(35); p.PrintKeyBool("shaderZeroInitializeWorkgroupMemory", static_cast(obj.shaderZeroInitializeWorkgroupMemory)); } +void DumpVkQueueFamilyGlobalPriorityPropertiesKHR(Printer &p, std::string name, const VkQueueFamilyGlobalPriorityPropertiesKHR &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(14); + p.PrintKeyValue("priorityCount", obj.priorityCount); + ArrayWrapper arr(p,"priorities", obj.priorityCount); + for (uint32_t i = 0; i < obj.priorityCount; i++) { + if (p.Type() == OutputType::json) + p.PrintString(std::string("VK_") + VkQueueGlobalPriorityKHRString(obj.priorities[i])); + else + p.PrintString(VkQueueGlobalPriorityKHRString(obj.priorities[i])); + } +} void DumpVkSharedPresentSurfaceCapabilitiesKHR(Printer &p, std::string name, const VkSharedPresentSurfaceCapabilitiesKHR &obj) { ObjectWrapper object{p, name}; DumpVkImageUsageFlags(p, "sharedPresentSupportedUsageFlags", obj.sharedPresentSupportedUsageFlags); @@ -2371,7 +2405,7 @@ struct phys_device_props2_chain { VkPhysicalDeviceSubgroupSizeControlProperties PhysicalDeviceSubgroupSizeControlProperties{}; VkPhysicalDeviceTexelBufferAlignmentProperties PhysicalDeviceTexelBufferAlignmentProperties{}; VkPhysicalDeviceTimelineSemaphoreProperties PhysicalDeviceTimelineSemaphoreProperties{}; - VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT PhysicalDeviceVertexAttributeDivisorPropertiesEXT{}; + VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR PhysicalDeviceVertexAttributeDivisorPropertiesKHR{}; VkPhysicalDeviceVulkan11Properties PhysicalDeviceVulkan11Properties{}; VkPhysicalDeviceVulkan12Properties PhysicalDeviceVulkan12Properties{}; VkPhysicalDeviceVulkan13Properties PhysicalDeviceVulkan13Properties{}; @@ -2405,7 +2439,7 @@ struct phys_device_props2_chain { PhysicalDeviceSubgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES; PhysicalDeviceTexelBufferAlignmentProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES; PhysicalDeviceTimelineSemaphoreProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES; - PhysicalDeviceVertexAttributeDivisorPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT; + PhysicalDeviceVertexAttributeDivisorPropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR; PhysicalDeviceVulkan11Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES; PhysicalDeviceVulkan12Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES; PhysicalDeviceVulkan13Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES; @@ -2470,8 +2504,8 @@ struct phys_device_props2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceTexelBufferAlignmentProperties)); if (gpu.api_version >= VK_API_VERSION_1_2) chain_members.push_back(reinterpret_cast(&PhysicalDeviceTimelineSemaphoreProperties)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME)) - chain_members.push_back(reinterpret_cast(&PhysicalDeviceVertexAttributeDivisorPropertiesEXT)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceVertexAttributeDivisorPropertiesKHR)); if (gpu.api_version >= VK_API_VERSION_1_2) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVulkan11Properties)); if (gpu.api_version >= VK_API_VERSION_1_2) @@ -2669,10 +2703,10 @@ void chain_iterator_phys_device_props2(Printer &p, AppInstance &inst, AppGpu &gp DumpVkPhysicalDeviceTimelineSemaphoreProperties(p, "VkPhysicalDeviceTimelineSemaphoreProperties", *props); p.AddNewline(); } - if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT && - (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME))) { - VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT* props = (VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT*)structure; - DumpVkPhysicalDeviceVertexAttributeDivisorPropertiesEXT(p, "VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT", *props); + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR && + (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME))) { + VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR* props = (VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR*)structure; + DumpVkPhysicalDeviceVertexAttributeDivisorPropertiesKHR(p, "VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR", *props); p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES && @@ -2751,6 +2785,7 @@ struct phys_device_features2_chain { VkPhysicalDeviceExtendedDynamicStateFeaturesEXT PhysicalDeviceExtendedDynamicStateFeaturesEXT{}; VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT PhysicalDeviceFragmentShaderInterlockFeaturesEXT{}; VkPhysicalDeviceFragmentShadingRateFeaturesKHR PhysicalDeviceFragmentShadingRateFeaturesKHR{}; + VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR PhysicalDeviceGlobalPriorityQueryFeaturesKHR{}; VkPhysicalDeviceHostQueryResetFeatures PhysicalDeviceHostQueryResetFeatures{}; VkPhysicalDeviceImageRobustnessFeatures PhysicalDeviceImageRobustnessFeatures{}; VkPhysicalDeviceImagelessFramebufferFeatures PhysicalDeviceImagelessFramebufferFeatures{}; @@ -2811,6 +2846,7 @@ struct phys_device_features2_chain { PhysicalDeviceExtendedDynamicStateFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT; PhysicalDeviceFragmentShaderInterlockFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT; PhysicalDeviceFragmentShadingRateFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR; + PhysicalDeviceGlobalPriorityQueryFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR; PhysicalDeviceHostQueryResetFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES; PhysicalDeviceImageRobustnessFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES; PhysicalDeviceImagelessFramebufferFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES; @@ -2885,6 +2921,8 @@ struct phys_device_features2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceFragmentShaderInterlockFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceFragmentShadingRateFeaturesKHR)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceGlobalPriorityQueryFeaturesKHR)); if (gpu.api_version >= VK_API_VERSION_1_2) chain_members.push_back(reinterpret_cast(&PhysicalDeviceHostQueryResetFeatures)); if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_IMAGE_ROBUSTNESS_EXTENSION_NAME)) @@ -2959,8 +2997,7 @@ struct phys_device_features2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceUniformBufferStandardLayoutFeatures)); if (gpu.api_version >= VK_API_VERSION_1_1) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVariablePointersFeatures)); - if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME) - || gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME)) + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVertexAttributeDivisorFeaturesKHR)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceVertexInputDynamicStateFeaturesEXT)); @@ -3089,6 +3126,12 @@ void chain_iterator_phys_device_features2(Printer &p, AppGpu &gpu, void * place) DumpVkPhysicalDeviceFragmentShadingRateFeaturesKHR(p, "VkPhysicalDeviceFragmentShadingRateFeaturesKHR", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR && + (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME))) { + VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR* props = (VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR*)structure; + DumpVkPhysicalDeviceGlobalPriorityQueryFeaturesKHR(p, "VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES && (gpu.api_version >= VK_API_VERSION_1_2)) { VkPhysicalDeviceHostQueryResetFeatures* props = (VkPhysicalDeviceHostQueryResetFeatures*)structure; @@ -3294,7 +3337,7 @@ void chain_iterator_phys_device_features2(Printer &p, AppGpu &gpu, void * place) p.AddNewline(); } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR && - (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME) || gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME))) { + (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME))) { VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR* props = (VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR*)structure; DumpVkPhysicalDeviceVertexAttributeDivisorFeaturesKHR(p, "VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR", *props); p.AddNewline(); @@ -3445,8 +3488,12 @@ struct queue_properties2_chain { queue_properties2_chain(queue_properties2_chain &&) = delete; queue_properties2_chain& operator=(queue_properties2_chain &&) = delete; void* start_of_chain = nullptr; + VkQueueFamilyGlobalPriorityPropertiesKHR QueueFamilyGlobalPriorityPropertiesKHR{}; void initialize_chain(AppGpu &gpu ) noexcept { + QueueFamilyGlobalPriorityPropertiesKHR.sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR; std::vector chain_members{}; + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&QueueFamilyGlobalPriorityPropertiesKHR)); if (!chain_members.empty()) { for(size_t i = 0; i < chain_members.size() - 1; i++){ @@ -3466,6 +3513,12 @@ void chain_iterator_queue_properties2(Printer &p, AppGpu &gpu, void * place) { while (place) { struct VkBaseOutStructure *structure = (struct VkBaseOutStructure *)place; p.SetSubHeader(); + if (structure->sType == VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR && + (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME))) { + VkQueueFamilyGlobalPriorityPropertiesKHR* props = (VkQueueFamilyGlobalPriorityPropertiesKHR*)structure; + DumpVkQueueFamilyGlobalPriorityPropertiesKHR(p, "VkQueueFamilyGlobalPriorityPropertiesKHR", *props); + p.AddNewline(); + } place = structure->pNext; } } diff --git a/vulkaninfo/generated/vulkaninfo.hpp b/vulkaninfo/generated/vulkaninfo.hpp index c0e93ab14..b19813ce8 100644 --- a/vulkaninfo/generated/vulkaninfo.hpp +++ b/vulkaninfo/generated/vulkaninfo.hpp @@ -358,7 +358,7 @@ std::string VkFormatString(VkFormat value) { case (VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG): return "FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG"; case (VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG): return "FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG"; case (VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG): return "FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG"; - case (VK_FORMAT_R16G16_S10_5_NV): return "FORMAT_R16G16_S10_5_NV"; + case (VK_FORMAT_R16G16_SFIXED5_NV): return "FORMAT_R16G16_SFIXED5_NV"; case (VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR): return "FORMAT_A1B5G5R5_UNORM_PACK16_KHR"; case (VK_FORMAT_A8_UNORM_KHR): return "FORMAT_A8_UNORM_KHR"; default: return std::string("UNKNOWN_VkFormat_value") + std::to_string(value); @@ -1989,7 +1989,7 @@ void DumpVkPhysicalDeviceHostImageCopyPropertiesEXT(Printer &p, std::string name p.SetMinKeyWidth(35); p.PrintKeyValue("copySrcLayoutCount", obj.copySrcLayoutCount); if (obj.copySrcLayoutCount == 0) { - p.PrintKeyValue("pCopySrcLayouts", "NULL"); + p.PrintKeyString("pCopySrcLayouts", "NULL"); } else { ArrayWrapper arr(p,"pCopySrcLayouts", obj.copySrcLayoutCount); for (uint32_t i = 0; i < obj.copySrcLayoutCount; i++) { @@ -2004,7 +2004,7 @@ void DumpVkPhysicalDeviceHostImageCopyPropertiesEXT(Printer &p, std::string name } p.PrintKeyValue("copyDstLayoutCount", obj.copyDstLayoutCount); if (obj.copyDstLayoutCount == 0) { - p.PrintKeyValue("pCopyDstLayouts", "NULL"); + p.PrintKeyString("pCopyDstLayouts", "NULL"); } else { ArrayWrapper arr(p,"pCopyDstLayouts", obj.copyDstLayoutCount); for (uint32_t i = 0; i < obj.copyDstLayoutCount; i++) { @@ -2097,6 +2097,16 @@ void DumpVkPhysicalDeviceLegacyDitheringFeaturesEXT(Printer &p, std::string name p.SetMinKeyWidth(15); p.PrintKeyBool("legacyDithering", static_cast(obj.legacyDithering)); } +void DumpVkPhysicalDeviceLegacyVertexAttributesFeaturesEXT(Printer &p, std::string name, const VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(22); + p.PrintKeyBool("legacyVertexAttributes", static_cast(obj.legacyVertexAttributes)); +} +void DumpVkPhysicalDeviceLegacyVertexAttributesPropertiesEXT(Printer &p, std::string name, const VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT &obj) { + ObjectWrapper object{p, name}; + p.SetMinKeyWidth(26); + p.PrintKeyBool("nativeUnalignedPerformance", static_cast(obj.nativeUnalignedPerformance)); +} void DumpVkPhysicalDeviceLimits(Printer &p, std::string name, const VkPhysicalDeviceLimits &obj) { if (p.Type() == OutputType::json) p.ObjectStart("limits"); @@ -3304,7 +3314,7 @@ void DumpVkSurfacePresentModeCompatibilityEXT(Printer &p, std::string name, cons p.SetMinKeyWidth(31); p.PrintKeyValue("presentModeCount", obj.presentModeCount); if (obj.presentModeCount == 0) { - p.PrintKeyValue("pPresentModes", "NULL"); + p.PrintKeyString("pPresentModes", "NULL"); } else { ArrayWrapper arr(p,"pPresentModes", obj.presentModeCount); for (uint32_t i = 0; i < obj.presentModeCount; i++) { @@ -3360,6 +3370,7 @@ struct phys_device_props2_chain { VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT{}; VkPhysicalDeviceIDProperties PhysicalDeviceIDProperties{}; VkPhysicalDeviceInlineUniformBlockProperties PhysicalDeviceInlineUniformBlockProperties{}; + VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT PhysicalDeviceLegacyVertexAttributesPropertiesEXT{}; VkPhysicalDeviceLineRasterizationPropertiesKHR PhysicalDeviceLineRasterizationPropertiesKHR{}; VkPhysicalDeviceMaintenance3Properties PhysicalDeviceMaintenance3Properties{}; VkPhysicalDeviceMaintenance4Properties PhysicalDeviceMaintenance4Properties{}; @@ -3422,6 +3433,7 @@ struct phys_device_props2_chain { PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT; PhysicalDeviceIDProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES; PhysicalDeviceInlineUniformBlockProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES; + PhysicalDeviceLegacyVertexAttributesPropertiesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT; PhysicalDeviceLineRasterizationPropertiesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR; PhysicalDeviceMaintenance3Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES; PhysicalDeviceMaintenance4Properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES; @@ -3514,6 +3526,8 @@ struct phys_device_props2_chain { if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME)) && gpu.api_version < VK_API_VERSION_1_3) chain_members.push_back(reinterpret_cast(&PhysicalDeviceInlineUniformBlockProperties)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceLegacyVertexAttributesPropertiesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME) || gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceLineRasterizationPropertiesKHR)); @@ -3757,6 +3771,12 @@ void chain_iterator_phys_device_props2(Printer &p, AppInstance &inst, AppGpu &gp DumpVkPhysicalDeviceInlineUniformBlockProperties(p, gpu.api_version >= VK_API_VERSION_1_3 ?"VkPhysicalDeviceInlineUniformBlockProperties":"VkPhysicalDeviceInlineUniformBlockPropertiesEXT", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_PROPERTIES_EXT && + (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME))) { + VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT* props = (VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT*)structure; + DumpVkPhysicalDeviceLegacyVertexAttributesPropertiesEXT(p, "VkPhysicalDeviceLegacyVertexAttributesPropertiesEXT", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_KHR && (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME) || gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME))) { VkPhysicalDeviceLineRasterizationPropertiesKHR* props = (VkPhysicalDeviceLineRasterizationPropertiesKHR*)structure; @@ -4078,6 +4098,7 @@ struct phys_device_features2_chain { VkPhysicalDeviceIndexTypeUint8FeaturesKHR PhysicalDeviceIndexTypeUint8FeaturesKHR{}; VkPhysicalDeviceInlineUniformBlockFeatures PhysicalDeviceInlineUniformBlockFeatures{}; VkPhysicalDeviceLegacyDitheringFeaturesEXT PhysicalDeviceLegacyDitheringFeaturesEXT{}; + VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT PhysicalDeviceLegacyVertexAttributesFeaturesEXT{}; VkPhysicalDeviceLineRasterizationFeaturesKHR PhysicalDeviceLineRasterizationFeaturesKHR{}; VkPhysicalDeviceMaintenance4Features PhysicalDeviceMaintenance4Features{}; VkPhysicalDeviceMaintenance5FeaturesKHR PhysicalDeviceMaintenance5FeaturesKHR{}; @@ -4213,6 +4234,7 @@ struct phys_device_features2_chain { PhysicalDeviceIndexTypeUint8FeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_KHR; PhysicalDeviceInlineUniformBlockFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES; PhysicalDeviceLegacyDitheringFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT; + PhysicalDeviceLegacyVertexAttributesFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT; PhysicalDeviceLineRasterizationFeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_KHR; PhysicalDeviceMaintenance4Features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES; PhysicalDeviceMaintenance5FeaturesKHR.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR; @@ -4409,6 +4431,8 @@ struct phys_device_features2_chain { chain_members.push_back(reinterpret_cast(&PhysicalDeviceInlineUniformBlockFeatures)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LEGACY_DITHERING_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceLegacyDitheringFeaturesEXT)); + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME)) + chain_members.push_back(reinterpret_cast(&PhysicalDeviceLegacyVertexAttributesFeaturesEXT)); if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME) || gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME)) chain_members.push_back(reinterpret_cast(&PhysicalDeviceLineRasterizationFeaturesKHR)); @@ -4926,6 +4950,12 @@ void chain_iterator_phys_device_features2(Printer &p, AppGpu &gpu, void * place) DumpVkPhysicalDeviceLegacyDitheringFeaturesEXT(p, "VkPhysicalDeviceLegacyDitheringFeaturesEXT", *props); p.AddNewline(); } + if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_VERTEX_ATTRIBUTES_FEATURES_EXT && + (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LEGACY_VERTEX_ATTRIBUTES_EXTENSION_NAME))) { + VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT* props = (VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT*)structure; + DumpVkPhysicalDeviceLegacyVertexAttributesFeaturesEXT(p, "VkPhysicalDeviceLegacyVertexAttributesFeaturesEXT", *props); + p.AddNewline(); + } if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_KHR && (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME) || gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_LINE_RASTERIZATION_EXTENSION_NAME))) { VkPhysicalDeviceLineRasterizationFeaturesKHR* props = (VkPhysicalDeviceLineRasterizationFeaturesKHR*)structure; diff --git a/vulkaninfo/vulkaninfo.cpp b/vulkaninfo/vulkaninfo.cpp index 2f484ec39..50094ab55 100644 --- a/vulkaninfo/vulkaninfo.cpp +++ b/vulkaninfo/vulkaninfo.cpp @@ -207,6 +207,10 @@ void DumpSurfaceCapabilities(Printer &p, AppInstance &inst, AppGpu &gpu, AppSurf #ifndef VULKANSC if (err == VK_SUCCESS) { ObjectWrapper present_mode_obj(p, VkPresentModeKHRString(mode)); + + p.PrintKeyValue("minImageCount", surface_caps2.surfaceCapabilities.minImageCount); + p.PrintKeyValue("maxImageCount", surface_caps2.surfaceCapabilities.maxImageCount); + DumpVkSurfacePresentScalingCapabilitiesEXT(p, "VkSurfacePresentScalingCapabilitiesEXT", SurfacePresentScalingCapabilitiesEXT); DumpVkSurfacePresentModeCompatibilityEXT(p, "VkSurfacePresentModeCompatibilityEXT", @@ -712,7 +716,6 @@ void DumpGpuProfileCapabilities(Printer &p, AppGpu &gpu) { #endif // VULKANSC void *place = gpu.props2.pNext; chain_iterator_phys_device_props2(p, gpu.inst, gpu, place); - GetAndDumpHostImageCopyPropertiesEXT(p, gpu); } } {