external/vulkancts/modules/vulkan/image/vktImageTestsUtil.cpp \
external/vulkancts/modules/vulkan/image/vktImageTexture.cpp \
external/vulkancts/modules/vulkan/image/vktImageTranscodingSupportTests.cpp \
+ external/vulkancts/modules/vulkan/imageless_framebuffer/vktImagelessFramebufferTests.cpp \
external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp \
external/vulkancts/modules/vulkan/memory/vktMemoryBindingTests.cpp \
external/vulkancts/modules/vulkan/memory/vktMemoryExternalMemoryHostTests.cpp \
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemWsiSwapchainTests.cpp \
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemYCbCrConversionTests.cpp \
external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp \
+ external/vulkancts/modules/vulkan/query_pool/vktQueryPoolPerformanceTests.cpp \
external/vulkancts/modules/vulkan/query_pool/vktQueryPoolStatisticsTests.cpp \
external/vulkancts/modules/vulkan/query_pool/vktQueryPoolTests.cpp \
external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp \
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmLoopDepLenTests.cpp \
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmPointerParameterTests.cpp \
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmSignedIntCompareTests.cpp \
+ external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmSpirvVersion1p4Tests.cpp \
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmSpirvVersionTests.cpp \
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmTests.cpp \
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmTypeTests.cpp \
$(deqp_dir)/external/vulkancts/modules/vulkan/fragment_ops \
$(deqp_dir)/external/vulkancts/modules/vulkan/geometry \
$(deqp_dir)/external/vulkancts/modules/vulkan/image \
+ $(deqp_dir)/external/vulkancts/modules/vulkan/imageless_framebuffer \
$(deqp_dir)/external/vulkancts/modules/vulkan/memory \
$(deqp_dir)/external/vulkancts/modules/vulkan/memory_model \
$(deqp_dir)/external/vulkancts/modules/vulkan/multiview \
dEQP-VK.spirv_assembly.instruction.compute.spirv_version.1_1_compute
dEQP-VK.spirv_assembly.instruction.compute.spirv_version.1_2_compute
dEQP-VK.spirv_assembly.instruction.compute.spirv_version.1_3_compute
+dEQP-VK.spirv_assembly.instruction.compute.spirv_version.1_4_compute
dEQP-VK.spirv_assembly.instruction.compute.localsize.literal_localsize
dEQP-VK.spirv_assembly.instruction.compute.localsize.literal_and_specid_localsize
dEQP-VK.spirv_assembly.instruction.compute.localsize.specid_localsize
dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_3_tesselation_control
dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_3_geometry
dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_3_fragment
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_vertex
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_tesselation_evaluation
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_tesselation_control
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_geometry
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_fragment
dEQP-VK.spirv_assembly.instruction.graphics.opnop.opnop_vert
dEQP-VK.spirv_assembly.instruction.graphics.opnop.opnop_tessc
dEQP-VK.spirv_assembly.instruction.graphics.opnop.opnop_tesse
dEQP-VK.spirv_assembly.instruction.graphics.spirv_ids_abuse.lots_ids_tesse
dEQP-VK.spirv_assembly.instruction.graphics.spirv_ids_abuse.lots_ids_geom
dEQP-VK.spirv_assembly.instruction.graphics.spirv_ids_abuse.lots_ids_frag
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.different_matrix_layout
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.different_matrix_strides
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.nested_arrays_different_inner_stride
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.nested_arrays_different_outer_stride
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.nested_arrays_different_strides
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.same_array_two_ids
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.same_struct_two_ids
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.ssbo_to_ubo
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.two_arrays_different_stride_1
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.two_arrays_different_stride_2
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.ubo_to_ssbo
dEQP-VK.spirv_assembly.type.scalar.i8.negate_vert
dEQP-VK.spirv_assembly.type.scalar.i8.negate_tessc
dEQP-VK.spirv_assembly.type.scalar.i8.negate_tesse
dEQP-VK.query_pool.statistics_query.reset_before_copy.tes_evaluation_shader_invocations.tes_evaluation_shader_invocations
dEQP-VK.query_pool.statistics_query.reset_before_copy.tes_evaluation_shader_invocations.tes_evaluation_shader_invocations_secondary
dEQP-VK.query_pool.statistics_query.reset_before_copy.tes_evaluation_shader_invocations.tes_evaluation_shader_invocations_secondary_inherited
+dEQP-VK.query_pool.performance_query.enumerate_and_validate_graphic
+dEQP-VK.query_pool.performance_query.enumerate_and_validate_compute
+dEQP-VK.query_pool.performance_query.query_graphic
+dEQP-VK.query_pool.performance_query.query_compute
+dEQP-VK.query_pool.performance_query.multiple_pools_graphic
+dEQP-VK.query_pool.performance_query.multiple_pools_compute
dEQP-VK.draw.simple_draw.simple_draw_triangle_list
dEQP-VK.draw.simple_draw.simple_draw_triangle_strip
dEQP-VK.draw.simple_draw.simple_draw_instanced_triangle_list
dEQP-VK.graphicsfuzz.pow-vec4
dEQP-VK.graphicsfuzz.swizzle-struct-init-min
dEQP-VK.graphicsfuzz.while-inside-switch
+dEQP-VK.imageless_framebuffer.color
+dEQP-VK.imageless_framebuffer.depth_stencil
+dEQP-VK.imageless_framebuffer.color_resolve
+dEQP-VK.imageless_framebuffer.depth_stencil_resolve
+dEQP-VK.imageless_framebuffer.multisubpass
dEQP-VK.transform_feedback.simple.basic_1_256
dEQP-VK.transform_feedback.simple.basic_1_512
dEQP-VK.transform_feedback.simple.basic_1_131072
--- /dev/null
+[require]
+VK_KHR_spirv_1_4
+
+[compute shader spirv]
+; Tests copying column major to row major matrix.
+
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %in_var %out_var
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct1 Block
+OpMemberDecorate %struct1 0 Offset 0
+OpMemberDecorate %struct1 0 ColMajor
+OpMemberDecorate %struct1 0 MatrixStride 16
+OpDecorate %struct2 Block
+OpMemberDecorate %struct2 0 Offset 0
+OpMemberDecorate %struct2 0 RowMajor
+OpMemberDecorate %struct2 0 MatrixStride 16
+OpDecorate %in_var DescriptorSet 0
+OpDecorate %in_var Binding 0
+OpDecorate %out_var DescriptorSet 0
+OpDecorate %out_var Binding 1
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%float4 = OpTypeVector %float 4
+%matrix = OpTypeMatrix %float4 4
+
+%struct1 = OpTypeStruct %matrix
+%ptr_struct1 = OpTypePointer StorageBuffer %struct1
+
+%struct2 = OpTypeStruct %matrix
+%ptr_struct2 = OpTypePointer StorageBuffer %struct2
+
+%in_var = OpVariable %ptr_struct1 StorageBuffer
+%out_var = OpVariable %ptr_struct2 StorageBuffer
+
+%func_ty = OpTypeFunction %void
+%main = OpFunction %void None %func_ty
+%1 = OpLabel
+%in_struct = OpLoad %struct1 %in_var
+%copy = OpCopyLogical %struct2 %in_struct
+OpStore %out_var %copy
+OpReturn
+OpFunctionEnd
+
+[test]
+ssbo 0:0 subdata vec4 0 1 2 3 4
+ssbo 0:0 subdata vec4 16 5 6 7 8
+ssbo 0:0 subdata vec4 32 9 10 11 12
+ssbo 0:0 subdata vec4 48 13 14 15 16
+ssbo 0:1 64
+
+compute entrypoint main
+compute 1 1 1
+
+probe ssbo vec4 0:1 0 == 1 5 9 13
+probe ssbo vec4 0:1 16 == 2 6 10 14
+probe ssbo vec4 0:1 32 == 3 7 11 15
+probe ssbo vec4 0:1 48 == 4 8 12 16
--- /dev/null
+[require]
+VK_KHR_spirv_1_4
+
+[compute shader spirv]
+; Tests copying structs containing a matrix with different matrix strides.
+
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %in_var %out_var
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct1 Block
+OpMemberDecorate %struct1 0 Offset 0
+OpMemberDecorate %struct1 0 ColMajor
+OpMemberDecorate %struct1 0 MatrixStride 16
+OpDecorate %struct2 Block
+OpMemberDecorate %struct2 0 Offset 0
+OpMemberDecorate %struct2 0 ColMajor
+OpMemberDecorate %struct2 0 MatrixStride 32
+OpDecorate %in_var DescriptorSet 0
+OpDecorate %in_var Binding 0
+OpDecorate %out_var DescriptorSet 0
+OpDecorate %out_var Binding 1
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%float4 = OpTypeVector %float 4
+%matrix = OpTypeMatrix %float4 4
+
+%struct1 = OpTypeStruct %matrix
+%ptr_struct1 = OpTypePointer StorageBuffer %struct1
+
+%struct2 = OpTypeStruct %matrix
+%ptr_struct2 = OpTypePointer StorageBuffer %struct2
+
+%in_var = OpVariable %ptr_struct1 StorageBuffer
+%out_var = OpVariable %ptr_struct2 StorageBuffer
+
+%func_ty = OpTypeFunction %void
+%main = OpFunction %void None %func_ty
+%1 = OpLabel
+%in_struct = OpLoad %struct1 %in_var
+%copy = OpCopyLogical %struct2 %in_struct
+OpStore %out_var %copy
+OpReturn
+OpFunctionEnd
+
+[test]
+ssbo 0:0 subdata vec4 0 1 2 3 4
+ssbo 0:0 subdata vec4 16 5 6 7 8
+ssbo 0:0 subdata vec4 32 9 10 11 12
+ssbo 0:0 subdata vec4 48 13 14 15 16
+ssbo 0:1 128
+
+compute entrypoint main
+compute 1 1 1
+
+probe ssbo vec4 0:1 0 == 1 2 3 4
+probe ssbo vec4 0:1 32 == 5 6 7 8
+probe ssbo vec4 0:1 64 == 9 10 11 12
+probe ssbo vec4 0:1 96 == 13 14 15 16
--- /dev/null
+[require]
+VK_KHR_spirv_1_4
+
+[compute shader spirv]
+; Tests copying two nested arrays with different inner array strides.
+
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %in_var %out_var
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct_stride_4 Block
+OpMemberDecorate %struct_stride_4 0 Offset 0
+OpDecorate %struct_stride_8 Block
+OpMemberDecorate %struct_stride_8 0 Offset 0
+OpDecorate %in_var DescriptorSet 0
+OpDecorate %in_var Binding 0
+OpDecorate %out_var DescriptorSet 0
+OpDecorate %out_var Binding 1
+OpDecorate %float_array_32_stride_4 ArrayStride 4
+OpDecorate %float_array_32_stride_8 ArrayStride 8
+OpDecorate %array_array_stride_4 ArrayStride 256
+OpDecorate %array_array_stride_8 ArrayStride 256
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_8 = OpConstant %uint 8
+%uint_32 = OpConstant %uint 32
+
+%float_array_32_stride_4 = OpTypeArray %float %uint_32
+%array_array_stride_4 = OpTypeArray %float_array_32_stride_4 %uint_8
+%ptr_array_array_stride_4 = OpTypePointer StorageBuffer %array_array_stride_4
+%struct_stride_4 = OpTypeStruct %array_array_stride_4
+%ptr_struct_stride_4 = OpTypePointer StorageBuffer %struct_stride_4
+
+%float_array_32_stride_8 = OpTypeArray %float %uint_32
+%array_array_stride_8 = OpTypeArray %float_array_32_stride_8 %uint_8
+%ptr_array_array_stride_8 = OpTypePointer StorageBuffer %array_array_stride_8
+%struct_stride_8 = OpTypeStruct %array_array_stride_8
+%ptr_struct_stride_8 = OpTypePointer StorageBuffer %struct_stride_8
+
+%in_var = OpVariable %ptr_struct_stride_4 StorageBuffer
+%out_var = OpVariable %ptr_struct_stride_8 StorageBuffer
+
+%func_ty = OpTypeFunction %void
+%main = OpFunction %void None %func_ty
+%1 = OpLabel
+%in_gep = OpAccessChain %ptr_array_array_stride_4 %in_var %uint_0
+%in_array = OpLoad %array_array_stride_4 %in_gep
+%copy = OpCopyLogical %array_array_stride_8 %in_array
+%out_gep = OpAccessChain %ptr_array_array_stride_8 %out_var %uint_0
+OpStore %out_gep %copy
+OpReturn
+OpFunctionEnd
+
+[test]
+ssbo 0:0 subdata float 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 256 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 512 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 768 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 1024 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 1280 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 1536 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 1792 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:1 subdata float 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 256 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 512 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 768 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 1024 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 1280 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 1536 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 1792 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+
+compute entrypoint main
+compute 1 1 1
+
+probe ssbo float 0:1 0 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 256 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 512 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 768 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 1024 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 1280 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 1536 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 1792 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
--- /dev/null
+[require]
+VK_KHR_spirv_1_4
+
+[compute shader spirv]
+; Tests copying nested arrays with differing outer array strides.
+
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %in_var %out_var
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct_stride_4 Block
+OpMemberDecorate %struct_stride_4 0 Offset 0
+OpDecorate %struct_stride_8 Block
+OpMemberDecorate %struct_stride_8 0 Offset 0
+OpDecorate %in_var DescriptorSet 0
+OpDecorate %in_var Binding 0
+OpDecorate %out_var DescriptorSet 0
+OpDecorate %out_var Binding 1
+OpDecorate %float_array_32_stride_4 ArrayStride 4
+OpDecorate %float_array_32_stride_8 ArrayStride 4 ;; for ease this ID is odd
+OpDecorate %array_array_stride_4 ArrayStride 128
+OpDecorate %array_array_stride_8 ArrayStride 256
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_8 = OpConstant %uint 8
+%uint_32 = OpConstant %uint 32
+
+%float_array_32_stride_4 = OpTypeArray %float %uint_32
+%array_array_stride_4 = OpTypeArray %float_array_32_stride_4 %uint_8
+%ptr_array_array_stride_4 = OpTypePointer StorageBuffer %array_array_stride_4
+%struct_stride_4 = OpTypeStruct %array_array_stride_4
+%ptr_struct_stride_4 = OpTypePointer StorageBuffer %struct_stride_4
+
+%float_array_32_stride_8 = OpTypeArray %float %uint_32
+%array_array_stride_8 = OpTypeArray %float_array_32_stride_4 %uint_8
+%ptr_array_array_stride_8 = OpTypePointer StorageBuffer %array_array_stride_8
+%struct_stride_8 = OpTypeStruct %array_array_stride_8
+%ptr_struct_stride_8 = OpTypePointer StorageBuffer %struct_stride_8
+
+%in_var = OpVariable %ptr_struct_stride_4 StorageBuffer
+%out_var = OpVariable %ptr_struct_stride_8 StorageBuffer
+
+%func_ty = OpTypeFunction %void
+%main = OpFunction %void None %func_ty
+%1 = OpLabel
+%in_gep = OpAccessChain %ptr_array_array_stride_4 %in_var %uint_0
+%in_array = OpLoad %array_array_stride_4 %in_gep
+%copy = OpCopyLogical %array_array_stride_8 %in_array
+%out_gep = OpAccessChain %ptr_array_array_stride_8 %out_var %uint_0
+OpStore %out_gep %copy
+OpReturn
+OpFunctionEnd
+
+[test]
+ssbo 0:0 subdata float 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 128 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 256 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 384 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 512 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 640 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 768 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 896 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:1 2048
+
+compute entrypoint main
+compute 1 1 1
+
+probe ssbo float 0:1 0 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+probe ssbo float 0:1 256 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+probe ssbo float 0:1 512 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+probe ssbo float 0:1 768 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+probe ssbo float 0:1 1024 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+probe ssbo float 0:1 1280 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+probe ssbo float 0:1 1536 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+probe ssbo float 0:1 1792 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
--- /dev/null
+[require]
+VK_KHR_spirv_1_4
+
+[compute shader spirv]
+; Tests copying nested arrays with differing inner and outer array strides.
+
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %in_var %out_var
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct_stride_4 Block
+OpMemberDecorate %struct_stride_4 0 Offset 0
+OpDecorate %struct_stride_8 Block
+OpMemberDecorate %struct_stride_8 0 Offset 0
+OpDecorate %in_var DescriptorSet 0
+OpDecorate %in_var Binding 0
+OpDecorate %out_var DescriptorSet 0
+OpDecorate %out_var Binding 1
+OpDecorate %float_array_32_stride_4 ArrayStride 4
+OpDecorate %float_array_32_stride_8 ArrayStride 8
+OpDecorate %array_array_stride_4 ArrayStride 128
+OpDecorate %array_array_stride_8 ArrayStride 256
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_8 = OpConstant %uint 8
+%uint_32 = OpConstant %uint 32
+
+%float_array_32_stride_4 = OpTypeArray %float %uint_32
+%array_array_stride_4 = OpTypeArray %float_array_32_stride_4 %uint_8
+%ptr_array_array_stride_4 = OpTypePointer StorageBuffer %array_array_stride_4
+%struct_stride_4 = OpTypeStruct %array_array_stride_4
+%ptr_struct_stride_4 = OpTypePointer StorageBuffer %struct_stride_4
+
+%float_array_32_stride_8 = OpTypeArray %float %uint_32
+%array_array_stride_8 = OpTypeArray %float_array_32_stride_8 %uint_8
+%ptr_array_array_stride_8 = OpTypePointer StorageBuffer %array_array_stride_8
+%struct_stride_8 = OpTypeStruct %array_array_stride_8
+%ptr_struct_stride_8 = OpTypePointer StorageBuffer %struct_stride_8
+
+%in_var = OpVariable %ptr_struct_stride_4 StorageBuffer
+%out_var = OpVariable %ptr_struct_stride_8 StorageBuffer
+
+%func_ty = OpTypeFunction %void
+%main = OpFunction %void None %func_ty
+%1 = OpLabel
+%in_gep = OpAccessChain %ptr_array_array_stride_4 %in_var %uint_0
+%in_array = OpLoad %array_array_stride_4 %in_gep
+%copy = OpCopyLogical %array_array_stride_8 %in_array
+%out_gep = OpAccessChain %ptr_array_array_stride_8 %out_var %uint_0
+OpStore %out_gep %copy
+OpReturn
+OpFunctionEnd
+
+[test]
+ssbo 0:0 subdata float 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 128 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 256 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 384 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 512 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 640 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 768 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:0 subdata float 896 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:1 subdata float 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 256 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 512 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 768 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 1024 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 1280 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 1536 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ssbo 0:1 subdata float 1792 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+
+compute entrypoint main
+compute 1 1 1
+
+probe ssbo float 0:1 0 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 256 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 512 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 768 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 1024 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 1280 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 1536 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+probe ssbo float 0:1 1792 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
--- /dev/null
+[require]
+VK_KHR_spirv_1_4
+
+[compute shader spirv]
+; Tests copy of same structural array given two IDs.
+
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %in_var %out_var
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct1 Block
+OpMemberDecorate %struct1 0 Offset 0
+OpDecorate %struct2 Block
+OpMemberDecorate %struct2 0 Offset 0
+OpDecorate %in_var DescriptorSet 0
+OpDecorate %in_var Binding 0
+OpDecorate %out_var DescriptorSet 0
+OpDecorate %out_var Binding 1
+OpDecorate %float_array1 ArrayStride 4
+OpDecorate %float_array2 ArrayStride 4
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_32 = OpConstant %uint 32
+
+%float_array1 = OpTypeArray %float %uint_32
+%ptr_float_array1 = OpTypePointer StorageBuffer %float_array1
+%struct1 = OpTypeStruct %float_array1
+%ptr_struct1 = OpTypePointer StorageBuffer %struct1
+
+%float_array2 = OpTypeArray %float %uint_32
+%ptr_float_array2 = OpTypePointer StorageBuffer %float_array2
+%struct2 = OpTypeStruct %float_array2
+%ptr_struct2 = OpTypePointer StorageBuffer %struct2
+
+%in_var = OpVariable %ptr_struct1 StorageBuffer
+%out_var = OpVariable %ptr_struct2 StorageBuffer
+
+%func_ty = OpTypeFunction %void
+%main = OpFunction %void None %func_ty
+%1 = OpLabel
+%in_gep = OpAccessChain %ptr_float_array1 %in_var %uint_0
+%in_array = OpLoad %float_array1 %in_gep
+%copy = OpCopyLogical %float_array2 %in_array
+%out_gep = OpAccessChain %ptr_float_array2 %out_var %uint_0
+OpStore %out_gep %copy
+OpReturn
+OpFunctionEnd
+
+[test]
+ssbo 0:0 subdata float 0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0
+ssbo 0:1 128
+
+compute entrypoint main
+compute 1 1 1
+
+probe ssbo float 0:1 0 == 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0 30.0 31.0 32.0
--- /dev/null
+[require]
+VK_KHR_spirv_1_4
+
+[compute shader spirv]
+; Tests copying same structural struct with different IDs.
+
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %in_var %out_var
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct1 Block
+OpMemberDecorate %struct1 0 Offset 0
+OpMemberDecorate %struct1 1 Offset 4
+OpMemberDecorate %struct1 2 Offset 8
+OpMemberDecorate %struct1 3 Offset 12
+OpDecorate %struct2 Block
+OpMemberDecorate %struct2 0 Offset 0
+OpMemberDecorate %struct2 1 Offset 4
+OpMemberDecorate %struct2 2 Offset 8
+OpMemberDecorate %struct2 3 Offset 12
+OpDecorate %in_var DescriptorSet 0
+OpDecorate %in_var Binding 0
+OpDecorate %out_var DescriptorSet 0
+OpDecorate %out_var Binding 1
+%void = OpTypeVoid
+%int = OpTypeInt 32 0
+
+%struct1 = OpTypeStruct %int %int %int %int
+%ptr_struct1 = OpTypePointer Uniform %struct1
+
+%struct2 = OpTypeStruct %int %int %int %int
+%ptr_struct2 = OpTypePointer StorageBuffer %struct2
+
+%in_var = OpVariable %ptr_struct1 Uniform
+%out_var = OpVariable %ptr_struct2 StorageBuffer
+
+%func_ty = OpTypeFunction %void
+%main = OpFunction %void None %func_ty
+%1 = OpLabel
+%in_struct = OpLoad %struct1 %in_var
+%copy = OpCopyLogical %struct2 %in_struct
+OpStore %out_var %copy
+OpReturn
+OpFunctionEnd
+
+[test]
+uniform ubo 0:0 uvec4 0 1 2 3 4
+ssbo 0:1 subdata uvec4 0 8 8 8 8
+
+compute entrypoint main
+compute 1 1 1
+
+probe ssbo uvec4 0:1 0 == 1 2 3 4
--- /dev/null
+[require]
+VK_KHR_spirv_1_4
+
+[compute shader spirv]
+; Tests converting from SSBO layout to UBO layout.
+
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %in_var %out_var
+OpExecutionMode %main LocalSize 1 1 1
+
+OpDecorate %struct1 Block
+OpMemberDecorate %struct1 0 Offset 0
+OpMemberDecorate %struct1 1 Offset 16
+OpMemberDecorate %struct1 2 Offset 48
+OpMemberDecorate %struct1 3 Offset 64
+OpMemberDecorate %struct1 4 Offset 80
+OpMemberDecorate %struct1 5 Offset 96
+OpMemberDecorate %struct1 6 Offset 112
+
+OpDecorate %struct2 Block
+OpMemberDecorate %struct2 0 Offset 0
+OpMemberDecorate %struct2 1 Offset 4
+OpMemberDecorate %struct2 2 Offset 12
+OpMemberDecorate %struct2 3 Offset 16
+OpMemberDecorate %struct2 4 Offset 32
+OpMemberDecorate %struct2 5 Offset 48
+OpMemberDecorate %struct2 6 Offset 64
+
+OpDecorate %in_var DescriptorSet 0
+OpDecorate %in_var Binding 0
+OpDecorate %out_var DescriptorSet 0
+OpDecorate %out_var Binding 1
+
+OpDecorate %int_array_2_stride_4 ArrayStride 4
+OpDecorate %int_array_2_stride_16 ArrayStride 16
+OpMemberDecorate %int_struct1 0 Offset 4
+OpMemberDecorate %int_struct2 0 Offset 8
+
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%float2 = OpTypeVector %float 2
+%float3 = OpTypeVector %float 3
+%float4 = OpTypeVector %float 4
+%matrix = OpTypeMatrix %float4 4
+%int = OpTypeInt 32 0
+%int_2 = OpConstant %int 2
+%int_array_2_stride_4 = OpTypeArray %int %int_2
+%int_array_2_stride_16 = OpTypeArray %int %int_2
+%int_struct1 = OpTypeStruct %int
+%int_struct2 = OpTypeStruct %int
+
+%struct1 = OpTypeStruct %int %int_array_2_stride_16 %int %int_struct1 %float4 %float3 %float2
+%ptr_struct1 = OpTypePointer StorageBuffer %struct1
+
+%struct2 = OpTypeStruct %int %int_array_2_stride_4 %int %int_struct2 %float4 %float3 %float2
+%ptr_struct2 = OpTypePointer StorageBuffer %struct2
+
+%in_var = OpVariable %ptr_struct2 StorageBuffer
+%out_var = OpVariable %ptr_struct1 StorageBuffer
+
+%func_ty = OpTypeFunction %void
+%main = OpFunction %void None %func_ty
+%1 = OpLabel
+%in_struct = OpLoad %struct2 %in_var
+%copy = OpCopyLogical %struct1 %in_struct
+OpStore %out_var %copy
+OpReturn
+OpFunctionEnd
+
+[test]
+ssbo 0:0 subdata uint 0 1
+ssbo 0:0 subdata uint 4 2 3
+ssbo 0:0 subdata uint 12 4
+ssbo 0:0 subdata uint 24 5
+# Really vec4
+ssbo 0:0 subdata uint 32 6 7 8 9
+# Really vec3
+ssbo 0:0 subdata uint 48 10 11 12
+# Really vec2
+ssbo 0:0 subdata uint 64 13 14
+ssbo 0:1 128
+
+compute entrypoint main
+compute 1 1 1
+
+probe ssbo uint 0:1 0 == 1
+probe ssbo uint 0:1 16 == 2
+probe ssbo uint 0:1 32 == 3
+probe ssbo uint 0:1 48 == 4
+probe ssbo uint 0:1 68 == 5
+probe ssbo uint 0:1 80 == 6 7 8 9
+probe ssbo uint 0:1 96 == 10 11 12
+probe ssbo uint 0:1 112 == 13 14
--- /dev/null
+[require]
+VK_KHR_spirv_1_4
+
+[compute shader spirv]
+; Tests copying smaller array stride to larger array stride.
+
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %in_var %out_var
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct_stride_4 Block
+OpMemberDecorate %struct_stride_4 0 Offset 0
+OpDecorate %struct_stride_8 Block
+OpMemberDecorate %struct_stride_8 0 Offset 0
+OpDecorate %in_var DescriptorSet 0
+OpDecorate %in_var Binding 0
+OpDecorate %out_var DescriptorSet 0
+OpDecorate %out_var Binding 1
+OpDecorate %float_array_32_stride_4 ArrayStride 4
+OpDecorate %float_array_32_stride_8 ArrayStride 8
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_32 = OpConstant %uint 32
+
+%float_array_32_stride_4 = OpTypeArray %float %uint_32
+%ptr_float_array_32_stride_4 = OpTypePointer StorageBuffer %float_array_32_stride_4
+%struct_stride_4 = OpTypeStruct %float_array_32_stride_4
+%ptr_struct_stride_4 = OpTypePointer StorageBuffer %struct_stride_4
+
+%float_array_32_stride_8 = OpTypeArray %float %uint_32
+%ptr_float_array_32_stride_8 = OpTypePointer StorageBuffer %float_array_32_stride_8
+%struct_stride_8 = OpTypeStruct %float_array_32_stride_8
+%ptr_struct_stride_8 = OpTypePointer StorageBuffer %struct_stride_8
+
+%in_var = OpVariable %ptr_struct_stride_4 StorageBuffer
+%out_var = OpVariable %ptr_struct_stride_8 StorageBuffer
+
+%func_ty = OpTypeFunction %void
+%main = OpFunction %void None %func_ty
+%1 = OpLabel
+%in_gep = OpAccessChain %ptr_float_array_32_stride_4 %in_var %uint_0
+%in_array = OpLoad %float_array_32_stride_4 %in_gep
+%copy = OpCopyLogical %float_array_32_stride_8 %in_array
+%out_gep = OpAccessChain %ptr_float_array_32_stride_8 %out_var %uint_0
+OpStore %out_gep %copy
+OpReturn
+OpFunctionEnd
+
+[test]
+ssbo 0:0 subdata float 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
+ssbo 0:1 subdata float 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+
+compute entrypoint main
+compute 1 1 1
+
+probe ssbo float 0:1 0 == 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
--- /dev/null
+[require]
+VK_KHR_spirv_1_4
+
+[compute shader spirv]
+; Tests copying larger array stride to smaller array stride.
+
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %in_var %out_var
+OpExecutionMode %main LocalSize 1 1 1
+OpDecorate %struct_stride_4 Block
+OpMemberDecorate %struct_stride_4 0 Offset 0
+OpDecorate %struct_stride_8 Block
+OpMemberDecorate %struct_stride_8 0 Offset 0
+OpDecorate %in_var DescriptorSet 0
+OpDecorate %in_var Binding 0
+OpDecorate %out_var DescriptorSet 0
+OpDecorate %out_var Binding 1
+OpDecorate %float_array_32_stride_4 ArrayStride 4
+OpDecorate %float_array_32_stride_8 ArrayStride 8
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_32 = OpConstant %uint 32
+
+%float_array_32_stride_4 = OpTypeArray %float %uint_32
+%ptr_float_array_32_stride_4 = OpTypePointer StorageBuffer %float_array_32_stride_4
+%struct_stride_4 = OpTypeStruct %float_array_32_stride_4
+%ptr_struct_stride_4 = OpTypePointer StorageBuffer %struct_stride_4
+
+%float_array_32_stride_8 = OpTypeArray %float %uint_32
+%ptr_float_array_32_stride_8 = OpTypePointer StorageBuffer %float_array_32_stride_8
+%struct_stride_8 = OpTypeStruct %float_array_32_stride_8
+%ptr_struct_stride_8 = OpTypePointer StorageBuffer %struct_stride_8
+
+%in_var = OpVariable %ptr_struct_stride_8 StorageBuffer
+%out_var = OpVariable %ptr_struct_stride_4 StorageBuffer
+
+%func_ty = OpTypeFunction %void
+%main = OpFunction %void None %func_ty
+%1 = OpLabel
+%in_gep = OpAccessChain %ptr_float_array_32_stride_8 %in_var %uint_0
+%in_array = OpLoad %float_array_32_stride_8 %in_gep
+%copy = OpCopyLogical %float_array_32_stride_4 %in_array
+%out_gep = OpAccessChain %ptr_float_array_32_stride_4 %out_var %uint_0
+OpStore %out_gep %copy
+OpReturn
+OpFunctionEnd
+
+[test]
+ssbo 0:0 subdata float 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0
+ssbo 0:1 128
+
+compute entrypoint main
+compute 1 1 1
+
+probe ssbo float 0:1 0 == 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
--- /dev/null
+[require]
+VK_KHR_spirv_1_4
+
+[compute shader spirv]
+; Tests conversion from UBO layout to SSBO layout.
+
+OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint GLCompute %main "main" %in_var %out_var
+OpExecutionMode %main LocalSize 1 1 1
+
+OpDecorate %struct1 Block
+OpMemberDecorate %struct1 0 Offset 0
+OpMemberDecorate %struct1 1 Offset 16
+OpMemberDecorate %struct1 2 Offset 48
+OpMemberDecorate %struct1 3 Offset 64
+OpMemberDecorate %struct1 4 Offset 80
+OpMemberDecorate %struct1 5 Offset 96
+OpMemberDecorate %struct1 6 Offset 112
+
+OpDecorate %struct2 Block
+OpMemberDecorate %struct2 0 Offset 0
+OpMemberDecorate %struct2 1 Offset 4
+OpMemberDecorate %struct2 2 Offset 12
+OpMemberDecorate %struct2 3 Offset 16
+OpMemberDecorate %struct2 4 Offset 32
+OpMemberDecorate %struct2 5 Offset 48
+OpMemberDecorate %struct2 6 Offset 64
+
+OpDecorate %in_var DescriptorSet 0
+OpDecorate %in_var Binding 0
+OpDecorate %out_var DescriptorSet 0
+OpDecorate %out_var Binding 1
+
+OpDecorate %int_array_2_stride_4 ArrayStride 4
+OpDecorate %int_array_2_stride_16 ArrayStride 16
+OpMemberDecorate %int_struct1 0 Offset 4
+OpMemberDecorate %int_struct2 0 Offset 8
+
+%void = OpTypeVoid
+%float = OpTypeFloat 32
+%float2 = OpTypeVector %float 2
+%float3 = OpTypeVector %float 3
+%float4 = OpTypeVector %float 4
+%matrix = OpTypeMatrix %float4 4
+%int = OpTypeInt 32 0
+%int_2 = OpConstant %int 2
+%int_array_2_stride_4 = OpTypeArray %int %int_2
+%int_array_2_stride_16 = OpTypeArray %int %int_2
+%int_struct1 = OpTypeStruct %int
+%int_struct2 = OpTypeStruct %int
+
+%struct1 = OpTypeStruct %int %int_array_2_stride_16 %int %int_struct1 %float4 %float3 %float2
+%ptr_struct1 = OpTypePointer Uniform %struct1
+
+%struct2 = OpTypeStruct %int %int_array_2_stride_4 %int %int_struct2 %float4 %float3 %float2
+%ptr_struct2 = OpTypePointer StorageBuffer %struct2
+
+%in_var = OpVariable %ptr_struct1 Uniform
+%out_var = OpVariable %ptr_struct2 StorageBuffer
+
+%func_ty = OpTypeFunction %void
+%main = OpFunction %void None %func_ty
+%1 = OpLabel
+%in_struct = OpLoad %struct1 %in_var
+%copy = OpCopyLogical %struct2 %in_struct
+OpStore %out_var %copy
+OpReturn
+OpFunctionEnd
+
+[test]
+# Really uint
+uniform ubo 0:0 uint 0 1
+uniform ubo 0:0 uint 16 2
+uniform ubo 0:0 uint 32 3
+uniform ubo 0:0 uint 48 4
+uniform ubo 0:0 uint 68 5
+# Really vec4
+uniform ubo 0:0 uint 80 6 7 8 9
+# Really vec3
+uniform ubo 0:0 uint 96 10 11 12
+# Really vec2
+uniform ubo 0:0 uint 112 13 14
+ssbo 0:1 72
+
+compute entrypoint main
+compute 1 1 1
+
+probe ssbo uint 0:1 0 == 1
+probe ssbo uint 0:1 4 == 2
+probe ssbo uint 0:1 8 == 3
+probe ssbo uint 0:1 12 == 4
+probe ssbo uint 0:1 24 == 5
+probe ssbo uint 0:1 32 == 6 7 8 9
+probe ssbo uint 0:1 48 == 10 11 12
+probe ssbo uint 0:1 64 == 13 14
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT = 1000102000,
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT = 1000102001,
VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR = 1000108000,
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR = 1000108001,
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR = 1000108002,
+ VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR = 1000108003,
VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR = 1000109000,
VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR = 1000109001,
VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR = 1000109002,
VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR = 1000114002,
VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR = 1000115000,
VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR = 1000115001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_FEATURES_KHR = 1000116000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_PROPERTIES_KHR = 1000116001,
+ VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_CREATE_INFO_KHR = 1000116002,
+ VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR = 1000116003,
+ VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR = 1000116004,
+ VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR = 1000116005,
+ VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR = 1000116006,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = 1000119000,
VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001,
VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002,
VK_QUERY_TYPE_PIPELINE_STATISTICS = 1,
VK_QUERY_TYPE_TIMESTAMP = 2,
VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT = 1000028004,
+ VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR = 1000116000,
VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV = 1000165000,
VK_QUERY_TYPE_MAX_ENUM = 0x7FFFFFFF,
};
VK_PRESENT_MODE_MAX_ENUM_KHR = 0x7FFFFFFF,
};
+enum VkPerformanceCounterUnitKHR
+{
+ VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR = 0,
+ VK_PERFORMANCE_COUNTER_UNIT_PERCENTAGE_KHR = 1,
+ VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR = 2,
+ VK_PERFORMANCE_COUNTER_UNIT_BYTES_KHR = 3,
+ VK_PERFORMANCE_COUNTER_UNIT_BYTES_PER_SECOND_KHR = 4,
+ VK_PERFORMANCE_COUNTER_UNIT_KELVIN_KHR = 5,
+ VK_PERFORMANCE_COUNTER_UNIT_WATTS_KHR = 6,
+ VK_PERFORMANCE_COUNTER_UNIT_VOLTS_KHR = 7,
+ VK_PERFORMANCE_COUNTER_UNIT_AMPS_KHR = 8,
+ VK_PERFORMANCE_COUNTER_UNIT_HERTZ_KHR = 9,
+ VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR = 10,
+ VK_PERFORMANCE_COUNTER_UNIT_KHR_LAST,
+ VK_PERFORMANCE_COUNTER_UNIT_MAX_ENUM_KHR = 0x7FFFFFFF,
+};
+
+enum VkPerformanceCounterScopeKHR
+{
+ VK_QUERY_SCOPE_COMMAND_BUFFER_KHR = 0,
+ VK_QUERY_SCOPE_RENDER_PASS_KHR = 1,
+ VK_QUERY_SCOPE_COMMAND_KHR = 2,
+ VK_PERFORMANCE_COUNTER_SCOPE_KHR_LAST,
+ VK_PERFORMANCE_COUNTER_SCOPE_MAX_ENUM_KHR = 0x7FFFFFFF,
+};
+
+enum VkPerformanceCounterStorageKHR
+{
+ VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR = 0,
+ VK_PERFORMANCE_COUNTER_STORAGE_INT64_KHR = 1,
+ VK_PERFORMANCE_COUNTER_STORAGE_UINT32_KHR = 2,
+ VK_PERFORMANCE_COUNTER_STORAGE_UINT64_KHR = 3,
+ VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR = 4,
+ VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR = 5,
+ VK_PERFORMANCE_COUNTER_STORAGE_KHR_LAST,
+ VK_PERFORMANCE_COUNTER_STORAGE_MAX_ENUM_KHR = 0x7FFFFFFF,
+};
+
enum VkDriverIdKHR
{
VK_DRIVER_ID_AMD_PROPRIETARY_KHR = 1,
};
typedef deUint32 VkDescriptorPoolCreateFlags;
+enum VkFramebufferCreateFlagBits
+{
+ VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR = 0x00000001,
+ VK_FRAMEBUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF,
+};
+typedef deUint32 VkFramebufferCreateFlags;
+
enum VkAttachmentDescriptionFlagBits
{
VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001,
};
typedef deUint32 VkDisplayPlaneAlphaFlagsKHR;
+enum VkPerformanceCounterDescriptionFlagBitsKHR
+{
+ VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_KHR = 0x00000001,
+ VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_KHR = 0x00000002,
+ VK_PERFORMANCE_COUNTER_DESCRIPTION_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF,
+};
+typedef deUint32 VkPerformanceCounterDescriptionFlagsKHR;
+
enum VkResolveModeFlagBitsKHR
{
VK_RESOLVE_MODE_NONE_KHR = 0,
typedef deUint32 VkDescriptorPoolResetFlags;
-typedef deUint32 VkFramebufferCreateFlags;
-
typedef deUint32 VkRenderPassCreateFlags;
typedef deUint32 VkCommandPoolTrimFlags;
typedef deUint32 VkDisplaySurfaceCreateFlagsKHR;
+typedef deUint32 VkAcquireProfilingLockFlagsKHR;
+
typedef deUint32 VkPipelineRasterizationStateStreamCreateFlagsEXT;
typedef deUint32 VkPipelineViewportSwizzleStateCreateFlagsNV;
#define VK_KHR_16BIT_STORAGE_SPEC_VERSION 1
#define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1
#define VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_SPEC_VERSION 1
+#define VK_KHR_IMAGELESS_FRAMEBUFFER_SPEC_VERSION 1
#define VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME "VK_KHR_create_renderpass2"
#define VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_FENCE_CAPABILITIES_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_FENCE_SPEC_VERSION 1
#define VK_KHR_EXTERNAL_FENCE_FD_SPEC_VERSION 1
+#define VK_KHR_PERFORMANCE_QUERY_SPEC_VERSION 1
#define VK_KHR_MAINTENANCE2_SPEC_VERSION 1
#define VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME "VK_KHR_get_surface_capabilities2"
#define VK_KHR_VARIABLE_POINTERS_SPEC_VERSION 1
const VkRect2D& renderArea,
const deUint32 clearValueCount,
const VkClearValue* clearValues,
- const VkSubpassContents contents)
+ const VkSubpassContents contents,
+ const void* pNext)
{
const VkRenderPassBeginInfo renderPassBeginInfo =
{
VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, // VkStructureType sType;
- DE_NULL, // const void* pNext;
+ pNext, // const void* pNext;
renderPass, // VkRenderPass renderPass;
framebuffer, // VkFramebuffer framebuffer;
renderArea, // VkRect2D renderArea;
const VkRenderPass renderPass,
const VkFramebuffer framebuffer,
const VkRect2D& renderArea,
+ const tcu::Vec4& clearColor,
+ const void* pNext,
+ const VkSubpassContents contents)
+{
+ const VkClearValue clearValue = makeClearValueColor(clearColor);
+
+ beginRenderPass(vk, commandBuffer, renderPass, framebuffer, renderArea, 1u, &clearValue, contents, pNext);
+}
+
+void beginRenderPass (const DeviceInterface& vk,
+ const VkCommandBuffer commandBuffer,
+ const VkRenderPass renderPass,
+ const VkFramebuffer framebuffer,
+ const VkRect2D& renderArea,
+ const tcu::Vec4& clearColor,
+ const float clearDepth,
+ const deUint32 clearStencil,
+ const void* pNext,
+ const VkSubpassContents contents)
+{
+ const VkClearValue clearValues[] =
+ {
+ makeClearValueColor(clearColor), // attachment 0
+ makeClearValueDepthStencil(clearDepth, clearStencil), // attachment 1
+ };
+
+ beginRenderPass(vk, commandBuffer, renderPass, framebuffer, renderArea, DE_LENGTH_OF_ARRAY(clearValues), clearValues, contents, pNext);
+}
+
+void beginRenderPass (const DeviceInterface& vk,
+ const VkCommandBuffer commandBuffer,
+ const VkRenderPass renderPass,
+ const VkFramebuffer framebuffer,
+ const VkRect2D& renderArea,
const tcu::UVec4& clearColor,
const VkSubpassContents contents)
{
const VkRect2D& renderArea,
const deUint32 clearValueCount,
const VkClearValue* clearValues,
- const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE);
+ const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE,
+ const void* pNext = DE_NULL);
void beginRenderPass (const DeviceInterface& vk,
const VkCommandBuffer commandBuffer,
const VkRenderPass renderPass,
const VkFramebuffer framebuffer,
const VkRect2D& renderArea,
+ const tcu::Vec4& clearColor,
+ const void* pNext,
+ const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE);
+
+void beginRenderPass (const DeviceInterface& vk,
+ const VkCommandBuffer commandBuffer,
+ const VkRenderPass renderPass,
+ const VkFramebuffer framebuffer,
+ const VkRect2D& renderArea,
+ const tcu::Vec4& clearColor,
+ const float clearDepth,
+ const deUint32 clearStencil,
+ const void* pNext,
+ const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE);
+
+void beginRenderPass (const DeviceInterface& vk,
+ const VkCommandBuffer commandBuffer,
+ const VkRenderPass renderPass,
+ const VkFramebuffer framebuffer,
+ const VkRect2D& renderArea,
const tcu::UVec4& clearColor,
const VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE);
virtual VkResult getSwapchainStatusKHR (VkDevice device, VkSwapchainKHR swapchain) const;
virtual VkResult importFenceFdKHR (VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo) const;
virtual VkResult getFenceFdKHR (VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd) const;
+virtual VkResult acquireProfilingLockKHR (VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo) const;
+virtual void releaseProfilingLockKHR (VkDevice device) const;
virtual void cmdDrawIndirectCountKHR (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, deUint32 maxDrawCount, deUint32 stride) const;
virtual void cmdDrawIndexedIndirectCountKHR (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, deUint32 maxDrawCount, deUint32 stride) const;
virtual VkResult debugMarkerSetObjectTagEXT (VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo) const;
virtual VkResult createDisplayModeKHR (VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode) const;
virtual VkResult getDisplayPlaneCapabilitiesKHR (VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, deUint32 planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities) const;
virtual VkResult createDisplayPlaneSurfaceKHR (VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const;
+virtual void enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) const;
+virtual void getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR (VkPhysicalDevice physicalDevice, const VkPerformanceQueryCreateInfoKHR* pPerformanceQueryCreateInfo, deUint32* pNumPasses) const;
virtual VkResult getPhysicalDeviceSurfaceCapabilities2KHR (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities) const;
virtual VkResult getPhysicalDeviceSurfaceFormats2KHR (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, deUint32* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats) const;
virtual VkResult getPhysicalDeviceDisplayProperties2KHR (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayProperties2KHR* pProperties) const;
SPIRV_VERSION_1_1 = 1, //!< SPIR-V 1.1
SPIRV_VERSION_1_2 = 2, //!< SPIR-V 1.2
SPIRV_VERSION_1_3 = 3, //!< SPIR-V 1.3
+ SPIRV_VERSION_1_4 = 4, //!< SPIR-V 1.4
SPIRV_VERSION_LAST
};
return m_vk.getFenceFdKHR(device, pGetFdInfo, pFd);
}
+VkResult DeviceDriver::acquireProfilingLockKHR (VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo) const
+{
+ return m_vk.acquireProfilingLockKHR(device, pInfo);
+}
+
+void DeviceDriver::releaseProfilingLockKHR (VkDevice device) const
+{
+ m_vk.releaseProfilingLockKHR(device);
+}
+
void DeviceDriver::cmdDrawIndirectCountKHR (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, deUint32 maxDrawCount, deUint32 stride) const
{
m_vk.cmdDrawIndirectCountKHR(commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride);
#define VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME "VK_EXT_conditional_rendering"
#define VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME "VK_KHR_shader_float16_int8"
#define VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME "VK_EXT_depth_clip_enable"
+#define VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME "VK_KHR_imageless_framebuffer"
+#define DECL_KHR_PERFORMANCE_COUNTER_EXTENSION_NAME "not_existent_feature"
#define VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME "VK_EXT_inline_uniform_block"
#define VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME "VK_EXT_blend_operation_advanced"
#define VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME "VK_EXT_descriptor_indexing"
#define VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME "VK_KHR_sampler_ycbcr_conversion"
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceProtectedMemoryFeatures>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES, DECL_PROTECTED_MEMORY_EXTENSION_NAME, 0, 35); }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceShaderDrawParametersFeatures>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION, 34); }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceTransformFeedbackFeaturesEXT>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT, VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION, 33); }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceCornerSampledImageFeaturesNV>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV, VK_NV_CORNER_SAMPLED_IMAGE_EXTENSION_NAME, VK_NV_CORNER_SAMPLED_IMAGE_SPEC_VERSION, 32); }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceConditionalRenderingFeaturesEXT>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT, VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION, 31); }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceFloat16Int8FeaturesKHR>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR, VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, VK_KHR_SHADER_FLOAT16_INT8_SPEC_VERSION, 30); }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceDepthClipEnableFeaturesEXT>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT, VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME, VK_EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION, 29); }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceProtectedMemoryFeatures>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES, DECL_PROTECTED_MEMORY_EXTENSION_NAME, 0, 37); }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceShaderDrawParametersFeatures>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION, 36); }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceTransformFeedbackFeaturesEXT>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT, VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION, 35); }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceCornerSampledImageFeaturesNV>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV, VK_NV_CORNER_SAMPLED_IMAGE_EXTENSION_NAME, VK_NV_CORNER_SAMPLED_IMAGE_SPEC_VERSION, 34); }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceConditionalRenderingFeaturesEXT>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT, VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION, 33); }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceFloat16Int8FeaturesKHR>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR, VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, VK_KHR_SHADER_FLOAT16_INT8_SPEC_VERSION, 32); }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceDepthClipEnableFeaturesEXT>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT, VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME, VK_EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION, 31); }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceImagelessFramebufferFeaturesKHR>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR, VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME, VK_KHR_IMAGELESS_FRAMEBUFFER_SPEC_VERSION, 30); }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDevicePerformanceCounterFeaturesKHR>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_FEATURES_KHR, DECL_KHR_PERFORMANCE_COUNTER_EXTENSION_NAME, 0, 29); }
template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceInlineUniformBlockFeaturesEXT>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT, VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME, VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION, 28); }
template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT, VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, VK_EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION, 27); }
template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceDescriptorIndexingFeaturesEXT>(void) { return FeatureDesc(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT, VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION, 26); }
{ createFeatureStructWrapper<VkPhysicalDeviceConditionalRenderingFeaturesEXT>, VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION },
{ createFeatureStructWrapper<VkPhysicalDeviceFloat16Int8FeaturesKHR>, VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, VK_KHR_SHADER_FLOAT16_INT8_SPEC_VERSION },
{ createFeatureStructWrapper<VkPhysicalDeviceDepthClipEnableFeaturesEXT>, VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME, VK_EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION },
+ { createFeatureStructWrapper<VkPhysicalDeviceImagelessFramebufferFeaturesKHR>, VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME, VK_KHR_IMAGELESS_FRAMEBUFFER_SPEC_VERSION },
+ { createFeatureStructWrapper<VkPhysicalDevicePerformanceCounterFeaturesKHR>, DECL_KHR_PERFORMANCE_COUNTER_EXTENSION_NAME, 0 },
{ createFeatureStructWrapper<VkPhysicalDeviceInlineUniformBlockFeaturesEXT>, VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME, VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION },
{ createFeatureStructWrapper<VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT>, VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, VK_EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION },
{ createFeatureStructWrapper<VkPhysicalDeviceDescriptorIndexingFeaturesEXT>, VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION },
const vk::VkPhysicalDeviceConditionalRenderingFeaturesEXT& getConditionalRenderingFeatures (void) const;
const vk::VkPhysicalDeviceFloat16Int8FeaturesKHR& getFloat16Int8Features (void) const;
const vk::VkPhysicalDeviceDepthClipEnableFeaturesEXT& getDepthClipEnableFeatures (void) const;
+const vk::VkPhysicalDeviceImagelessFramebufferFeaturesKHR& getImagelessFramebufferFeatures (void) const;
+const vk::VkPhysicalDevicePerformanceCounterFeaturesKHR& getPerformanceCounterFeatures (void) const;
const vk::VkPhysicalDeviceInlineUniformBlockFeaturesEXT& getInlineUniformBlockFeatures (void) const;
const vk::VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT& getBlendOperationAdvancedFeatures (void) const;
const vk::VkPhysicalDeviceDescriptorIndexingFeaturesEXT& getDescriptorIndexingFeatures (void) const;
const vk::VkPhysicalDeviceConditionalRenderingFeaturesEXT& Context::getConditionalRenderingFeatures (void) const { return m_device->getConditionalRenderingFeatures(); }
const vk::VkPhysicalDeviceFloat16Int8FeaturesKHR& Context::getFloat16Int8Features (void) const { return m_device->getFloat16Int8Features(); }
const vk::VkPhysicalDeviceDepthClipEnableFeaturesEXT& Context::getDepthClipEnableFeatures (void) const { return m_device->getDepthClipEnableFeatures(); }
+const vk::VkPhysicalDeviceImagelessFramebufferFeaturesKHR& Context::getImagelessFramebufferFeatures (void) const { return m_device->getImagelessFramebufferFeatures(); }
+const vk::VkPhysicalDevicePerformanceCounterFeaturesKHR& Context::getPerformanceCounterFeatures (void) const { return m_device->getPerformanceCounterFeatures(); }
const vk::VkPhysicalDeviceInlineUniformBlockFeaturesEXT& Context::getInlineUniformBlockFeatures (void) const { return m_device->getInlineUniformBlockFeatures(); }
const vk::VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT& Context::getBlendOperationAdvancedFeatures (void) const { return m_device->getBlendOperationAdvancedFeatures(); }
const vk::VkPhysicalDeviceDescriptorIndexingFeaturesEXT& Context::getDescriptorIndexingFeatures (void) const { return m_device->getDescriptorIndexingFeatures(); }
const VkPhysicalDeviceConditionalRenderingFeaturesEXT& getConditionalRenderingFeatures (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceConditionalRenderingFeaturesEXT>(); }
const VkPhysicalDeviceFloat16Int8FeaturesKHR& getFloat16Int8Features (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceFloat16Int8FeaturesKHR>(); }
const VkPhysicalDeviceDepthClipEnableFeaturesEXT& getDepthClipEnableFeatures (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceDepthClipEnableFeaturesEXT>(); }
+const VkPhysicalDeviceImagelessFramebufferFeaturesKHR& getImagelessFramebufferFeatures (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceImagelessFramebufferFeaturesKHR>(); }
+const VkPhysicalDevicePerformanceCounterFeaturesKHR& getPerformanceCounterFeatures (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDevicePerformanceCounterFeaturesKHR>(); }
const VkPhysicalDeviceInlineUniformBlockFeaturesEXT& getInlineUniformBlockFeatures (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceInlineUniformBlockFeaturesEXT>(); }
const VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT& getBlendOperationAdvancedFeatures (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT>(); }
const VkPhysicalDeviceDescriptorIndexingFeaturesEXT& getDescriptorIndexingFeatures (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceDescriptorIndexingFeaturesEXT>(); }
GetSwapchainStatusKHRFunc getSwapchainStatusKHR;
ImportFenceFdKHRFunc importFenceFdKHR;
GetFenceFdKHRFunc getFenceFdKHR;
+AcquireProfilingLockKHRFunc acquireProfilingLockKHR;
+ReleaseProfilingLockKHRFunc releaseProfilingLockKHR;
CmdDrawIndirectCountKHRFunc cmdDrawIndirectCountKHR;
CmdDrawIndexedIndirectCountKHRFunc cmdDrawIndexedIndirectCountKHR;
DebugMarkerSetObjectTagEXTFunc debugMarkerSetObjectTagEXT;
{
functions.push_back("vkGetPhysicalDeviceExternalFencePropertiesKHR");
}
+ else if (extName == "VK_KHR_performance_query")
+ {
+ functions.push_back("vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR");
+ functions.push_back("vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR");
+ }
else if (extName == "VK_KHR_get_surface_capabilities2")
{
functions.push_back("vkGetPhysicalDeviceSurfaceCapabilities2KHR");
functions.push_back("vkImportFenceFdKHR");
functions.push_back("vkGetFenceFdKHR");
}
+ else if (extName == "VK_KHR_performance_query")
+ {
+ functions.push_back("vkAcquireProfilingLockKHR");
+ functions.push_back("vkReleaseProfilingLockKHR");
+ }
else if (extName == "VK_KHR_get_memory_requirements2")
{
functions.push_back("vkGetImageMemoryRequirements2KHR");
"VK_KHR_external_memory_capabilities",
"VK_KHR_external_semaphore_capabilities",
"VK_KHR_external_fence_capabilities",
+ "VK_KHR_performance_query",
"VK_KHR_get_surface_capabilities2",
"VK_KHR_get_display_properties2",
"VK_EXT_debug_report",
typedef VKAPI_ATTR void (VKAPI_CALL* GetPhysicalDeviceExternalFencePropertiesKHRFunc) (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties);
typedef VKAPI_ATTR VkResult (VKAPI_CALL* ImportFenceFdKHRFunc) (VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo);
typedef VKAPI_ATTR VkResult (VKAPI_CALL* GetFenceFdKHRFunc) (VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd);
+typedef VKAPI_ATTR void (VKAPI_CALL* EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHRFunc) (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions);
+typedef VKAPI_ATTR void (VKAPI_CALL* GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHRFunc) (VkPhysicalDevice physicalDevice, const VkPerformanceQueryCreateInfoKHR* pPerformanceQueryCreateInfo, deUint32* pNumPasses);
+typedef VKAPI_ATTR VkResult (VKAPI_CALL* AcquireProfilingLockKHRFunc) (VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo);
+typedef VKAPI_ATTR void (VKAPI_CALL* ReleaseProfilingLockKHRFunc) (VkDevice device);
typedef VKAPI_ATTR VkResult (VKAPI_CALL* GetPhysicalDeviceSurfaceCapabilities2KHRFunc) (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities);
typedef VKAPI_ATTR VkResult (VKAPI_CALL* GetPhysicalDeviceSurfaceFormats2KHRFunc) (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, deUint32* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats);
typedef VKAPI_ATTR VkResult (VKAPI_CALL* GetPhysicalDeviceDisplayProperties2KHRFunc) (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayProperties2KHR* pProperties);
return VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR;
}
+template<> VkStructureType getStructureType<VkPhysicalDeviceImagelessFramebufferFeaturesKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR;
+}
+
+template<> VkStructureType getStructureType<VkFramebufferAttachmentImageInfoKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR;
+}
+
+template<> VkStructureType getStructureType<VkFramebufferAttachmentsCreateInfoKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR;
+}
+
+template<> VkStructureType getStructureType<VkRenderPassAttachmentBeginInfoKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR;
+}
+
template<> VkStructureType getStructureType<VkAttachmentDescription2KHR> (void)
{
return VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR;
return VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR;
}
+template<> VkStructureType getStructureType<VkPhysicalDevicePerformanceCounterFeaturesKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_FEATURES_KHR;
+}
+
+template<> VkStructureType getStructureType<VkPhysicalDevicePerformanceCounterPropertiesKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_PROPERTIES_KHR;
+}
+
+template<> VkStructureType getStructureType<VkPerformanceCounterKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR;
+}
+
+template<> VkStructureType getStructureType<VkPerformanceCounterDescriptionKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR;
+}
+
+template<> VkStructureType getStructureType<VkPerformanceQueryCreateInfoKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_CREATE_INFO_KHR;
+}
+
+template<> VkStructureType getStructureType<VkAcquireProfilingLockInfoKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR;
+}
+
+template<> VkStructureType getStructureType<VkPerformanceQuerySubmitInfoKHR> (void)
+{
+ return VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR;
+}
+
template<> VkStructureType getStructureType<VkPhysicalDeviceSurfaceInfo2KHR> (void)
{
return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR;
m_vk.getSwapchainStatusKHR = (GetSwapchainStatusKHRFunc) GET_PROC_ADDR("vkGetSwapchainStatusKHR");
m_vk.importFenceFdKHR = (ImportFenceFdKHRFunc) GET_PROC_ADDR("vkImportFenceFdKHR");
m_vk.getFenceFdKHR = (GetFenceFdKHRFunc) GET_PROC_ADDR("vkGetFenceFdKHR");
+m_vk.acquireProfilingLockKHR = (AcquireProfilingLockKHRFunc) GET_PROC_ADDR("vkAcquireProfilingLockKHR");
+m_vk.releaseProfilingLockKHR = (ReleaseProfilingLockKHRFunc) GET_PROC_ADDR("vkReleaseProfilingLockKHR");
m_vk.cmdDrawIndirectCountKHR = (CmdDrawIndirectCountKHRFunc) GET_PROC_ADDR("vkCmdDrawIndirectCountKHR");
m_vk.cmdDrawIndexedIndirectCountKHR = (CmdDrawIndexedIndirectCountKHRFunc) GET_PROC_ADDR("vkCmdDrawIndexedIndirectCountKHR");
m_vk.debugMarkerSetObjectTagEXT = (DebugMarkerSetObjectTagEXTFunc) GET_PROC_ADDR("vkDebugMarkerSetObjectTagEXT");
m_vk.getPhysicalDeviceExternalBufferPropertiesKHR = (GetPhysicalDeviceExternalBufferPropertiesKHRFunc) GET_PROC_ADDR("vkGetPhysicalDeviceExternalBufferPropertiesKHR");
m_vk.getPhysicalDeviceExternalSemaphorePropertiesKHR = (GetPhysicalDeviceExternalSemaphorePropertiesKHRFunc) GET_PROC_ADDR("vkGetPhysicalDeviceExternalSemaphorePropertiesKHR");
m_vk.getPhysicalDeviceExternalFencePropertiesKHR = (GetPhysicalDeviceExternalFencePropertiesKHRFunc) GET_PROC_ADDR("vkGetPhysicalDeviceExternalFencePropertiesKHR");
+m_vk.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR = (EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHRFunc) GET_PROC_ADDR("vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR");
+m_vk.getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR = (GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHRFunc) GET_PROC_ADDR("vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR");
m_vk.getPhysicalDeviceSurfaceCapabilities2KHR = (GetPhysicalDeviceSurfaceCapabilities2KHRFunc) GET_PROC_ADDR("vkGetPhysicalDeviceSurfaceCapabilities2KHR");
m_vk.getPhysicalDeviceSurfaceFormats2KHR = (GetPhysicalDeviceSurfaceFormats2KHRFunc) GET_PROC_ADDR("vkGetPhysicalDeviceSurfaceFormats2KHR");
m_vk.getPhysicalDeviceDisplayProperties2KHR = (GetPhysicalDeviceDisplayProperties2KHRFunc) GET_PROC_ADDR("vkGetPhysicalDeviceDisplayProperties2KHR");
return m_vk.createDisplayPlaneSurfaceKHR(instance, pCreateInfo, pAllocator, pSurface);
}
+void InstanceDriver::enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) const
+{
+ m_vk.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueFamilyIndex, pCounterCount, pCounters, pCounterDescriptions);
+}
+
+void InstanceDriver::getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR (VkPhysicalDevice physicalDevice, const VkPerformanceQueryCreateInfoKHR* pPerformanceQueryCreateInfo, deUint32* pNumPasses) const
+{
+ m_vk.getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(physicalDevice, pPerformanceQueryCreateInfo, pNumPasses);
+}
+
VkResult InstanceDriver::getPhysicalDeviceSurfaceCapabilities2KHR (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities) const
{
return m_vk.getPhysicalDeviceSurfaceCapabilities2KHR(physicalDevice, pSurfaceInfo, pSurfaceCapabilities);
GetPhysicalDeviceExternalBufferPropertiesKHRFunc getPhysicalDeviceExternalBufferPropertiesKHR;
GetPhysicalDeviceExternalSemaphorePropertiesKHRFunc getPhysicalDeviceExternalSemaphorePropertiesKHR;
GetPhysicalDeviceExternalFencePropertiesKHRFunc getPhysicalDeviceExternalFencePropertiesKHR;
+EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHRFunc enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR;
+GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHRFunc getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR;
GetPhysicalDeviceSurfaceCapabilities2KHRFunc getPhysicalDeviceSurfaceCapabilities2KHR;
GetPhysicalDeviceSurfaceFormats2KHRFunc getPhysicalDeviceSurfaceFormats2KHR;
GetPhysicalDeviceDisplayProperties2KHRFunc getPhysicalDeviceDisplayProperties2KHR;
return VK_SUCCESS;
}
+VKAPI_ATTR void VKAPI_CALL enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions)
+{
+ DE_UNREF(physicalDevice);
+ DE_UNREF(queueFamilyIndex);
+ DE_UNREF(pCounterCount);
+ DE_UNREF(pCounters);
+ DE_UNREF(pCounterDescriptions);
+}
+
+VKAPI_ATTR void VKAPI_CALL getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR (VkPhysicalDevice physicalDevice, const VkPerformanceQueryCreateInfoKHR* pPerformanceQueryCreateInfo, deUint32* pNumPasses)
+{
+ DE_UNREF(physicalDevice);
+ DE_UNREF(pPerformanceQueryCreateInfo);
+ DE_UNREF(pNumPasses);
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL acquireProfilingLockKHR (VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo)
+{
+ DE_UNREF(device);
+ DE_UNREF(pInfo);
+ return VK_SUCCESS;
+}
+
+VKAPI_ATTR void VKAPI_CALL releaseProfilingLockKHR (VkDevice device)
+{
+ DE_UNREF(device);
+}
+
VKAPI_ATTR VkResult VKAPI_CALL getPhysicalDeviceSurfaceCapabilities2KHR (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities)
{
DE_UNREF(physicalDevice);
VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceExternalBufferPropertiesKHR, getPhysicalDeviceExternalBufferProperties),
VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, getPhysicalDeviceExternalSemaphoreProperties),
VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceExternalFencePropertiesKHR, getPhysicalDeviceExternalFenceProperties),
+ VK_NULL_FUNC_ENTRY(vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR, enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR),
+ VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR, getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR),
VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceSurfaceCapabilities2KHR, getPhysicalDeviceSurfaceCapabilities2KHR),
VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceSurfaceFormats2KHR, getPhysicalDeviceSurfaceFormats2KHR),
VK_NULL_FUNC_ENTRY(vkGetPhysicalDeviceDisplayProperties2KHR, getPhysicalDeviceDisplayProperties2KHR),
VK_NULL_FUNC_ENTRY(vkGetSwapchainStatusKHR, getSwapchainStatusKHR),
VK_NULL_FUNC_ENTRY(vkImportFenceFdKHR, importFenceFdKHR),
VK_NULL_FUNC_ENTRY(vkGetFenceFdKHR, getFenceFdKHR),
+ VK_NULL_FUNC_ENTRY(vkAcquireProfilingLockKHR, acquireProfilingLockKHR),
+ VK_NULL_FUNC_ENTRY(vkReleaseProfilingLockKHR, releaseProfilingLockKHR),
VK_NULL_FUNC_ENTRY(vkGetImageMemoryRequirements2KHR, getImageMemoryRequirements2),
VK_NULL_FUNC_ENTRY(vkGetBufferMemoryRequirements2KHR, getBufferMemoryRequirements2),
VK_NULL_FUNC_ENTRY(vkGetImageSparseMemoryRequirements2KHR, getImageSparseMemoryRequirements2),
return vk::SPIRV_VERSION_1_0;
}
-// Max supported versions for each vulkan version
-vk::SpirvVersion getMaxSpirvVersionForAsm (const deUint32 vulkanVersion)
+// Max supported versions for each Vulkan version, without requiring a Vulkan extension.
+vk::SpirvVersion getMaxSpirvVersionForVulkan (const deUint32 vulkanVersion)
{
vk::SpirvVersion result = vk::SPIRV_VERSION_LAST;
return result;
}
-vk::SpirvVersion getMaxSpirvVersionForGlsl (const deUint32 vulkanVersion)
+vk::SpirvVersion getMaxSpirvVersionForAsm (const deUint32 vulkanVersion)
{
- vk::SpirvVersion result = vk::SPIRV_VERSION_LAST;
-
- deUint32 vulkanVersionMajorMinor = VK_MAKE_VERSION(VK_VERSION_MAJOR(vulkanVersion), VK_VERSION_MINOR(vulkanVersion), 0);
- if (vulkanVersionMajorMinor == VK_API_VERSION_1_0)
- result = vk::SPIRV_VERSION_1_0;
- else if (vulkanVersionMajorMinor >= VK_API_VERSION_1_1)
- result = vk::SPIRV_VERSION_1_3;
-
- DE_ASSERT(result < vk::SPIRV_VERSION_LAST);
+ return getMaxSpirvVersionForVulkan(vulkanVersion);
+}
- return result;
+vk::SpirvVersion getMaxSpirvVersionForGlsl (const deUint32 vulkanVersion)
+{
+ return getMaxSpirvVersionForVulkan(vulkanVersion);
}
SpirvVersion extractSpirvVersion (const ProgramBinary& binary)
{
- DE_STATIC_ASSERT(SPIRV_VERSION_1_3 + 1 == SPIRV_VERSION_LAST);
+ DE_STATIC_ASSERT(SPIRV_VERSION_1_4 + 1 == SPIRV_VERSION_LAST);
if (binary.getFormat() != PROGRAM_FORMAT_SPIRV)
TCU_THROW(InternalError, "Binary is not in SPIR-V format");
const deUint32 spirvBinaryVersion11 = 0x00010100;
const deUint32 spirvBinaryVersion12 = 0x00010200;
const deUint32 spirvBinaryVersion13 = 0x00010300;
+ const deUint32 spirvBinaryVersion14 = 0x00010400;
const SpirvBinaryHeader* header = reinterpret_cast<const SpirvBinaryHeader*>(binary.getBinary());
const deUint32 spirvVersion = isNativeSpirVBinaryEndianness()
? header->version
case spirvBinaryVersion11: result = SPIRV_VERSION_1_1; break; //!< SPIR-V 1.1
case spirvBinaryVersion12: result = SPIRV_VERSION_1_2; break; //!< SPIR-V 1.2
case spirvBinaryVersion13: result = SPIRV_VERSION_1_3; break; //!< SPIR-V 1.3
+ case spirvBinaryVersion14: result = SPIRV_VERSION_1_4; break; //!< SPIR-V 1.4
default: TCU_THROW(InternalError, "Unknown SPIR-V version detected in binary");
}
std::string getSpirvVersionName (const SpirvVersion spirvVersion)
{
- DE_STATIC_ASSERT(SPIRV_VERSION_1_3 + 1 == SPIRV_VERSION_LAST);
+ DE_STATIC_ASSERT(SPIRV_VERSION_1_4 + 1 == SPIRV_VERSION_LAST);
DE_ASSERT(spirvVersion < SPIRV_VERSION_LAST);
std::string result;
case SPIRV_VERSION_1_1: result = "1.1"; break; //!< SPIR-V 1.1
case SPIRV_VERSION_1_2: result = "1.2"; break; //!< SPIR-V 1.2
case SPIRV_VERSION_1_3: result = "1.3"; break; //!< SPIR-V 1.3
+ case SPIRV_VERSION_1_4: result = "1.4"; break; //!< SPIR-V 1.4
default: result = "Unknown";
}
glu::ShaderType getGluShaderType (VkShaderStageFlagBits shaderStage);
VkShaderStageFlagBits getVkShaderStage (glu::ShaderType shaderType);
+// Returns the max SPIR-V version usable with a given Vulkan version, without requiring an extension.
+vk::SpirvVersion getMaxSpirvVersionForVulkan (const deUint32 vulkanVersion);
+// Deprecated. Use getMaxSpirvVersionForVulkan instead.
vk::SpirvVersion getMaxSpirvVersionForAsm (const deUint32 vulkanVersion);
+// Deprecated. Use getMaxSpirvVersionForVulkan instead.
vk::SpirvVersion getMaxSpirvVersionForGlsl (const deUint32 vulkanVersion);
vk::SpirvVersion getBaselineSpirvVersion (const deUint32 vulkanVersion);
SpirvVersion extractSpirvVersion (const ProgramBinary& binary);
#if defined(DEQP_HAVE_SPIRV_TOOLS)
-// Convert a Vulkan version number to a SPIRV-Tools target environment enum.
-static spv_target_env mapVulkanVersionToSpirvToolsEnv(deUint32 vulkanVersion)
+// Returns the SPIRV-Tools target environment enum for the given dEQP Spirv validator options object.
+// Do this here instead of as a method on SpirvValidatorOptions because only this file has access to
+// the SPIRV-Tools headers.
+static spv_target_env getSpirvToolsEnvForValidatorOptions(SpirvValidatorOptions opts)
{
- switch (vulkanVersion)
+ const bool allow_1_4 = opts.supports_VK_KHR_spirv_1_4;
+ switch (opts.vulkanVersion)
{
case VK_MAKE_VERSION(1, 0, 0): return SPV_ENV_VULKAN_1_0;
- case VK_MAKE_VERSION(1, 1, 0): return SPV_ENV_VULKAN_1_1;
+ case VK_MAKE_VERSION(1, 1, 0): return allow_1_4 ? SPV_ENV_VULKAN_1_1_SPIRV_1_4 : SPV_ENV_VULKAN_1_1;
default:
break;
}
case SPIRV_VERSION_1_1: result = SPV_ENV_UNIVERSAL_1_1; break; //!< SPIR-V 1.1
case SPIRV_VERSION_1_2: result = SPV_ENV_UNIVERSAL_1_2; break; //!< SPIR-V 1.2
case SPIRV_VERSION_1_3: result = SPV_ENV_UNIVERSAL_1_3; break; //!< SPIR-V 1.3
+ case SPIRV_VERSION_1_4: result = SPV_ENV_UNIVERSAL_1_4; break; //!< SPIR-V 1.4
default: TCU_THROW(InternalError, "Unknown SPIR-V version");
}
bool validateSpirV (size_t binarySizeInWords, const deUint32* binary, std::ostream* infoLog, const SpirvValidatorOptions &val_options)
{
- const spv_context context = spvContextCreate(mapVulkanVersionToSpirvToolsEnv(val_options.vulkanVersion));
+ const spv_context context = spvContextCreate(getSpirvToolsEnvForValidatorOptions(val_options));
spv_diagnostic diagnostic = DE_NULL;
spv_validator_options options = DE_NULL;
spv_text disasmText = DE_NULL;
struct SpirVAsmBuildOptions
{
- deUint32 vulkanVersion;
+ deUint32 vulkanVersion;
SpirvVersion targetVersion;
+ bool supports_VK_KHR_spirv_1_4;
SpirVAsmBuildOptions (deUint32 vulkanVersion_, SpirvVersion targetVersion_)
- : vulkanVersion (vulkanVersion_)
- , targetVersion (targetVersion_)
+ : vulkanVersion (vulkanVersion_)
+ , targetVersion (targetVersion_)
+ , supports_VK_KHR_spirv_1_4 (false)
{}
SpirVAsmBuildOptions (void)
- : vulkanVersion (VK_MAKE_VERSION(1, 0, 0))
- , targetVersion (SPIRV_VERSION_1_0)
+ : vulkanVersion (VK_MAKE_VERSION(1, 0, 0))
+ , targetVersion (SPIRV_VERSION_1_0)
+ , supports_VK_KHR_spirv_1_4 (false)
{}
SpirvValidatorOptions getSpirvValidatorOptions() const
{
- return SpirvValidatorOptions(vulkanVersion);
+ SpirvValidatorOptions result(vulkanVersion);
+ result.supports_VK_KHR_spirv_1_4 = supports_VK_KHR_spirv_1_4;
+ return result;
}
};
const char* getDescriptorUpdateTemplateTypeName (VkDescriptorUpdateTemplateType value);
const char* getColorSpaceKHRName (VkColorSpaceKHR value);
const char* getPresentModeKHRName (VkPresentModeKHR value);
+const char* getPerformanceCounterUnitKHRName (VkPerformanceCounterUnitKHR value);
+const char* getPerformanceCounterScopeKHRName (VkPerformanceCounterScopeKHR value);
+const char* getPerformanceCounterStorageKHRName (VkPerformanceCounterStorageKHR value);
const char* getDriverIdKHRName (VkDriverIdKHR value);
const char* getDebugReportObjectTypeEXTName (VkDebugReportObjectTypeEXT value);
const char* getRasterizationOrderAMDName (VkRasterizationOrderAMD value);
inline tcu::Format::Enum<VkDescriptorUpdateTemplateType> getDescriptorUpdateTemplateTypeStr (VkDescriptorUpdateTemplateType value) { return tcu::Format::Enum<VkDescriptorUpdateTemplateType>(getDescriptorUpdateTemplateTypeName, value); }
inline tcu::Format::Enum<VkColorSpaceKHR> getColorSpaceKHRStr (VkColorSpaceKHR value) { return tcu::Format::Enum<VkColorSpaceKHR>(getColorSpaceKHRName, value); }
inline tcu::Format::Enum<VkPresentModeKHR> getPresentModeKHRStr (VkPresentModeKHR value) { return tcu::Format::Enum<VkPresentModeKHR>(getPresentModeKHRName, value); }
+inline tcu::Format::Enum<VkPerformanceCounterUnitKHR> getPerformanceCounterUnitKHRStr (VkPerformanceCounterUnitKHR value) { return tcu::Format::Enum<VkPerformanceCounterUnitKHR>(getPerformanceCounterUnitKHRName, value); }
+inline tcu::Format::Enum<VkPerformanceCounterScopeKHR> getPerformanceCounterScopeKHRStr (VkPerformanceCounterScopeKHR value) { return tcu::Format::Enum<VkPerformanceCounterScopeKHR>(getPerformanceCounterScopeKHRName, value); }
+inline tcu::Format::Enum<VkPerformanceCounterStorageKHR> getPerformanceCounterStorageKHRStr (VkPerformanceCounterStorageKHR value) { return tcu::Format::Enum<VkPerformanceCounterStorageKHR>(getPerformanceCounterStorageKHRName, value); }
inline tcu::Format::Enum<VkDriverIdKHR> getDriverIdKHRStr (VkDriverIdKHR value) { return tcu::Format::Enum<VkDriverIdKHR>(getDriverIdKHRName, value); }
inline tcu::Format::Enum<VkDebugReportObjectTypeEXT> getDebugReportObjectTypeEXTStr (VkDebugReportObjectTypeEXT value) { return tcu::Format::Enum<VkDebugReportObjectTypeEXT>(getDebugReportObjectTypeEXTName, value); }
inline tcu::Format::Enum<VkRasterizationOrderAMD> getRasterizationOrderAMDStr (VkRasterizationOrderAMD value) { return tcu::Format::Enum<VkRasterizationOrderAMD>(getRasterizationOrderAMDName, value); }
inline std::ostream& operator<< (std::ostream& s, VkDescriptorUpdateTemplateType value) { return s << getDescriptorUpdateTemplateTypeStr(value); }
inline std::ostream& operator<< (std::ostream& s, VkColorSpaceKHR value) { return s << getColorSpaceKHRStr(value); }
inline std::ostream& operator<< (std::ostream& s, VkPresentModeKHR value) { return s << getPresentModeKHRStr(value); }
+inline std::ostream& operator<< (std::ostream& s, VkPerformanceCounterUnitKHR value) { return s << getPerformanceCounterUnitKHRStr(value); }
+inline std::ostream& operator<< (std::ostream& s, VkPerformanceCounterScopeKHR value) { return s << getPerformanceCounterScopeKHRStr(value); }
+inline std::ostream& operator<< (std::ostream& s, VkPerformanceCounterStorageKHR value) { return s << getPerformanceCounterStorageKHRStr(value); }
inline std::ostream& operator<< (std::ostream& s, VkDriverIdKHR value) { return s << getDriverIdKHRStr(value); }
inline std::ostream& operator<< (std::ostream& s, VkDebugReportObjectTypeEXT value) { return s << getDebugReportObjectTypeEXTStr(value); }
inline std::ostream& operator<< (std::ostream& s, VkRasterizationOrderAMD value) { return s << getRasterizationOrderAMDStr(value); }
tcu::Format::Bitfield<32> getSamplerCreateFlagsStr (VkSamplerCreateFlags value);
tcu::Format::Bitfield<32> getDescriptorSetLayoutCreateFlagsStr (VkDescriptorSetLayoutCreateFlags value);
tcu::Format::Bitfield<32> getDescriptorPoolCreateFlagsStr (VkDescriptorPoolCreateFlags value);
+tcu::Format::Bitfield<32> getFramebufferCreateFlagsStr (VkFramebufferCreateFlags value);
tcu::Format::Bitfield<32> getAttachmentDescriptionFlagsStr (VkAttachmentDescriptionFlags value);
tcu::Format::Bitfield<32> getSubpassDescriptionFlagsStr (VkSubpassDescriptionFlags value);
tcu::Format::Bitfield<32> getAccessFlagsStr (VkAccessFlags value);
tcu::Format::Bitfield<32> getSwapchainCreateFlagsKHRStr (VkSwapchainCreateFlagsKHR value);
tcu::Format::Bitfield<32> getDeviceGroupPresentModeFlagsKHRStr (VkDeviceGroupPresentModeFlagsKHR value);
tcu::Format::Bitfield<32> getDisplayPlaneAlphaFlagsKHRStr (VkDisplayPlaneAlphaFlagsKHR value);
+tcu::Format::Bitfield<32> getPerformanceCounterDescriptionFlagsKHRStr (VkPerformanceCounterDescriptionFlagsKHR value);
tcu::Format::Bitfield<32> getResolveModeFlagsKHRStr (VkResolveModeFlagsKHR value);
tcu::Format::Bitfield<32> getDebugReportFlagsEXTStr (VkDebugReportFlagsEXT value);
tcu::Format::Bitfield<32> getExternalMemoryHandleTypeFlagsNVStr (VkExternalMemoryHandleTypeFlagsNV value);
tcu::Format::Bitfield<32> getPipelineDynamicStateCreateFlagsStr (VkPipelineDynamicStateCreateFlags value);
tcu::Format::Bitfield<32> getPipelineLayoutCreateFlagsStr (VkPipelineLayoutCreateFlags value);
tcu::Format::Bitfield<32> getDescriptorPoolResetFlagsStr (VkDescriptorPoolResetFlags value);
-tcu::Format::Bitfield<32> getFramebufferCreateFlagsStr (VkFramebufferCreateFlags value);
tcu::Format::Bitfield<32> getRenderPassCreateFlagsStr (VkRenderPassCreateFlags value);
tcu::Format::Bitfield<32> getCommandPoolTrimFlagsStr (VkCommandPoolTrimFlags value);
tcu::Format::Bitfield<32> getDescriptorUpdateTemplateCreateFlagsStr (VkDescriptorUpdateTemplateCreateFlags value);
tcu::Format::Bitfield<32> getDisplayModeCreateFlagsKHRStr (VkDisplayModeCreateFlagsKHR value);
tcu::Format::Bitfield<32> getDisplaySurfaceCreateFlagsKHRStr (VkDisplaySurfaceCreateFlagsKHR value);
+tcu::Format::Bitfield<32> getAcquireProfilingLockFlagsKHRStr (VkAcquireProfilingLockFlagsKHR value);
tcu::Format::Bitfield<32> getPipelineRasterizationStateStreamCreateFlagsEXTStr (VkPipelineRasterizationStateStreamCreateFlagsEXT value);
tcu::Format::Bitfield<32> getPipelineViewportSwizzleStateCreateFlagsNVStr (VkPipelineViewportSwizzleStateCreateFlagsNV value);
tcu::Format::Bitfield<32> getPipelineDiscardRectangleStateCreateFlagsEXTStr (VkPipelineDiscardRectangleStateCreateFlagsEXT value);
std::ostream& operator<< (std::ostream& s, const VkRectLayerKHR& value);
std::ostream& operator<< (std::ostream& s, const VkPresentRegionKHR& value);
std::ostream& operator<< (std::ostream& s, const VkPresentRegionsKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceImagelessFramebufferFeaturesKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkFramebufferAttachmentImageInfoKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkFramebufferAttachmentsCreateInfoKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkRenderPassAttachmentBeginInfoKHR& value);
std::ostream& operator<< (std::ostream& s, const VkAttachmentDescription2KHR& value);
std::ostream& operator<< (std::ostream& s, const VkAttachmentReference2KHR& value);
std::ostream& operator<< (std::ostream& s, const VkSubpassDescription2KHR& value);
std::ostream& operator<< (std::ostream& s, const VkSharedPresentSurfaceCapabilitiesKHR& value);
std::ostream& operator<< (std::ostream& s, const VkImportFenceFdInfoKHR& value);
std::ostream& operator<< (std::ostream& s, const VkFenceGetFdInfoKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkPhysicalDevicePerformanceCounterFeaturesKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkPhysicalDevicePerformanceCounterPropertiesKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkPerformanceCounterKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkPerformanceCounterDescriptionKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkPerformanceQueryCreateInfoKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkPerformanceCounterResultKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkAcquireProfilingLockInfoKHR& value);
+std::ostream& operator<< (std::ostream& s, const VkPerformanceQuerySubmitInfoKHR& value);
std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceSurfaceInfo2KHR& value);
std::ostream& operator<< (std::ostream& s, const VkSurfaceCapabilities2KHR& value);
std::ostream& operator<< (std::ostream& s, const VkSurfaceFormat2KHR& value);
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT";
case VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT: return "VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT";
case VK_STRUCTURE_TYPE_HDR_METADATA_EXT: return "VK_STRUCTURE_TYPE_HDR_METADATA_EXT";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR: return "VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR: return "VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR: return "VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR";
case VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR: return "VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR";
case VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR: return "VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR";
case VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR: return "VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR";
case VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR: return "VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR";
case VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR: return "VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR";
case VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR: return "VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_FEATURES_KHR: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_FEATURES_KHR";
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_PROPERTIES_KHR: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_PROPERTIES_KHR";
+ case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_CREATE_INFO_KHR: return "VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_CREATE_INFO_KHR";
+ case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: return "VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR";
+ case VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR: return "VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR";
+ case VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR: return "VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR";
+ case VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR: return "VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR";
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR: return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR";
case VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR: return "VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR";
case VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR: return "VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR";
case VK_QUERY_TYPE_PIPELINE_STATISTICS: return "VK_QUERY_TYPE_PIPELINE_STATISTICS";
case VK_QUERY_TYPE_TIMESTAMP: return "VK_QUERY_TYPE_TIMESTAMP";
case VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT: return "VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT";
+ case VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR: return "VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR";
case VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV: return "VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV";
case VK_QUERY_TYPE_MAX_ENUM: return "VK_QUERY_TYPE_MAX_ENUM";
default: return DE_NULL;
}
}
+const char* getPerformanceCounterUnitKHRName (VkPerformanceCounterUnitKHR value)
+{
+ switch (value)
+ {
+ case VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR: return "VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_PERCENTAGE_KHR: return "VK_PERFORMANCE_COUNTER_UNIT_PERCENTAGE_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR: return "VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_BYTES_KHR: return "VK_PERFORMANCE_COUNTER_UNIT_BYTES_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_BYTES_PER_SECOND_KHR: return "VK_PERFORMANCE_COUNTER_UNIT_BYTES_PER_SECOND_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_KELVIN_KHR: return "VK_PERFORMANCE_COUNTER_UNIT_KELVIN_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_WATTS_KHR: return "VK_PERFORMANCE_COUNTER_UNIT_WATTS_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_VOLTS_KHR: return "VK_PERFORMANCE_COUNTER_UNIT_VOLTS_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_AMPS_KHR: return "VK_PERFORMANCE_COUNTER_UNIT_AMPS_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_HERTZ_KHR: return "VK_PERFORMANCE_COUNTER_UNIT_HERTZ_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR: return "VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR";
+ case VK_PERFORMANCE_COUNTER_UNIT_MAX_ENUM_KHR: return "VK_PERFORMANCE_COUNTER_UNIT_MAX_ENUM_KHR";
+ default: return DE_NULL;
+ }
+}
+
+const char* getPerformanceCounterScopeKHRName (VkPerformanceCounterScopeKHR value)
+{
+ switch (value)
+ {
+ case VK_QUERY_SCOPE_COMMAND_BUFFER_KHR: return "VK_QUERY_SCOPE_COMMAND_BUFFER_KHR";
+ case VK_QUERY_SCOPE_RENDER_PASS_KHR: return "VK_QUERY_SCOPE_RENDER_PASS_KHR";
+ case VK_QUERY_SCOPE_COMMAND_KHR: return "VK_QUERY_SCOPE_COMMAND_KHR";
+ case VK_PERFORMANCE_COUNTER_SCOPE_MAX_ENUM_KHR: return "VK_PERFORMANCE_COUNTER_SCOPE_MAX_ENUM_KHR";
+ default: return DE_NULL;
+ }
+}
+
+const char* getPerformanceCounterStorageKHRName (VkPerformanceCounterStorageKHR value)
+{
+ switch (value)
+ {
+ case VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR: return "VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR";
+ case VK_PERFORMANCE_COUNTER_STORAGE_INT64_KHR: return "VK_PERFORMANCE_COUNTER_STORAGE_INT64_KHR";
+ case VK_PERFORMANCE_COUNTER_STORAGE_UINT32_KHR: return "VK_PERFORMANCE_COUNTER_STORAGE_UINT32_KHR";
+ case VK_PERFORMANCE_COUNTER_STORAGE_UINT64_KHR: return "VK_PERFORMANCE_COUNTER_STORAGE_UINT64_KHR";
+ case VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR: return "VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR";
+ case VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR: return "VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR";
+ case VK_PERFORMANCE_COUNTER_STORAGE_MAX_ENUM_KHR: return "VK_PERFORMANCE_COUNTER_STORAGE_MAX_ENUM_KHR";
+ default: return DE_NULL;
+ }
+}
+
const char* getDriverIdKHRName (VkDriverIdKHR value)
{
switch (value)
return tcu::Format::Bitfield<32>(value, DE_ARRAY_BEGIN(s_desc), DE_ARRAY_END(s_desc));
}
+tcu::Format::Bitfield<32> getFramebufferCreateFlagsStr (VkFramebufferCreateFlags value)
+{
+ static const tcu::Format::BitDesc s_desc[] =
+ {
+ tcu::Format::BitDesc(VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR, "VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR"),
+ tcu::Format::BitDesc(VK_FRAMEBUFFER_CREATE_FLAG_BITS_MAX_ENUM, "VK_FRAMEBUFFER_CREATE_FLAG_BITS_MAX_ENUM"),
+ };
+ return tcu::Format::Bitfield<32>(value, DE_ARRAY_BEGIN(s_desc), DE_ARRAY_END(s_desc));
+}
+
tcu::Format::Bitfield<32> getAttachmentDescriptionFlagsStr (VkAttachmentDescriptionFlags value)
{
static const tcu::Format::BitDesc s_desc[] =
return tcu::Format::Bitfield<32>(value, DE_ARRAY_BEGIN(s_desc), DE_ARRAY_END(s_desc));
}
+tcu::Format::Bitfield<32> getPerformanceCounterDescriptionFlagsKHRStr (VkPerformanceCounterDescriptionFlagsKHR value)
+{
+ static const tcu::Format::BitDesc s_desc[] =
+ {
+ tcu::Format::BitDesc(VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_KHR, "VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_KHR"),
+ tcu::Format::BitDesc(VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_KHR, "VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_KHR"),
+ tcu::Format::BitDesc(VK_PERFORMANCE_COUNTER_DESCRIPTION_FLAG_BITS_MAX_ENUM_KHR, "VK_PERFORMANCE_COUNTER_DESCRIPTION_FLAG_BITS_MAX_ENUM_KHR"),
+ };
+ return tcu::Format::Bitfield<32>(value, DE_ARRAY_BEGIN(s_desc), DE_ARRAY_END(s_desc));
+}
+
tcu::Format::Bitfield<32> getResolveModeFlagsKHRStr (VkResolveModeFlagsKHR value)
{
static const tcu::Format::BitDesc s_desc[] =
return tcu::Format::Bitfield<32>(value, DE_NULL, DE_NULL);
}
-tcu::Format::Bitfield<32> getFramebufferCreateFlagsStr (VkFramebufferCreateFlags value)
-{
- return tcu::Format::Bitfield<32>(value, DE_NULL, DE_NULL);
-}
-
tcu::Format::Bitfield<32> getRenderPassCreateFlagsStr (VkRenderPassCreateFlags value)
{
return tcu::Format::Bitfield<32>(value, DE_NULL, DE_NULL);
return tcu::Format::Bitfield<32>(value, DE_NULL, DE_NULL);
}
+tcu::Format::Bitfield<32> getAcquireProfilingLockFlagsKHRStr (VkAcquireProfilingLockFlagsKHR value)
+{
+ return tcu::Format::Bitfield<32>(value, DE_NULL, DE_NULL);
+}
+
tcu::Format::Bitfield<32> getPipelineRasterizationStateStreamCreateFlagsEXTStr (VkPipelineRasterizationStateStreamCreateFlagsEXT value)
{
return tcu::Format::Bitfield<32>(value, DE_NULL, DE_NULL);
return s;
}
+std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceImagelessFramebufferFeaturesKHR& value)
+{
+ s << "VkPhysicalDeviceImagelessFramebufferFeaturesKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\timagelessFramebuffer = " << value.imagelessFramebuffer << '\n';
+ s << '}';
+ return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkFramebufferAttachmentImageInfoKHR& value)
+{
+ s << "VkFramebufferAttachmentImageInfoKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tflags = " << getImageCreateFlagsStr(value.flags) << '\n';
+ s << "\tusage = " << getImageUsageFlagsStr(value.usage) << '\n';
+ s << "\twidth = " << value.width << '\n';
+ s << "\theight = " << value.height << '\n';
+ s << "\tlayerCount = " << value.layerCount << '\n';
+ s << "\tviewFormatCount = " << value.viewFormatCount << '\n';
+ s << "\tpViewFormats = " << value.pViewFormats << '\n';
+ s << '}';
+ return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkFramebufferAttachmentsCreateInfoKHR& value)
+{
+ s << "VkFramebufferAttachmentsCreateInfoKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tattachmentImageInfoCount = " << value.attachmentImageInfoCount << '\n';
+ s << "\tpAttachmentImageInfos = " << value.pAttachmentImageInfos << '\n';
+ s << '}';
+ return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkRenderPassAttachmentBeginInfoKHR& value)
+{
+ s << "VkRenderPassAttachmentBeginInfoKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tattachmentCount = " << value.attachmentCount << '\n';
+ s << "\tpAttachments = " << value.pAttachments << '\n';
+ s << '}';
+ return s;
+}
+
std::ostream& operator<< (std::ostream& s, const VkAttachmentDescription2KHR& value)
{
s << "VkAttachmentDescription2KHR = {\n";
return s;
}
+std::ostream& operator<< (std::ostream& s, const VkPhysicalDevicePerformanceCounterFeaturesKHR& value)
+{
+ s << "VkPhysicalDevicePerformanceCounterFeaturesKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tperformanceCounterQueryPools = " << value.performanceCounterQueryPools << '\n';
+ s << "\tperformanceCounterMultipleQueryPools = " << value.performanceCounterMultipleQueryPools << '\n';
+ s << '}';
+ return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkPhysicalDevicePerformanceCounterPropertiesKHR& value)
+{
+ s << "VkPhysicalDevicePerformanceCounterPropertiesKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tallowCommandBufferQueryCopies = " << value.allowCommandBufferQueryCopies << '\n';
+ s << '}';
+ return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkPerformanceCounterKHR& value)
+{
+ s << "VkPerformanceCounterKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tunit = " << value.unit << '\n';
+ s << "\tscope = " << value.scope << '\n';
+ s << "\tstorage = " << value.storage << '\n';
+ s << "\tuuid = " << '\n' << tcu::formatArray(tcu::Format::HexIterator<deUint8>(DE_ARRAY_BEGIN(value.uuid)), tcu::Format::HexIterator<deUint8>(DE_ARRAY_END(value.uuid))) << '\n';
+ s << '}';
+ return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkPerformanceCounterDescriptionKHR& value)
+{
+ s << "VkPerformanceCounterDescriptionKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tflags = " << getPerformanceCounterDescriptionFlagsKHRStr(value.flags) << '\n';
+ s << "\tname = " << '\n' << tcu::formatArray(tcu::Format::HexIterator<char>(DE_ARRAY_BEGIN(value.name)), tcu::Format::HexIterator<char>(DE_ARRAY_END(value.name))) << '\n';
+ s << "\tcategory = " << '\n' << tcu::formatArray(tcu::Format::HexIterator<char>(DE_ARRAY_BEGIN(value.category)), tcu::Format::HexIterator<char>(DE_ARRAY_END(value.category))) << '\n';
+ s << "\tdescription = " << (const char*)value.description << '\n';
+ s << '}';
+ return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkPerformanceQueryCreateInfoKHR& value)
+{
+ s << "VkPerformanceQueryCreateInfoKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tqueueFamilyIndex = " << value.queueFamilyIndex << '\n';
+ s << "\tcounterIndexCount = " << value.counterIndexCount << '\n';
+ s << "\tpCounterIndices = " << value.pCounterIndices << '\n';
+ s << '}';
+ return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkPerformanceCounterResultKHR& value)
+{
+ s << "VkPerformanceCounterResultKHR = {\n";
+ s << "\tint32 = " << value.int32 << '\n';
+ s << "\tint64 = " << value.int64 << '\n';
+ s << "\tuint32 = " << value.uint32 << '\n';
+ s << "\tuint64 = " << value.uint64 << '\n';
+ s << "\tfloat32 = " << value.float32 << '\n';
+ s << "\tfloat64 = " << value.float64 << '\n';
+ s << '}';
+ return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkAcquireProfilingLockInfoKHR& value)
+{
+ s << "VkAcquireProfilingLockInfoKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tflags = " << getAcquireProfilingLockFlagsKHRStr(value.flags) << '\n';
+ s << "\ttimeout = " << value.timeout << '\n';
+ s << '}';
+ return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkPerformanceQuerySubmitInfoKHR& value)
+{
+ s << "VkPerformanceQuerySubmitInfoKHR = {\n";
+ s << "\tsType = " << value.sType << '\n';
+ s << "\tpNext = " << value.pNext << '\n';
+ s << "\tcounterPassIndex = " << value.counterPassIndex << '\n';
+ s << '}';
+ return s;
+}
+
std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceSurfaceInfo2KHR& value)
{
s << "VkPhysicalDeviceSurfaceInfo2KHR = {\n";
const VkPresentRegionKHR* pRegions;
};
+struct VkPhysicalDeviceImagelessFramebufferFeaturesKHR
+{
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 imagelessFramebuffer;
+};
+
+struct VkFramebufferAttachmentImageInfoKHR
+{
+ VkStructureType sType;
+ const void* pNext;
+ VkImageCreateFlags flags;
+ VkImageUsageFlags usage;
+ deUint32 width;
+ deUint32 height;
+ deUint32 layerCount;
+ deUint32 viewFormatCount;
+ const VkFormat* pViewFormats;
+};
+
+struct VkFramebufferAttachmentsCreateInfoKHR
+{
+ VkStructureType sType;
+ const void* pNext;
+ deUint32 attachmentImageInfoCount;
+ const VkFramebufferAttachmentImageInfoKHR* pAttachmentImageInfos;
+};
+
+struct VkRenderPassAttachmentBeginInfoKHR
+{
+ VkStructureType sType;
+ const void* pNext;
+ deUint32 attachmentCount;
+ const VkImageView* pAttachments;
+};
+
struct VkAttachmentDescription2KHR
{
VkStructureType sType;
VkExternalFenceHandleTypeFlagBits handleType;
};
+struct VkPhysicalDevicePerformanceCounterFeaturesKHR
+{
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 performanceCounterQueryPools;
+ VkBool32 performanceCounterMultipleQueryPools;
+};
+
+struct VkPhysicalDevicePerformanceCounterPropertiesKHR
+{
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 allowCommandBufferQueryCopies;
+};
+
+struct VkPerformanceCounterKHR
+{
+ VkStructureType sType;
+ const void* pNext;
+ VkPerformanceCounterUnitKHR unit;
+ VkPerformanceCounterScopeKHR scope;
+ VkPerformanceCounterStorageKHR storage;
+ deUint8 uuid[VK_UUID_SIZE];
+};
+
+struct VkPerformanceCounterDescriptionKHR
+{
+ VkStructureType sType;
+ const void* pNext;
+ VkPerformanceCounterDescriptionFlagsKHR flags;
+ char name[VK_MAX_DESCRIPTION_SIZE];
+ char category[VK_MAX_DESCRIPTION_SIZE];
+ char description[VK_MAX_DESCRIPTION_SIZE];
+};
+
+struct VkPerformanceQueryCreateInfoKHR
+{
+ VkStructureType sType;
+ const void* pNext;
+ deUint32 queueFamilyIndex;
+ deUint32 counterIndexCount;
+ const deUint32* pCounterIndices;
+};
+
+union VkPerformanceCounterResultKHR
+{
+ deInt32 int32;
+ deInt64 int64;
+ deUint32 uint32;
+ deUint64 uint64;
+ float float32;
+ double float64;
+};
+
+struct VkAcquireProfilingLockInfoKHR
+{
+ VkStructureType sType;
+ const void* pNext;
+ VkAcquireProfilingLockFlagsKHR flags;
+ deUint64 timeout;
+};
+
+struct VkPerformanceQuerySubmitInfoKHR
+{
+ VkStructureType sType;
+ const void* pNext;
+ deUint32 counterPassIndex;
+};
+
struct VkPhysicalDeviceSurfaceInfo2KHR
{
VkStructureType sType;
};
SpirvValidatorOptions(deUint32 the_vulkan_version = VK_MAKE_VERSION(1, 0, 0), BlockLayoutRules the_layout = kDefaultBlockLayout)
- : vulkanVersion(the_vulkan_version), blockLayout(the_layout) {}
+ : vulkanVersion(the_vulkan_version), blockLayout(the_layout), supports_VK_KHR_spirv_1_4(false) {}
// The target Vulkan version. This determines the SPIR-V environment rules to
// be checked. The bit pattern is as produced by VK_MAKE_VERSION.
// The block layout rules to enforce.
BlockLayoutRules blockLayout;
+
+ // Does the device support VK_KHR_spirv_1_4?
+ // (Camelcase would just be wrong here.)
+ bool supports_VK_KHR_spirv_1_4;
};
} // namespace vk
virtual VkResult getSwapchainStatusKHR (VkDevice device, VkSwapchainKHR swapchain) const = 0;
virtual VkResult importFenceFdKHR (VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo) const = 0;
virtual VkResult getFenceFdKHR (VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd) const = 0;
+virtual VkResult acquireProfilingLockKHR (VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo) const = 0;
+virtual void releaseProfilingLockKHR (VkDevice device) const = 0;
virtual void cmdDrawIndirectCountKHR (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, deUint32 maxDrawCount, deUint32 stride) const = 0;
virtual void cmdDrawIndexedIndirectCountKHR (VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, deUint32 maxDrawCount, deUint32 stride) const = 0;
virtual VkResult debugMarkerSetObjectTagEXT (VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo) const = 0;
virtual VkResult createDisplayModeKHR (VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode) const = 0;
virtual VkResult getDisplayPlaneCapabilitiesKHR (VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, deUint32 planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities) const = 0;
virtual VkResult createDisplayPlaneSurfaceKHR (VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const = 0;
+virtual void enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR (VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) const = 0;
+virtual void getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR (VkPhysicalDevice physicalDevice, const VkPerformanceQueryCreateInfoKHR* pPerformanceQueryCreateInfo, deUint32* pNumPasses) const = 0;
virtual VkResult getPhysicalDeviceSurfaceCapabilities2KHR (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities) const = 0;
virtual VkResult getPhysicalDeviceSurfaceFormats2KHR (VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, deUint32* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats) const = 0;
virtual VkResult getPhysicalDeviceDisplayProperties2KHR (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkDisplayProperties2KHR* pProperties) const = 0;
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT = 1000102000,
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT = 1000102001,
VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR = 1000108000,
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR = 1000108001,
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR = 1000108002,
+ VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR = 1000108003,
VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR = 1000109000,
VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR = 1000109001,
VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR = 1000109002,
VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR = 1000114002,
VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR = 1000115000,
VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR = 1000115001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_FEATURES_KHR = 1000116000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_PROPERTIES_KHR = 1000116001,
+ VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_CREATE_INFO_KHR = 1000116002,
+ VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR = 1000116003,
+ VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR = 1000116004,
+ VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR = 1000116005,
+ VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR = 1000116006,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = 1000119000,
VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001,
VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002,
VK_QUERY_TYPE_PIPELINE_STATISTICS = 1,
VK_QUERY_TYPE_TIMESTAMP = 2,
VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT = 1000028004,
+ VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR = 1000116000,
VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV = 1000165000,
VK_QUERY_TYPE_BEGIN_RANGE = VK_QUERY_TYPE_OCCLUSION,
VK_QUERY_TYPE_END_RANGE = VK_QUERY_TYPE_TIMESTAMP,
} VkDescriptorPoolCreateFlagBits;
typedef VkFlags VkDescriptorPoolCreateFlags;
typedef VkFlags VkDescriptorPoolResetFlags;
+
+typedef enum VkFramebufferCreateFlagBits {
+ VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR = 0x00000001,
+ VK_FRAMEBUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkFramebufferCreateFlagBits;
typedef VkFlags VkFramebufferCreateFlags;
typedef VkFlags VkRenderPassCreateFlags;
const void* pData);
#endif
+#define VK_KHR_imageless_framebuffer 1
+#define VK_KHR_IMAGELESS_FRAMEBUFFER_SPEC_VERSION 1
+#define VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME "VK_KHR_imageless_framebuffer"
+
+typedef struct VkPhysicalDeviceImagelessFramebufferFeaturesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 imagelessFramebuffer;
+} VkPhysicalDeviceImagelessFramebufferFeaturesKHR;
+
+typedef struct VkFramebufferAttachmentImageInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkImageCreateFlags flags;
+ VkImageUsageFlags usage;
+ deUint32 width;
+ deUint32 height;
+ deUint32 layerCount;
+ deUint32 viewFormatCount;
+ const VkFormat* pViewFormats;
+} VkFramebufferAttachmentImageInfoKHR;
+
+typedef struct VkFramebufferAttachmentsCreateInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ deUint32 attachmentImageInfoCount;
+ const VkFramebufferAttachmentImageInfoKHR* pAttachmentImageInfos;
+} VkFramebufferAttachmentsCreateInfoKHR;
+
+typedef struct VkRenderPassAttachmentBeginInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ deUint32 attachmentCount;
+ const VkImageView* pAttachments;
+} VkRenderPassAttachmentBeginInfoKHR;
+
+
#define VK_KHR_create_renderpass2 1
#define VK_KHR_CREATE_RENDERPASS_2_SPEC_VERSION 1
#endif
+#define VK_KHR_performance_query 1
+#define VK_KHR_PERFORMANCE_QUERY_SPEC_VERSION 1
+#define VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME "VK_KHR_performance_query"
+
+
+typedef enum VkPerformanceCounterUnitKHR {
+ VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR = 0,
+ VK_PERFORMANCE_COUNTER_UNIT_PERCENTAGE_KHR = 1,
+ VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR = 2,
+ VK_PERFORMANCE_COUNTER_UNIT_BYTES_KHR = 3,
+ VK_PERFORMANCE_COUNTER_UNIT_BYTES_PER_SECOND_KHR = 4,
+ VK_PERFORMANCE_COUNTER_UNIT_KELVIN_KHR = 5,
+ VK_PERFORMANCE_COUNTER_UNIT_WATTS_KHR = 6,
+ VK_PERFORMANCE_COUNTER_UNIT_VOLTS_KHR = 7,
+ VK_PERFORMANCE_COUNTER_UNIT_AMPS_KHR = 8,
+ VK_PERFORMANCE_COUNTER_UNIT_HERTZ_KHR = 9,
+ VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR = 10,
+ VK_PERFORMANCE_COUNTER_UNIT_BEGIN_RANGE_KHR = VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR,
+ VK_PERFORMANCE_COUNTER_UNIT_END_RANGE_KHR = VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR,
+ VK_PERFORMANCE_COUNTER_UNIT_RANGE_SIZE_KHR = (VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR - VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR + 1),
+ VK_PERFORMANCE_COUNTER_UNIT_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkPerformanceCounterUnitKHR;
+
+typedef enum VkPerformanceCounterScopeKHR {
+ VK_QUERY_SCOPE_COMMAND_BUFFER_KHR = 0,
+ VK_QUERY_SCOPE_RENDER_PASS_KHR = 1,
+ VK_QUERY_SCOPE_COMMAND_KHR = 2,
+ VK_PERFORMANCE_COUNTER_SCOPE_BEGIN_RANGE_KHR = VK_QUERY_SCOPE_COMMAND_BUFFER_KHR,
+ VK_PERFORMANCE_COUNTER_SCOPE_END_RANGE_KHR = VK_QUERY_SCOPE_COMMAND_KHR,
+ VK_PERFORMANCE_COUNTER_SCOPE_RANGE_SIZE_KHR = (VK_QUERY_SCOPE_COMMAND_KHR - VK_QUERY_SCOPE_COMMAND_BUFFER_KHR + 1),
+ VK_PERFORMANCE_COUNTER_SCOPE_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkPerformanceCounterScopeKHR;
+
+typedef enum VkPerformanceCounterStorageKHR {
+ VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR = 0,
+ VK_PERFORMANCE_COUNTER_STORAGE_INT64_KHR = 1,
+ VK_PERFORMANCE_COUNTER_STORAGE_UINT32_KHR = 2,
+ VK_PERFORMANCE_COUNTER_STORAGE_UINT64_KHR = 3,
+ VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR = 4,
+ VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR = 5,
+ VK_PERFORMANCE_COUNTER_STORAGE_BEGIN_RANGE_KHR = VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR,
+ VK_PERFORMANCE_COUNTER_STORAGE_END_RANGE_KHR = VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR,
+ VK_PERFORMANCE_COUNTER_STORAGE_RANGE_SIZE_KHR = (VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR - VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR + 1),
+ VK_PERFORMANCE_COUNTER_STORAGE_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkPerformanceCounterStorageKHR;
+
+
+typedef enum VkPerformanceCounterDescriptionFlagBitsKHR {
+ VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_KHR = 0x00000001,
+ VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_KHR = 0x00000002,
+ VK_PERFORMANCE_COUNTER_DESCRIPTION_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkPerformanceCounterDescriptionFlagBitsKHR;
+typedef VkFlags VkPerformanceCounterDescriptionFlagsKHR;
+typedef VkFlags VkAcquireProfilingLockFlagsKHR;
+
+typedef struct VkPhysicalDevicePerformanceCounterFeaturesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 performanceCounterQueryPools;
+ VkBool32 performanceCounterMultipleQueryPools;
+} VkPhysicalDevicePerformanceCounterFeaturesKHR;
+
+typedef struct VkPhysicalDevicePerformanceCounterPropertiesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 allowCommandBufferQueryCopies;
+} VkPhysicalDevicePerformanceCounterPropertiesKHR;
+
+typedef struct VkPerformanceCounterKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkPerformanceCounterUnitKHR unit;
+ VkPerformanceCounterScopeKHR scope;
+ VkPerformanceCounterStorageKHR storage;
+ deUint8 uuid[VK_UUID_SIZE];
+} VkPerformanceCounterKHR;
+
+typedef struct VkPerformanceCounterDescriptionKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkPerformanceCounterDescriptionFlagsKHR flags;
+ char name[VK_MAX_DESCRIPTION_SIZE];
+ char category[VK_MAX_DESCRIPTION_SIZE];
+ char description[VK_MAX_DESCRIPTION_SIZE];
+} VkPerformanceCounterDescriptionKHR;
+
+typedef struct VkPerformanceQueryCreateInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ deUint32 queueFamilyIndex;
+ deUint32 counterIndexCount;
+ const deUint32* pCounterIndices;
+} VkPerformanceQueryCreateInfoKHR;
+
+typedef union VkPerformanceCounterResultKHR {
+ deInt32 int32;
+ deInt64 int64;
+ deUint32 uint32;
+ deUint64 uint64;
+ float float32;
+ double float64;
+} VkPerformanceCounterResultKHR;
+
+typedef struct VkAcquireProfilingLockInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkAcquireProfilingLockFlagsKHR flags;
+ deUint64 timeout;
+} VkAcquireProfilingLockInfoKHR;
+
+typedef struct VkPerformanceQuerySubmitInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ deUint32 counterPassIndex;
+} VkPerformanceQuerySubmitInfoKHR;
+
+
+typedef void (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)(VkPhysicalDevice physicalDevice, deUint32 queueFamilyIndex, deUint32* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions);
+typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR)(VkPhysicalDevice physicalDevice, const VkPerformanceQueryCreateInfoKHR* pPerformanceQueryCreateInfo, deUint32* pNumPasses);
+typedef VkResult (VKAPI_PTR *PFN_vkAcquireProfilingLockKHR)(VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo);
+typedef void (VKAPI_PTR *PFN_vkReleaseProfilingLockKHR)(VkDevice device);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
+ VkPhysicalDevice physicalDevice,
+ deUint32 queueFamilyIndex,
+ deUint32* pCounterCount,
+ VkPerformanceCounterKHR* pCounters,
+ VkPerformanceCounterDescriptionKHR* pCounterDescriptions);
+
+VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(
+ VkPhysicalDevice physicalDevice,
+ const VkPerformanceQueryCreateInfoKHR* pPerformanceQueryCreateInfo,
+ deUint32* pNumPasses);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkAcquireProfilingLockKHR(
+ VkDevice device,
+ const VkAcquireProfilingLockInfoKHR* pInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkReleaseProfilingLockKHR(
+ VkDevice device);
+#endif
+
#define VK_KHR_maintenance2 1
#define VK_KHR_MAINTENANCE2_SPEC_VERSION 1
#define VK_KHR_MAINTENANCE2_EXTENSION_NAME "VK_KHR_maintenance2"
} VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV;
-
#define VK_EXT_buffer_device_address 1
typedef deUint64 VkDeviceAddress;
#define VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION 2
add_subdirectory(transform_feedback)
add_subdirectory(util)
add_subdirectory(amber)
+add_subdirectory(imageless_framebuffer)
add_subdirectory(descriptor_indexing)
include_directories(
transform_feedback
util
amber
+ imageless_framebuffer
descriptor_indexing
)
deqp-vk-protected-memory
deqp-vk-memory-model
deqp-vk-amber
+ deqp-vk-imageless-framebuffer
deqp-vk-transform-feedback
deqp-vk-descriptor-indexing
)
#include "vktAmberHelper.hpp"
#include "tcuResource.hpp"
#include "tcuTestLog.hpp"
+#include "vkSpirVProgram.hpp"
namespace vkt
{
if (shader.format == amber::kShaderFormatSpirvAsm)
{
- programCollection.spirvAsmSources.add(shader.shader_name) << shader.shader_source;
+ programCollection.spirvAsmSources.add(shader.shader_name) << shader.shader_source << m_asm_options;
}
else if (shader.format == amber::kShaderFormatGlsl)
{
return r.IsSuccess() ? tcu::TestStatus::pass("Pass") :tcu::TestStatus::fail("Fail");
}
+void AmberTestCase::setSpirVAsmBuildOptions(const vk::SpirVAsmBuildOptions& asm_options)
+{
+ m_asm_options = asm_options;
+}
+
void AmberTestCase::addRequirement(const std::string& requirement)
{
if (requirement.find(".") != std::string::npos)
#include "amber/recipe.h"
#include "tcuDefs.hpp"
#include "tcuTestCase.hpp"
+#include "vkSpirVProgram.hpp"
#include "vktTestCase.hpp"
namespace vkt
bool parse(const char* category, const std::string& filename);
void initPrograms(vk::SourceCollections& programCollection) const;
+ // If the test case uses SPIR-V Assembly, use these build options.
+ // Otherwise, defaults to target Vulkan 1.0, SPIR-V 1.0.
+ void setSpirVAsmBuildOptions(const vk::SpirVAsmBuildOptions& asm_options);
// Add a required instance extension, device extension, or feature bit.
// A feature bit is represented by a string of form "<structure>.<feature>", where
private:
amber::Recipe* m_recipe;
+ vk::SpirVAsmBuildOptions m_asm_options;
// Instance and device extensions required by the test.
// We don't differentiate between the two: We consider the requirement
*//*--------------------------------------------------------------------*/
#include "vktTestGroupUtil.hpp"
+#include "vktAmberTestCase.hpp"
namespace vkt
{
namespace cts_amber
{
-class AmberTestCase : public tcu::TestNode
-{
-};
-
AmberTestCase* createAmberTestCase (tcu::TestContext& testCtx,
const char* name,
const char* description,
const bool khr_8bit_storage = checkExtension(properties,"VK_KHR_8bit_storage");
const bool ext_conditional_rendering = checkExtension(properties,"VK_EXT_conditional_rendering");
const bool scalar_block_layout = checkExtension(properties,"VK_EXT_scalar_block_layout");
+ const bool performance_counter = checkExtension(properties,"VK_KHR_performance_query");
bool khr_16bit_storage = true;
bool khr_multiview = true;
bool deviceProtectedMemory = true;
VkPhysicalDeviceSamplerYcbcrConversionFeatures samplerYcbcrConversionFeatures[count];
VkPhysicalDeviceVariablePointersFeatures variablePointerFeatures[count];
VkPhysicalDeviceScalarBlockLayoutFeaturesEXT scalarBlockLayoutFeatures[count];
+ VkPhysicalDevicePerformanceCounterFeaturesKHR performanceCounterFeatures[count];
for (int ndx = 0; ndx < count; ++ndx)
{
deMemset(&samplerYcbcrConversionFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceSamplerYcbcrConversionFeatures));
deMemset(&variablePointerFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceVariablePointersFeatures));
deMemset(&scalarBlockLayoutFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDeviceScalarBlockLayoutFeaturesEXT));
+ deMemset(&performanceCounterFeatures[ndx], 0xFF*ndx, sizeof(VkPhysicalDevicePerformanceCounterFeaturesKHR));
device8BitStorageFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR;
device8BitStorageFeatures[ndx].pNext = &deviceConditionalRenderingFeatures[ndx];
variablePointerFeatures[ndx].pNext = &scalarBlockLayoutFeatures[ndx];
scalarBlockLayoutFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT;
- scalarBlockLayoutFeatures[ndx].pNext = DE_NULL;
+ scalarBlockLayoutFeatures[ndx].pNext = &performanceCounterFeatures[ndx];
+
+ performanceCounterFeatures[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_FEATURES_KHR;
+ performanceCounterFeatures[ndx].pNext = DE_NULL;
deMemset(&extFeatures.features, 0xcd, sizeof(extFeatures.features));
extFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
{
TCU_FAIL("Mismatch between VkPhysicalDeviceScalarBlockLayoutFeaturesEXT");
}
+ if (performance_counter &&
+ ((performanceCounterFeatures[0].performanceCounterQueryPools != performanceCounterFeatures[1].performanceCounterQueryPools) ||
+ (performanceCounterFeatures[0].performanceCounterMultipleQueryPools != performanceCounterFeatures[1].performanceCounterMultipleQueryPools)))
+ {
+ TCU_FAIL("Mismatch between VkPhysicalDevicePerformanceCounterFeaturesKHR");
+ }
if (khr_8bit_storage)
log << TestLog::Message << device8BitStorageFeatures[0] << TestLog::EndMessage;
if (ext_conditional_rendering)
log << TestLog::Message << variablePointerFeatures[0] << TestLog::EndMessage;
if (scalar_block_layout)
log << TestLog::Message << scalarBlockLayoutFeatures[0] << TestLog::EndMessage;
+ if (performance_counter)
+ log << TestLog::Message << performanceCounterFeatures[0] << TestLog::EndMessage;
return tcu::TestStatus::pass("Querying device features succeeded");
}
-
tcu::TestStatus deviceProperties2 (Context& context)
{
const PlatformInterface& vkp = context.getPlatformInterface();
log << TestLog::Message << dsResolveProperties[0] << TestLog::EndMessage;
}
+ if (isExtensionSupported(extensions, RequiredExtension("VK_KHR_performance_query")))
+ {
+ VkPhysicalDevicePerformanceCounterPropertiesKHR performanceCounterProperties[count];
+
+ for (int ndx = 0; ndx < count; ++ndx)
+ {
+ deMemset(&performanceCounterProperties[ndx], 0xFF, sizeof(VkPhysicalDevicePerformanceCounterPropertiesKHR));
+ performanceCounterProperties[ndx].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_PROPERTIES_KHR;
+ performanceCounterProperties[ndx].pNext = DE_NULL;
+
+ extProperties.pNext = &performanceCounterProperties[ndx];
+
+ vki.getPhysicalDeviceProperties2(physicalDevice, &extProperties);
+ }
+
+ if (deMemCmp(&performanceCounterProperties[0], &performanceCounterProperties[1], sizeof(VkPhysicalDevicePerformanceCounterPropertiesKHR)) != 0)
+ {
+ TCU_FAIL("Mismatch in VkPhysicalDevicePerformanceCounterPropertiesKHR");
+ }
+
+ log << TestLog::Message << performanceCounterProperties[0] << TestLog::EndMessage;
+ }
+
if (isExtensionSupported(extensions, RequiredExtension("VK_EXT_pci_bus_info", 2, 2)))
{
VkPhysicalDevicePCIBusInfoPropertiesEXT pciBusInfoProperties[count];
--- /dev/null
+include_directories(..)
+
+set(DEQP_VK_IMAGELESS_FRAMEBUFFER_SRCS
+ vktImagelessFramebufferTests.hpp
+ vktImagelessFramebufferTests.cpp
+)
+
+set(DEQP_VK_IMAGELESS_FRAMEBUFFER_LIBS
+ tcutil
+ vkutil
+)
+
+PCH(DEQP_VK_IMAGELESS_FRAMEBUFFER_SRCS ../pch.cpp)
+
+add_library(deqp-vk-imageless-framebuffer STATIC ${DEQP_VK_IMAGELESS_FRAMEBUFFER_SRCS})
+target_link_libraries(deqp-vk-imageless-framebuffer ${DEQP_VK_IMAGELESS_FRAMEBUFFER_LIBS})
--- /dev/null
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2019 The Khronos Group 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.
+ *
+ *//*!
+ * \file
+ * \brief Vulkan Imageless Framebuffer Tests
+ *//*--------------------------------------------------------------------*/
+
+#include "vktImagelessFramebufferTests.hpp"
+#include "vktTestGroupUtil.hpp"
+#include "vktTestCase.hpp"
+
+#include "deUniquePtr.hpp"
+#include "deRandom.hpp"
+
+#include "tcuTextureUtil.hpp"
+#include "tcuVectorUtil.hpp"
+#include "tcuImageCompare.hpp"
+#include "tcuRGBA.hpp"
+
+#include "vkCmdUtil.hpp"
+#include "vkImageUtil.hpp"
+#include "vkObjUtil.hpp"
+#include "vkQueryUtil.hpp"
+#include "vkRefUtil.hpp"
+#include "vkTypeUtil.hpp"
+#include "vkBuilderUtil.hpp"
+
+#include <iostream>
+
+namespace vkt
+{
+namespace imageless
+{
+
+namespace
+{
+using namespace vk;
+using de::MovePtr;
+using de::UniquePtr;
+using de::SharedPtr;
+
+typedef SharedPtr<Unique<VkPipeline> > SharedPtrVkPipeline;
+
+enum TestType
+{
+ TEST_TYPE_COLOR = 0,
+ TEST_TYPE_DEPTH_STENCIL,
+ TEST_TYPE_COLOR_RESOLVE,
+ TEST_TYPE_DEPTH_STENCIL_RESOLVE,
+ TEST_TYPE_MULTISUBPASS,
+ TEST_TYPE_LAST
+};
+
+enum AspectFlagBits
+{
+ ASPECT_NONE = 0,
+ ASPECT_COLOR = (1<<0),
+ ASPECT_DEPTH = (1<<1),
+ ASPECT_STENCIL = (1<<2),
+ ASPECT_DEPTH_STENCIL = ASPECT_DEPTH | ASPECT_STENCIL,
+};
+typedef deUint32 AspectFlags;
+
+const deUint32 NO_SAMPLE = static_cast<deUint32>(-1);
+const deUint32 NO_SUBPASS = static_cast<deUint32>(-1);
+
+struct TestParameters
+{
+ TestType testType;
+ VkFormat colorFormat;
+ VkFormat dsFormat;
+};
+
+template<typename T>
+inline SharedPtr<Unique<T> > makeSharedPtr (Move<T> move)
+{
+ return SharedPtr<Unique<T> >(new Unique<T>(move));
+}
+
+VkSampleCountFlagBits sampleCountBitFromSampleCount (deUint32 count)
+{
+ switch (count)
+ {
+ case 1: return VK_SAMPLE_COUNT_1_BIT;
+ case 2: return VK_SAMPLE_COUNT_2_BIT;
+ case 4: return VK_SAMPLE_COUNT_4_BIT;
+ case 8: return VK_SAMPLE_COUNT_8_BIT;
+ case 16: return VK_SAMPLE_COUNT_16_BIT;
+ case 32: return VK_SAMPLE_COUNT_32_BIT;
+ case 64: return VK_SAMPLE_COUNT_64_BIT;
+
+ default:
+ DE_FATAL("Invalid sample count");
+ return (VkSampleCountFlagBits)0x0;
+ }
+}
+
+VkAttachmentReference2KHR convertAttachmentReference (const VkAttachmentReference& attachmentReference, const VkImageAspectFlags aspectMask)
+{
+ const VkAttachmentReference2KHR attachmentReference2 =
+ {
+ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ attachmentReference.attachment, // deUint32 attachment;
+ attachmentReference.layout, // VkImageLayout layout;
+ aspectMask // VkImageAspectFlags aspectMask;
+ };
+
+ return attachmentReference2;
+}
+
+std::vector<VkAttachmentDescription2KHR> convertAttachmentDescriptions (const std::vector<VkAttachmentDescription>& attachmentDescriptions)
+{
+ std::vector<VkAttachmentDescription2KHR> attachmentDescriptions2;
+
+ attachmentDescriptions2.reserve(attachmentDescriptions.size());
+
+ for (size_t adNdx = 0; adNdx < attachmentDescriptions.size(); ++adNdx)
+ {
+ const VkAttachmentDescription& attachmentDescription = attachmentDescriptions[adNdx];
+ const VkAttachmentDescription2KHR attachmentDescription2 =
+ {
+ VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ attachmentDescription.flags, // VkAttachmentDescriptionFlags flags;
+ attachmentDescription.format, // VkFormat format;
+ attachmentDescription.samples, // VkSampleCountFlagBits samples;
+ attachmentDescription.loadOp, // VkAttachmentLoadOp loadOp;
+ attachmentDescription.storeOp, // VkAttachmentStoreOp storeOp;
+ attachmentDescription.stencilLoadOp, // VkAttachmentLoadOp stencilLoadOp;
+ attachmentDescription.stencilStoreOp, // VkAttachmentStoreOp stencilStoreOp;
+ attachmentDescription.initialLayout, // VkImageLayout initialLayout;
+ attachmentDescription.finalLayout, // VkImageLayout finalLayout;
+ };
+
+ attachmentDescriptions2.push_back(attachmentDescription2);
+ }
+
+ return attachmentDescriptions2;
+}
+
+Move<VkPipelineLayout> makePipelineLayout (const DeviceInterface& vk,
+ const VkDevice device,
+ const deUint32 setLayoutCount = 0,
+ const VkDescriptorSetLayout* pSetLayouts = DE_NULL)
+{
+ const VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo =
+ {
+ VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkPipelineLayoutCreateFlags)0, // VkPipelineLayoutCreateFlags flags;
+ setLayoutCount, // deUint32 setLayoutCount;
+ pSetLayouts, // const VkDescriptorSetLayout* pSetLayouts;
+ 0u, // deUint32 pushConstantRangeCount;
+ DE_NULL, // const VkPushConstantRange* pPushConstantRanges;
+ };
+
+ return createPipelineLayout(vk, device, &pipelineLayoutCreateInfo);
+}
+
+Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface& vk,
+ const VkDevice device,
+ const VkPipelineLayout pipelineLayout,
+ const VkRenderPass renderPass,
+ const VkShaderModule vertexModule,
+ const VkShaderModule fragmendModule,
+ const VkExtent2D renderSize,
+ const AspectFlags depthStencilAspects = ASPECT_NONE,
+ const VkSampleCountFlagBits sampleCountBits = VK_SAMPLE_COUNT_1_BIT,
+ const deUint32 subpass = 0)
+{
+ const bool useDepth = (depthStencilAspects & ASPECT_DEPTH) != 0;
+ const bool useStencil = (depthStencilAspects & ASPECT_STENCIL) != 0;
+ const std::vector<VkViewport> viewports (1, makeViewport(renderSize));
+ const std::vector<VkRect2D> scissors (1, makeRect2D(renderSize));
+ const VkStencilOpState stencilOpState =
+ {
+ VK_STENCIL_OP_KEEP, // VkStencilOp failOp;
+ VK_STENCIL_OP_INCREMENT_AND_CLAMP, // VkStencilOp passOp;
+ VK_STENCIL_OP_KEEP, // VkStencilOp depthFailOp;
+ VK_COMPARE_OP_ALWAYS, // VkCompareOp compareOp;
+ ~0u, // deUint32 compareMask;
+ ~0u, // deUint32 writeMask;
+ 0u // deUint32 reference;
+ };
+ const VkPipelineDepthStencilStateCreateInfo pipelineDepthStencilStateInfo =
+ {
+ VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkPipelineDepthStencilStateCreateFlags)0, // VkPipelineDepthStencilStateCreateFlags flags;
+ useDepth ? VK_TRUE : VK_FALSE, // VkBool32 depthTestEnable;
+ useDepth ? VK_TRUE : VK_FALSE, // VkBool32 depthWriteEnable;
+ VK_COMPARE_OP_LESS, // VkCompareOp depthCompareOp;
+ VK_FALSE, // VkBool32 depthBoundsTestEnable;
+ useStencil ? VK_TRUE : VK_FALSE, // VkBool32 stencilTestEnable;
+ stencilOpState, // VkStencilOpState front;
+ stencilOpState, // VkStencilOpState back;
+ 0.0f, // float minDepthBounds;
+ 1.0f // float maxDepthBounds;
+ };
+ const VkPipelineMultisampleStateCreateInfo multisampleState =
+ {
+ VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkPipelineMultisampleStateCreateFlags)0u, // VkPipelineMultisampleStateCreateFlags flags;
+ sampleCountBits, // VkSampleCountFlagBits rasterizationSamples;
+ VK_FALSE, // VkBool32 sampleShadingEnable;
+ 0.0f, // float minSampleShading;
+ DE_NULL, // const VkSampleMask* pSampleMask;
+ VK_FALSE, // VkBool32 alphaToCoverageEnable;
+ VK_FALSE, // VkBool32 alphaToOneEnable;
+ };
+
+ return makeGraphicsPipeline(vk, // const DeviceInterface& vk
+ device, // const VkDevice device
+ pipelineLayout, // const VkPipelineLayout pipelineLayout
+ vertexModule, // const VkShaderModule vertexShaderModule
+ DE_NULL, // const VkShaderModule tessellationControlModule
+ DE_NULL, // const VkShaderModule tessellationEvalModule
+ DE_NULL, // const VkShaderModule geometryShaderModule
+ fragmendModule, // const VkShaderModule fragmentShaderModule
+ renderPass, // const VkRenderPass renderPass
+ viewports, // const std::vector<VkViewport>& viewports
+ scissors, // const std::vector<VkRect2D>& scissors
+ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,// const VkPrimitiveTopology topology
+ subpass, // const deUint32 subpass
+ 0u, // const deUint32 patchControlPoints
+ DE_NULL, // const VkPipelineVertexInputStateCreateInfo* vertexInputStateCreateInfo
+ DE_NULL, // const VkPipelineRasterizationStateCreateInfo* rasterizationStateCreateInfo
+ &multisampleState, // const VkPipelineMultisampleStateCreateInfo* multisampleStateCreateInfo
+ &pipelineDepthStencilStateInfo); // const VkPipelineDepthStencilStateCreateInfo* depthStencilStateCreateInfo
+}
+
+Move<VkRenderPass> makeRenderPass (const DeviceInterface& vk,
+ const VkDevice device,
+ const VkFormat colorFormat,
+ const VkFormat depthStencilFormat,
+ const VkSampleCountFlagBits colorSamples,
+ const VkSampleCountFlagBits depthStencilSamples = VK_SAMPLE_COUNT_1_BIT,
+ const VkAttachmentLoadOp loadOperation = VK_ATTACHMENT_LOAD_OP_CLEAR,
+ const VkImageLayout finalLayoutColor = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
+ const VkImageLayout finalLayoutDepthStencil = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
+ const VkImageLayout subpassLayoutColor = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
+ const VkImageLayout subpassLayoutDepthStencil = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
+ const VkAllocationCallbacks* const allocationCallbacks = DE_NULL)
+{
+ const bool hasColor = colorFormat != VK_FORMAT_UNDEFINED;
+ const bool hasDepthStencil = depthStencilFormat != VK_FORMAT_UNDEFINED;
+ const bool hasColorResolve = hasColor && (colorSamples != VK_SAMPLE_COUNT_1_BIT);
+ const bool hasDepthStencilResolve = hasDepthStencil && (depthStencilSamples != VK_SAMPLE_COUNT_1_BIT);
+ const VkImageLayout initialLayoutColor = loadOperation == VK_ATTACHMENT_LOAD_OP_LOAD ? VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL : VK_IMAGE_LAYOUT_UNDEFINED;
+ const VkImageLayout initialLayoutDepthStencil = loadOperation == VK_ATTACHMENT_LOAD_OP_LOAD ? VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL : VK_IMAGE_LAYOUT_UNDEFINED;
+ const VkAttachmentDescription colorAttachmentDescription =
+ {
+ (VkAttachmentDescriptionFlags)0, // VkAttachmentDescriptionFlags flags;
+ colorFormat, // VkFormat format;
+ colorSamples, // VkSampleCountFlagBits samples;
+ loadOperation, // VkAttachmentLoadOp loadOp;
+ VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp storeOp;
+ VK_ATTACHMENT_LOAD_OP_DONT_CARE, // VkAttachmentLoadOp stencilLoadOp;
+ VK_ATTACHMENT_STORE_OP_DONT_CARE, // VkAttachmentStoreOp stencilStoreOp;
+ initialLayoutColor, // VkImageLayout initialLayout;
+ finalLayoutColor // VkImageLayout finalLayout;
+ };
+ const VkAttachmentDescription depthStencilAttachmentDescription =
+ {
+ (VkAttachmentDescriptionFlags)0, // VkAttachmentDescriptionFlags flags;
+ depthStencilFormat, // VkFormat format;
+ depthStencilSamples, // VkSampleCountFlagBits samples;
+ loadOperation, // VkAttachmentLoadOp loadOp;
+ VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp storeOp;
+ loadOperation, // VkAttachmentLoadOp stencilLoadOp;
+ VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp stencilStoreOp;
+ initialLayoutDepthStencil, // VkImageLayout initialLayout;
+ finalLayoutDepthStencil // VkImageLayout finalLayout;
+ };
+ const VkAttachmentDescription colorResolveAttachmentDescription =
+ {
+ (VkAttachmentDescriptionFlags)0, // VkAttachmentDescriptionFlags flags;
+ colorFormat, // VkFormat format;
+ VK_SAMPLE_COUNT_1_BIT, // VkSampleCountFlagBits samples;
+ VK_ATTACHMENT_LOAD_OP_LOAD, // VkAttachmentLoadOp loadOp;
+ VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp storeOp;
+ VK_ATTACHMENT_LOAD_OP_DONT_CARE, // VkAttachmentLoadOp stencilLoadOp;
+ VK_ATTACHMENT_STORE_OP_DONT_CARE, // VkAttachmentStoreOp stencilStoreOp;
+ initialLayoutColor, // VkImageLayout initialLayout;
+ finalLayoutColor // VkImageLayout finalLayout;
+ };
+ const VkAttachmentDescription depthStencilResolveAttachmentDescription =
+ {
+ (VkAttachmentDescriptionFlags)0, // VkAttachmentDescriptionFlags flags;
+ depthStencilFormat, // VkFormat format;
+ VK_SAMPLE_COUNT_1_BIT, // VkSampleCountFlagBits samples;
+ VK_ATTACHMENT_LOAD_OP_LOAD, // VkAttachmentLoadOp loadOp;
+ VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp storeOp;
+ VK_ATTACHMENT_LOAD_OP_LOAD, // VkAttachmentLoadOp stencilLoadOp;
+ VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp stencilStoreOp;
+ initialLayoutDepthStencil, // VkImageLayout initialLayout;
+ finalLayoutDepthStencil // VkImageLayout finalLayout;
+ };
+ std::vector<VkAttachmentDescription> attachmentDescriptions;
+
+ if (hasColor)
+ attachmentDescriptions.push_back(colorAttachmentDescription);
+ if (hasDepthStencil)
+ attachmentDescriptions.push_back(depthStencilAttachmentDescription);
+ if (hasColorResolve)
+ attachmentDescriptions.push_back(colorResolveAttachmentDescription);
+ if (hasDepthStencilResolve)
+ attachmentDescriptions.push_back(depthStencilResolveAttachmentDescription);
+
+ deUint32 attachmentCounter = 0;
+ const VkAttachmentReference colorAttachmentRef =
+ {
+ hasColor ? attachmentCounter++ : 0u, // deUint32 attachment;
+ subpassLayoutColor // VkImageLayout layout;
+ };
+ const VkAttachmentReference depthStencilAttachmentRef =
+ {
+ hasDepthStencil ? attachmentCounter++ : 0u, // deUint32 attachment;
+ subpassLayoutDepthStencil // VkImageLayout layout;
+ };
+ const VkAttachmentReference colorResolveAttachmentRef =
+ {
+ hasColorResolve ? attachmentCounter++ : 0u, // deUint32 attachment;
+ subpassLayoutColor // VkImageLayout layout;
+ };
+
+ if (hasDepthStencilResolve)
+ {
+ const VkImageAspectFlags colorAspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ const VkImageAspectFlags depthStencilAspectMask = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
+ const VkAttachmentReference2KHR colorAttachmentRef2 = convertAttachmentReference(colorAttachmentRef, colorAspectMask);
+ const VkAttachmentReference2KHR depthStencilAttachmentRef2 = convertAttachmentReference(depthStencilAttachmentRef, depthStencilAspectMask);
+ const VkAttachmentReference2KHR colorResolveAttachmentRef2 = convertAttachmentReference(colorResolveAttachmentRef, colorAspectMask);
+ const VkAttachmentReference2KHR depthStencilResolveAttachmentRef2 =
+ {
+ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ hasDepthStencilResolve ? attachmentCounter++ : 0u, // deUint32 attachment;
+ subpassLayoutDepthStencil, // VkImageLayout layout;
+ depthStencilAspectMask // VkImageAspectFlags aspectMask;
+ };
+ const VkSubpassDescriptionDepthStencilResolveKHR subpassDescriptionDepthStencilResolve =
+ {
+ VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ VK_RESOLVE_MODE_AVERAGE_BIT_KHR, // VkResolveModeFlagBitsKHR depthResolveMode;
+ VK_RESOLVE_MODE_MAX_BIT_KHR, // VkResolveModeFlagBitsKHR stencilResolveMode;
+ &depthStencilResolveAttachmentRef2 // const VkAttachmentReference2KHR* pDepthStencilResolveAttachment;
+ };
+ const VkSubpassDescription2KHR subpassDescription2 =
+ {
+ VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR, // VkStructureType sType;
+ &subpassDescriptionDepthStencilResolve, // const void* pNext;
+ (VkSubpassDescriptionFlags)0, // VkSubpassDescriptionFlags flags;
+ VK_PIPELINE_BIND_POINT_GRAPHICS, // VkPipelineBindPoint pipelineBindPoint;
+ 0u, // deUint32 viewMask;
+ 0u, // deUint32 inputAttachmentCount;
+ DE_NULL, // const VkAttachmentReference2KHR* pInputAttachments;
+ hasColor ? 1u : 0u, // deUint32 colorAttachmentCount;
+ hasColor ? &colorAttachmentRef2 : DE_NULL, // const VkAttachmentReference2KHR* pColorAttachments;
+ hasColorResolve ? &colorResolveAttachmentRef2 : DE_NULL, // const VkAttachmentReference2KHR* pResolveAttachments;
+ hasDepthStencil ? &depthStencilAttachmentRef2 : DE_NULL, // const VkAttachmentReference2KHR* pDepthStencilAttachment;
+ 0u, // deUint32 preserveAttachmentCount;
+ DE_NULL // const deUint32* pPreserveAttachments;
+ };
+ const std::vector<VkAttachmentDescription2KHR> attachmentDescriptions2 = convertAttachmentDescriptions(attachmentDescriptions);
+ const VkRenderPassCreateInfo2KHR renderPassInfo =
+ {
+ VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkRenderPassCreateFlags)0, // VkRenderPassCreateFlags flags;
+ (deUint32)attachmentDescriptions2.size(), // deUint32 attachmentCount;
+ &attachmentDescriptions2[0], // const VkAttachmentDescription2KHR* pAttachments;
+ 1u, // deUint32 subpassCount;
+ &subpassDescription2, // const VkSubpassDescription2KHR* pSubpasses;
+ 0u, // deUint32 dependencyCount;
+ DE_NULL, // const VkSubpassDependency2KHR* pDependencies;
+ 0u, // deUint32 correlatedViewMaskCount;
+ DE_NULL // const deUint32* pCorrelatedViewMasks;
+ };
+
+ return createRenderPass2KHR(vk, device, &renderPassInfo, allocationCallbacks);
+ }
+ else
+ {
+ const VkSubpassDescription subpassDescription =
+ {
+ (VkSubpassDescriptionFlags)0, // VkSubpassDescriptionFlags flags;
+ VK_PIPELINE_BIND_POINT_GRAPHICS, // VkPipelineBindPoint pipelineBindPoint;
+ 0u, // deUint32 inputAttachmentCount;
+ DE_NULL, // const VkAttachmentReference* pInputAttachments;
+ hasColor ? 1u : 0u, // deUint32 colorAttachmentCount;
+ hasColor ? &colorAttachmentRef : DE_NULL, // const VkAttachmentReference* pColorAttachments;
+ hasColorResolve ? &colorResolveAttachmentRef : DE_NULL, // const VkAttachmentReference* pResolveAttachments;
+ hasDepthStencil ? &depthStencilAttachmentRef : DE_NULL, // const VkAttachmentReference* pDepthStencilAttachment;
+ 0u, // deUint32 preserveAttachmentCount;
+ DE_NULL // const deUint32* pPreserveAttachments;
+ };
+ const VkRenderPassCreateInfo renderPassInfo =
+ {
+ VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkRenderPassCreateFlags)0, // VkRenderPassCreateFlags flags;
+ (deUint32)attachmentDescriptions.size(), // deUint32 attachmentCount;
+ &attachmentDescriptions[0], // const VkAttachmentDescription* pAttachments;
+ 1u, // deUint32 subpassCount;
+ &subpassDescription, // const VkSubpassDescription* pSubpasses;
+ 0u, // deUint32 dependencyCount;
+ DE_NULL // const VkSubpassDependency* pDependencies;
+ };
+
+ return createRenderPass(vk, device, &renderPassInfo, allocationCallbacks);
+ }
+}
+
+Move<VkRenderPass> makeRenderPass (const DeviceInterface& vk,
+ const VkDevice device,
+ const VkFormat colorFormat,
+ const VkAllocationCallbacks* const allocationCallbacks)
+{
+ const VkAttachmentDescription attachmentDescriptions[] =
+ {
+ {
+ (VkAttachmentDescriptionFlags)0, // VkAttachmentDescriptionFlags flags;
+ colorFormat, // VkFormat format;
+ VK_SAMPLE_COUNT_1_BIT, // VkSampleCountFlagBits samples;
+ VK_ATTACHMENT_LOAD_OP_CLEAR, // VkAttachmentLoadOp loadOp;
+ VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp storeOp;
+ VK_ATTACHMENT_LOAD_OP_DONT_CARE, // VkAttachmentLoadOp stencilLoadOp;
+ VK_ATTACHMENT_STORE_OP_DONT_CARE, // VkAttachmentStoreOp stencilStoreOp;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout initialLayout;
+ VK_IMAGE_LAYOUT_GENERAL // VkImageLayout finalLayout;
+ },
+ {
+ (VkAttachmentDescriptionFlags)0, // VkAttachmentDescriptionFlags flags;
+ colorFormat, // VkFormat format;
+ VK_SAMPLE_COUNT_1_BIT, // VkSampleCountFlagBits samples;
+ VK_ATTACHMENT_LOAD_OP_LOAD, // VkAttachmentLoadOp loadOp;
+ VK_ATTACHMENT_STORE_OP_STORE, // VkAttachmentStoreOp storeOp;
+ VK_ATTACHMENT_LOAD_OP_DONT_CARE, // VkAttachmentLoadOp stencilLoadOp;
+ VK_ATTACHMENT_STORE_OP_DONT_CARE, // VkAttachmentStoreOp stencilStoreOp;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout initialLayout;
+ VK_IMAGE_LAYOUT_GENERAL // VkImageLayout finalLayout;
+ },
+ };
+ const VkAttachmentReference colorAttachmentRef0 =
+ {
+ 0u, // deUint32 attachment;
+ VK_IMAGE_LAYOUT_GENERAL // VkImageLayout layout;
+ };
+ const deUint32 preserveAttachment = 1u;
+ const VkAttachmentReference inputAttachmentRef1 =
+ {
+ 0u, // deUint32 attachment;
+ VK_IMAGE_LAYOUT_GENERAL // VkImageLayout layout;
+ };
+ const VkAttachmentReference colorAttachmentRef1 =
+ {
+ 1u, // deUint32 attachment;
+ VK_IMAGE_LAYOUT_GENERAL // VkImageLayout layout;
+ };
+ const VkSubpassDescription subpassDescriptions[] =
+ {
+ {
+ (VkSubpassDescriptionFlags)0, // VkSubpassDescriptionFlags flags;
+ VK_PIPELINE_BIND_POINT_GRAPHICS, // VkPipelineBindPoint pipelineBindPoint;
+ 0u, // deUint32 inputAttachmentCount;
+ DE_NULL, // const VkAttachmentReference* pInputAttachments;
+ 1u, // deUint32 colorAttachmentCount;
+ &colorAttachmentRef0, // const VkAttachmentReference* pColorAttachments;
+ DE_NULL, // const VkAttachmentReference* pResolveAttachments;
+ DE_NULL, // const VkAttachmentReference* pDepthStencilAttachment;
+ 1u, // deUint32 preserveAttachmentCount;
+ &preserveAttachment // const deUint32* pPreserveAttachments;
+ },
+ {
+ (VkSubpassDescriptionFlags)0, // VkSubpassDescriptionFlags flags;
+ VK_PIPELINE_BIND_POINT_GRAPHICS, // VkPipelineBindPoint pipelineBindPoint;
+ 1u, // deUint32 inputAttachmentCount;
+ &inputAttachmentRef1, // const VkAttachmentReference* pInputAttachments;
+ 1u, // deUint32 colorAttachmentCount;
+ &colorAttachmentRef1, // const VkAttachmentReference* pColorAttachments;
+ DE_NULL, // const VkAttachmentReference* pResolveAttachments;
+ DE_NULL, // const VkAttachmentReference* pDepthStencilAttachment;
+ 0u, // deUint32 preserveAttachmentCount;
+ DE_NULL // const deUint32* pPreserveAttachments;
+ },
+ };
+ const VkSubpassDependency subpassDependency =
+ {
+ 0, // deUint32 srcSubpass;
+ 1u, // deUint32 dstSubpass;
+ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, // VkPipelineStageFlags srcStageMask;
+ VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, // VkPipelineStageFlags dstStageMask;
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags srcAccessMask;
+ VK_ACCESS_INPUT_ATTACHMENT_READ_BIT, // VkAccessFlags dstAccessMask;
+ VK_DEPENDENCY_VIEW_LOCAL_BIT_KHR, // VkDependencyFlags dependencyFlags;
+ };
+ const VkRenderPassCreateInfo renderPassInfo =
+ {
+ VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkRenderPassCreateFlags)0, // VkRenderPassCreateFlags flags;
+ DE_LENGTH_OF_ARRAY(attachmentDescriptions), // deUint32 attachmentCount;
+ &attachmentDescriptions[0], // const VkAttachmentDescription* pAttachments;
+ DE_LENGTH_OF_ARRAY(subpassDescriptions), // deUint32 subpassCount;
+ &subpassDescriptions[0], // const VkSubpassDescription* pSubpasses;
+ 1u, // deUint32 dependencyCount;
+ &subpassDependency // const VkSubpassDependency* pDependencies;
+ };
+
+ return createRenderPass(vk, device, &renderPassInfo, allocationCallbacks);
+}
+
+VkImageCreateInfo makeImageCreateInfo (const VkFormat format, const VkExtent2D size, const VkImageUsageFlags usage, VkSampleCountFlagBits samples = VK_SAMPLE_COUNT_1_BIT)
+{
+ const VkExtent3D extent = { size.width, size.height, 1u };
+ const VkImageCreateInfo imageParams =
+ {
+ VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ 0u, // VkImageCreateFlags flags;
+ VK_IMAGE_TYPE_2D, // VkImageType imageType;
+ format, // VkFormat format;
+ extent, // VkExtent3D extent;
+ 1u, // deUint32 mipLevels;
+ 1u, // deUint32 arrayLayers;
+ samples, // VkSampleCountFlagBits samples;
+ VK_IMAGE_TILING_OPTIMAL, // VkImageTiling tiling;
+ usage, // VkImageUsageFlags usage;
+ VK_SHARING_MODE_EXCLUSIVE, // VkSharingMode sharingMode;
+ 0u, // deUint32 queueFamilyIndexCount;
+ DE_NULL, // const deUint32* pQueueFamilyIndices;
+ VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout initialLayout;
+ };
+ return imageParams;
+}
+
+std::vector<VkFramebufferAttachmentImageInfoKHR> makeFramebufferAttachmentImageInfos (const VkExtent2D& renderSize,
+ const VkFormat colorFormat,
+ const VkImageUsageFlags colorUsage,
+ const VkFormat dsFormat,
+ const VkImageUsageFlags dsUsage,
+ const AspectFlags resolveAspects,
+ const deUint32 inputAttachmentCount)
+{
+ const bool colorResolve = (resolveAspects & ASPECT_COLOR) != 0;
+ const bool depthStencilResolve = (resolveAspects & ASPECT_DEPTH_STENCIL) != 0;
+ std::vector<VkFramebufferAttachmentImageInfoKHR> framebufferAttachmentImageInfos;
+
+ if (colorFormat != VK_FORMAT_UNDEFINED)
+ {
+ const VkFramebufferAttachmentImageInfoKHR framebufferAttachmentImageInfo =
+ {
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkImageCreateFlags)0u, // VkImageCreateFlags flags;
+ colorUsage, // VkImageUsageFlags usage;
+ renderSize.width, // deUint32 width;
+ renderSize.height, // deUint32 height;
+ 1u, // deUint32 layerCount;
+ 1u, // deUint32 viewFormatCount;
+ &colorFormat // const VkFormat* pViewFormats;
+ };
+
+ framebufferAttachmentImageInfos.push_back(framebufferAttachmentImageInfo);
+ }
+
+ if (dsFormat != VK_FORMAT_UNDEFINED)
+ {
+ const VkFramebufferAttachmentImageInfoKHR framebufferAttachmentImageInfo =
+ {
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkImageCreateFlags)0u, // VkImageCreateFlags flags;
+ dsUsage, // VkImageUsageFlags usage;
+ renderSize.width, // deUint32 width;
+ renderSize.height, // deUint32 height;
+ 1u, // deUint32 layerCount;
+ 1u, // deUint32 viewFormatCount;
+ &dsFormat // const VkFormat* pViewFormats;
+ };
+
+ framebufferAttachmentImageInfos.push_back(framebufferAttachmentImageInfo);
+ }
+
+ if (colorResolve)
+ {
+ const VkFramebufferAttachmentImageInfoKHR framebufferAttachmentImageInfo =
+ {
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkImageCreateFlags)0u, // VkImageCreateFlags flags;
+ colorUsage, // VkImageUsageFlags usage;
+ renderSize.width, // deUint32 width;
+ renderSize.height, // deUint32 height;
+ 1u, // deUint32 layerCount;
+ 1u, // deUint32 viewFormatCount;
+ &colorFormat // const VkFormat* pViewFormats;
+ };
+
+ DE_ASSERT(colorFormat != VK_FORMAT_UNDEFINED);
+
+ framebufferAttachmentImageInfos.push_back(framebufferAttachmentImageInfo);
+ }
+
+ if (depthStencilResolve)
+ {
+ const VkFramebufferAttachmentImageInfoKHR framebufferAttachmentImageInfo =
+ {
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkImageCreateFlags)0u, // VkImageCreateFlags flags;
+ dsUsage, // VkImageUsageFlags usage;
+ renderSize.width, // deUint32 width;
+ renderSize.height, // deUint32 height;
+ 1u, // deUint32 layerCount;
+ 1u, // deUint32 viewFormatCount;
+ &dsFormat // const VkFormat* pViewFormats;
+ };
+
+ DE_ASSERT(dsFormat != VK_FORMAT_UNDEFINED);
+
+ framebufferAttachmentImageInfos.push_back(framebufferAttachmentImageInfo);
+ }
+
+ for (deUint32 inputAttachmentNdx = 0; inputAttachmentNdx < inputAttachmentCount; ++inputAttachmentNdx)
+ {
+ const VkFramebufferAttachmentImageInfoKHR framebufferAttachmentImageInfo =
+ {
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkImageCreateFlags)0u, // VkImageCreateFlags flags;
+ colorUsage | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, // VkImageUsageFlags usage;
+ renderSize.width, // deUint32 width;
+ renderSize.height, // deUint32 height;
+ 1u, // deUint32 layerCount;
+ 1u, // deUint32 viewFormatCount;
+ &colorFormat // const VkFormat* pViewFormats;
+ };
+
+ framebufferAttachmentImageInfos.push_back(framebufferAttachmentImageInfo);
+ }
+
+ return framebufferAttachmentImageInfos;
+}
+
+Move<VkFramebuffer> makeFramebuffer (const DeviceInterface& vk,
+ const VkDevice device,
+ const VkRenderPass renderPass,
+ const VkExtent2D& renderSize,
+ const VkFormat colorFormat,
+ const VkImageUsageFlags colorUsage,
+ const VkFormat dsFormat = VK_FORMAT_UNDEFINED,
+ const VkImageUsageFlags dsUsage = static_cast<VkImageUsageFlags>(0),
+ const AspectFlags resolveAspects = ASPECT_NONE,
+ const deUint32 inputAttachmentCount = 0)
+{
+ const std::vector<VkFramebufferAttachmentImageInfoKHR> framebufferAttachmentImageInfos = makeFramebufferAttachmentImageInfos(renderSize, colorFormat, colorUsage, dsFormat, dsUsage, resolveAspects, inputAttachmentCount);
+ const deUint32 attachmentCount = static_cast<deUint32>(framebufferAttachmentImageInfos.size());
+ const VkFramebufferAttachmentsCreateInfoKHR framebufferAttachmentsCreateInfo =
+ {
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ attachmentCount, // deUint32 attachmentImageInfoCount;
+ &framebufferAttachmentImageInfos[0] // const VkFramebufferAttachmentImageInfoKHR* pAttachmentImageInfos;
+ };
+ const VkFramebufferCreateInfo framebufferInfo =
+ {
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, // VkStructureType sType;
+ &framebufferAttachmentsCreateInfo, // const void* pNext;
+ VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR, // VkFramebufferCreateFlags flags;
+ renderPass, // VkRenderPass renderPass;
+ attachmentCount, // deUint32 attachmentCount;
+ DE_NULL, // const VkImageView* pAttachments;
+ renderSize.width, // deUint32 width;
+ renderSize.height, // deUint32 height;
+ 1u, // deUint32 layers;
+ };
+
+ return createFramebuffer(vk, device, &framebufferInfo);
+}
+
+Move<VkFramebuffer> makeVerifyFramebuffer (const DeviceInterface& vk,
+ const VkDevice device,
+ const VkRenderPass renderPass,
+ const VkImageView colorAttachment,
+ const VkExtent2D& renderSize,
+ const deUint32 layers = 1u)
+{
+ const VkFramebufferCreateInfo framebufferInfo = {
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkFramebufferCreateFlags)0, // VkFramebufferCreateFlags flags;
+ renderPass, // VkRenderPass renderPass;
+ 1u, // deUint32 attachmentCount;
+ &colorAttachment, // const VkImageView* pAttachments;
+ renderSize.width, // deUint32 width;
+ renderSize.height, // deUint32 height;
+ layers, // deUint32 layers;
+ };
+
+ return createFramebuffer(vk, device, &framebufferInfo);
+}
+
+Move<VkPipelineLayout> makeVerifyPipelineLayout (const DeviceInterface& vk,
+ const VkDevice device,
+ const VkDescriptorSetLayout descriptorSetLayout)
+{
+ const VkPushConstantRange pushConstantRanges =
+ {
+ VK_SHADER_STAGE_FRAGMENT_BIT, // VkShaderStageFlags stageFlags;
+ 0u, // deUint32 offset;
+ sizeof(deUint32) // deUint32 size;
+ };
+ const VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo =
+ {
+ VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ (VkPipelineLayoutCreateFlags)0, // VkPipelineLayoutCreateFlags flags;
+ 1u, // deUint32 setLayoutCount;
+ &descriptorSetLayout, // const VkDescriptorSetLayout* pSetLayouts;
+ 1u, // deUint32 pushConstantRangeCount;
+ &pushConstantRanges, // const VkPushConstantRange* pPushConstantRanges;
+ };
+ return createPipelineLayout(vk, device, &pipelineLayoutCreateInfo);
+}
+
+Move<VkRenderPass> makeVerifyRenderPass (const DeviceInterface& vk,
+ const VkDevice device,
+ const VkFormat colorFormat)
+{
+ return makeRenderPass(vk, device, colorFormat);
+}
+
+VkImageMemoryBarrier makeImageMemoryBarrier (const VkAccessFlags srcAccessMask,
+ const VkAccessFlags dstAccessMask,
+ const VkImageLayout oldLayout,
+ const VkImageLayout newLayout,
+ const VkImage image,
+ const VkImageSubresourceRange subresourceRange)
+{
+ const VkImageMemoryBarrier barrier =
+ {
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ srcAccessMask, // VkAccessFlags outputMask;
+ dstAccessMask, // VkAccessFlags inputMask;
+ oldLayout, // VkImageLayout oldLayout;
+ newLayout, // VkImageLayout newLayout;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 destQueueFamilyIndex;
+ image, // VkImage image;
+ subresourceRange, // VkImageSubresourceRange subresourceRange;
+ };
+ return barrier;
+}
+
+VkBufferMemoryBarrier makeBufferMemoryBarrier (const VkAccessFlags srcAccessMask,
+ const VkAccessFlags dstAccessMask,
+ const VkBuffer buffer,
+ const VkDeviceSize offset,
+ const VkDeviceSize bufferSizeBytes)
+{
+ const VkBufferMemoryBarrier barrier =
+ {
+ VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ srcAccessMask, // VkAccessFlags srcAccessMask;
+ dstAccessMask, // VkAccessFlags dstAccessMask;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex;
+ VK_QUEUE_FAMILY_IGNORED, // deUint32 destQueueFamilyIndex;
+ buffer, // VkBuffer buffer;
+ offset, // VkDeviceSize offset;
+ bufferSizeBytes, // VkDeviceSize size;
+ };
+ return barrier;
+}
+
+VkBufferImageCopy makeBufferImageCopy (const VkExtent3D extent,
+ const VkImageSubresourceLayers subresourceLayers)
+{
+ const VkBufferImageCopy copyParams =
+ {
+ 0ull, // VkDeviceSize bufferOffset;
+ 0u, // deUint32 bufferRowLength;
+ 0u, // deUint32 bufferImageHeight;
+ subresourceLayers, // VkImageSubresourceLayers imageSubresource;
+ makeOffset3D(0, 0, 0), // VkOffset3D imageOffset;
+ extent, // VkExtent3D imageExtent;
+ };
+ return copyParams;
+}
+
+inline Move<VkBuffer> makeBuffer (const DeviceInterface& vk, const VkDevice device, const VkBufferCreateInfo& createInfo)
+{
+ return createBuffer(vk, device, &createInfo);
+}
+
+inline Move<VkImage> makeImage (const DeviceInterface& vk, const VkDevice device, const VkImageCreateInfo& createInfo)
+{
+ return createImage(vk, device, &createInfo);
+}
+
+MovePtr<Allocation> bindImage (const DeviceInterface& vk, const VkDevice device, Allocator& allocator, const VkImage image, const MemoryRequirement requirement)
+{
+ MovePtr<Allocation> alloc = allocator.allocate(getImageMemoryRequirements(vk, device, image), requirement);
+ VK_CHECK(vk.bindImageMemory(device, image, alloc->getMemory(), alloc->getOffset()));
+ return alloc;
+}
+
+MovePtr<Allocation> bindBuffer (const DeviceInterface& vk, const VkDevice device, Allocator& allocator, const VkBuffer buffer, const MemoryRequirement requirement)
+{
+ MovePtr<Allocation> alloc(allocator.allocate(getBufferMemoryRequirements(vk, device, buffer), requirement));
+ VK_CHECK(vk.bindBufferMemory(device, buffer, alloc->getMemory(), alloc->getOffset()));
+ return alloc;
+}
+
+Move<VkSampler> makeSampler (const DeviceInterface& vk, const VkDevice& device)
+{
+ const VkSamplerCreateInfo createInfo =
+ {
+ VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ 0u, // VkSamplerCreateFlags flags;
+ VK_FILTER_NEAREST, // VkFilter magFilter;
+ VK_FILTER_NEAREST, // VkFilter minFilter;
+ VK_SAMPLER_MIPMAP_MODE_LINEAR, // VkSamplerMipmapMode mipmapMode;
+ VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, // VkSamplerAddressMode addressModeU;
+ VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, // VkSamplerAddressMode addressModeV;
+ VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, // VkSamplerAddressMode addressModeW;
+ 0.0f, // float mipLodBias;
+ VK_FALSE, // VkBool32 anisotropyEnable;
+ 1.0f, // float maxAnisotropy;
+ VK_FALSE, // VkBool32 compareEnable;
+ VK_COMPARE_OP_ALWAYS, // VkCompareOp compareOp;
+ 0.0f, // float minLod;
+ 0.0f, // float maxLod;
+ VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK, // VkBorderColor borderColor;
+ VK_FALSE // VkBool32 unnormalizedCoordinates;
+ };
+
+ return createSampler(vk, device, &createInfo);
+}
+
+void fillBuffer (const DeviceInterface& vk, const VkDevice device, Allocation& bufferAlloc, const void* data, const VkDeviceSize dataSize)
+{
+ const VkMappedMemoryRange memRange =
+ {
+ VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ bufferAlloc.getMemory(), // VkDeviceMemory memory;
+ bufferAlloc.getOffset(), // VkDeviceSize offset;
+ VK_WHOLE_SIZE // VkDeviceSize size;
+ };
+ const deUint32 dataSize32 = static_cast<deUint32>(dataSize);
+
+ deMemcpy(bufferAlloc.getHostPtr(), data, dataSize32);
+ VK_CHECK(vk.flushMappedMemoryRanges(device, 1u, &memRange));
+}
+
+std::vector<float> getFullQuadVertices (void)
+{
+ const float verticesData[] =
+ {
+ -1.0f, -1.0f, 0.0f, 1.0f,
+ -1.0f, +1.0f, 0.0f, 1.0f,
+ +1.0f, -1.0f, 0.0f, 1.0f,
+ -1.0f, +1.0f, 0.0f, 1.0f,
+ +1.0f, -1.0f, 0.0f, 1.0f,
+ +1.0f, +1.0f, 0.0f, 1.0f,
+ };
+ const std::vector<float> vertices (verticesData, verticesData + DE_LENGTH_OF_ARRAY(verticesData));
+
+ return vertices;
+}
+
+void checkImageFormatProperties (const InstanceInterface& vki,
+ const VkPhysicalDevice& physDevice,
+ const VkFormat format,
+ const VkImageUsageFlags imageUsageFlags,
+ const VkExtent2D& requiredSize2D)
+{
+ const VkImageType imageType = VK_IMAGE_TYPE_2D;
+ const VkImageTiling imageTiling = VK_IMAGE_TILING_OPTIMAL;
+ const VkImageCreateFlags imageCreateFlags = static_cast<VkImageCreateFlags>(0u);
+ const deUint32 requiredLayers = 1u;
+ const VkExtent3D requiredSize = makeExtent3D(requiredSize2D.height, requiredSize2D.width, 1u);
+
+ VkImageFormatProperties imageFormatProperties;
+ VkResult result;
+
+ deMemset(&imageFormatProperties, 0, sizeof(imageFormatProperties));
+
+ result = vki.getPhysicalDeviceImageFormatProperties(physDevice, format, imageType, imageTiling, imageUsageFlags, imageCreateFlags, &imageFormatProperties);
+
+ if (result != VK_SUCCESS ||
+ imageFormatProperties.maxArrayLayers < requiredLayers ||
+ imageFormatProperties.maxExtent.height < requiredSize.height ||
+ imageFormatProperties.maxExtent.width < requiredSize.width ||
+ imageFormatProperties.maxExtent.depth < requiredSize.depth)
+ {
+ TCU_THROW(NotSupportedError, "Depth/stencil format is not supported");
+ }
+}
+
+VkFormat getStencilBufferFormat(VkFormat depthStencilImageFormat)
+{
+ const tcu::TextureFormat tcuFormat = mapVkFormat(depthStencilImageFormat);
+ const VkFormat result = (tcuFormat.order == tcu::TextureFormat::S || tcuFormat.order == tcu::TextureFormat::DS) ? VK_FORMAT_S8_UINT : VK_FORMAT_UNDEFINED;
+
+ DE_ASSERT(result != VK_FORMAT_UNDEFINED);
+
+ return result;
+}
+
+static MovePtr<tcu::TextureLevel> convertDepthToColor (const tcu::TextureFormat& dataFormat, const int width, const int height, const void* data, const tcu::TextureFormat& targetFormat)
+{
+ const tcu::ConstPixelBufferAccess srcImage (dataFormat, width, height, 1u, data);
+ MovePtr<tcu::TextureLevel> dstImage (new tcu::TextureLevel(targetFormat, width, height, 1u));
+ tcu::PixelBufferAccess dstAccess (dstImage->getAccess());
+
+ for (int y = 0; y < height; y++)
+ for (int x = 0; x < width; x++)
+ {
+ const float depth = srcImage.getPixDepth(x, y);
+ const tcu::Vec4 color = tcu::Vec4(depth, depth, depth, 1.0f);
+
+ dstAccess.setPixel(color, x, y);
+ }
+
+ return dstImage;
+}
+
+static MovePtr<tcu::TextureLevel> convertStencilToColor (const tcu::TextureFormat& dataFormat, const int width, const int height, const void* data, const tcu::TextureFormat& targetFormat)
+{
+ const int maxValue (4);
+ const tcu::ConstPixelBufferAccess srcImage (dataFormat, width, height, 1u, data);
+ MovePtr<tcu::TextureLevel> dstImage (new tcu::TextureLevel(targetFormat, width, height, 1u));
+ tcu::PixelBufferAccess dstAccess (dstImage->getAccess());
+
+ for (int y = 0; y < height; y++)
+ for (int x = 0; x < width; x++)
+ {
+ const int stencilInt = srcImage.getPixStencil(x, y);
+ const float stencil = (stencilInt < maxValue) ? float(stencilInt) / float(maxValue) : 1.0f;
+ const tcu::Vec4 color = tcu::Vec4(stencil, stencil, stencil, 1.0f);
+
+ dstAccess.setPixel(color, x, y);
+ }
+
+ return dstImage;
+}
+
+class ColorImagelessTestInstance : public TestInstance
+{
+public:
+ ColorImagelessTestInstance (Context& context, const TestParameters& parameters);
+protected:
+ virtual tcu::TestStatus iterate (void);
+
+ virtual std::vector<float> getVertices (void);
+ void readOneSampleFromMultisampleImage (const VkFormat srcFormat,
+ const Unique<VkImage>& srcImage,
+ const deUint32 sampleID,
+ const VkFormat dstFormat,
+ const Unique<VkImage>& dstImage,
+ const Unique<VkBuffer>& dstBuffer,
+ const AspectFlags aspect);
+ virtual MovePtr<tcu::TextureLevel> generateReferenceImage (const tcu::TextureFormat& textureFormat,
+ const AspectFlags aspectFlags,
+ const deUint32 sample,
+ const deUint32 subpass);
+ virtual bool verifyBuffer (const UniquePtr<Allocation>& bufAlloc,
+ const VkFormat bufferFormat,
+ const std::string& name,
+ const AspectFlags aspectFlags,
+ const deUint32 sample = NO_SAMPLE,
+ const deUint32 subpass = NO_SUBPASS);
+ virtual bool verifyBufferInternal (const void* resultData,
+ const tcu::TextureFormat& textureFormat,
+ const tcu::TextureLevel& referenceImage,
+ const std::string& name);
+
+ const bool m_extensions;
+ const VkExtent2D m_imageExtent2D;
+ const TestParameters m_parameters;
+ VkImageUsageFlags m_colorImageUsage;
+};
+
+ColorImagelessTestInstance::ColorImagelessTestInstance (Context& context, const TestParameters& parameters)
+ : TestInstance (context)
+ , m_extensions (context.requireDeviceExtension("VK_KHR_imageless_framebuffer"))
+ , m_imageExtent2D (makeExtent2D(32u, 32u))
+ , m_parameters (parameters)
+ , m_colorImageUsage (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT)
+{
+ const InstanceInterface& vki = m_context.getInstanceInterface();
+ const VkPhysicalDevice physDevice = m_context.getPhysicalDevice();
+ const VkPhysicalDeviceImagelessFramebufferFeaturesKHR& imagelessFramebufferFeatures (context.getImagelessFramebufferFeatures());
+
+ if (imagelessFramebufferFeatures.imagelessFramebuffer == DE_FALSE)
+ TCU_THROW(NotSupportedError, "Imageless framebuffer is not supported");
+
+ checkImageFormatProperties(vki, physDevice, m_parameters.colorFormat, m_colorImageUsage, m_imageExtent2D);
+}
+
+void ColorImagelessTestInstance::readOneSampleFromMultisampleImage (const VkFormat srcFormat,
+ const Unique<VkImage>& srcImage,
+ const deUint32 sampleID,
+ const VkFormat dstFormat,
+ const Unique<VkImage>& dstImage,
+ const Unique<VkBuffer>& dstBuffer,
+ const AspectFlags aspect)
+{
+ const DeviceInterface& vk = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+ const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
+ const VkQueue queue = m_context.getUniversalQueue();
+ Allocator& allocator = m_context.getDefaultAllocator();
+
+ const tcu::Vec4 clearColor = tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f);
+ const bool color = ((aspect & ASPECT_COLOR) != 0);
+ const bool depth = ((aspect & ASPECT_DEPTH) != 0);
+ const bool stencil = ((aspect & ASPECT_STENCIL) != 0);
+ const VkImageAspectFlags srcAspect = color ? VK_IMAGE_ASPECT_COLOR_BIT
+ : depth ? VK_IMAGE_ASPECT_DEPTH_BIT
+ : VK_IMAGE_ASPECT_STENCIL_BIT;
+ const VkImageSubresourceRange srcSubresRange = makeImageSubresourceRange(srcAspect, 0u, 1u, 0u, 1u);
+ const Unique<VkImageView> srcImageView (makeImageView (vk, device, *srcImage, VK_IMAGE_VIEW_TYPE_2D, srcFormat, srcSubresRange));
+
+ const VkImageAspectFlags dstAspect = VK_IMAGE_ASPECT_COLOR_BIT;
+ const VkImageSubresourceRange dstSubresRange = makeImageSubresourceRange(dstAspect, 0u, 1u, 0u, 1u);
+ const Unique<VkImageView> dstAttachment (makeImageView (vk, device, *dstImage, VK_IMAGE_VIEW_TYPE_2D, dstFormat, dstSubresRange));
+
+ const std::string fragModuleInfix = color ? "-color"
+ : depth ? "-depth"
+ : stencil ? "-stencil"
+ : "";
+ const Unique<VkShaderModule> vertModule (createShaderModule (vk, device, m_context.getBinaryCollection().get("demultisample-vert"), 0u));
+ const Unique<VkShaderModule> fragModule (createShaderModule (vk, device, m_context.getBinaryCollection().get("demultisample" + fragModuleInfix + "-frag"), 0u));
+ const Unique<VkRenderPass> renderPass (makeVerifyRenderPass (vk, device, dstFormat));
+ const Unique<VkFramebuffer> framebuffer (makeVerifyFramebuffer (vk, device, *renderPass, *dstAttachment, m_imageExtent2D));
+
+ const VkDescriptorType samplerDescType (VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER);
+ const Unique<VkSampler> sampler (makeSampler(vk, device));
+ const Unique<VkDescriptorSetLayout> descriptorSetLayout (DescriptorSetLayoutBuilder()
+ .addSingleSamplerBinding(samplerDescType, VK_SHADER_STAGE_FRAGMENT_BIT, &sampler.get())
+ .build(vk, device));
+ const Unique<VkDescriptorPool> descriptorPool (DescriptorPoolBuilder()
+ .addType(samplerDescType)
+ .build(vk, device, VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, 1u));
+ const Unique<VkDescriptorSet> descriptorSet (makeDescriptorSet(vk, device, *descriptorPool, *descriptorSetLayout));
+ const VkDescriptorImageInfo imageDescriptorInfo (makeDescriptorImageInfo(DE_NULL, *srcImageView, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL));
+
+ DescriptorSetUpdateBuilder()
+ .writeSingle(*descriptorSet, DescriptorSetUpdateBuilder::Location::binding(0u), samplerDescType, &imageDescriptorInfo)
+ .update(vk, device);
+
+ const Unique<VkPipelineLayout> pipelineLayout (makeVerifyPipelineLayout (vk, device, *descriptorSetLayout));
+ const Unique<VkPipeline> pipeline (makeGraphicsPipeline (vk, device, *pipelineLayout, *renderPass, *vertModule, *fragModule, m_imageExtent2D));
+ const Unique<VkCommandPool> cmdPool (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+
+ const std::vector<float> vertexArray (getFullQuadVertices());
+ const deUint32 vertexCount (static_cast<deUint32>(vertexArray.size() / 4u));
+ const VkDeviceSize vertexArraySize (vertexArray.size() * sizeof(vertexArray[0]));
+ const Unique<VkBuffer> vertexBuffer (makeBuffer (vk, device, makeBufferCreateInfo(vertexArraySize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT)));
+ const UniquePtr<Allocation> vertexBufferAlloc (bindBuffer (vk, device, allocator, *vertexBuffer, MemoryRequirement::HostVisible));
+ const VkDeviceSize vertexBufferOffset (0u);
+
+ fillBuffer(vk, device, *vertexBufferAlloc, &vertexArray[0], vertexArraySize);
+
+ beginCommandBuffer(vk, *cmdBuffer);
+ {
+ if (sampleID == 0)
+ {
+ if (color)
+ {
+ const VkImageMemoryBarrier preCopyBarrier = makeImageMemoryBarrier (VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT,
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
+ *srcImage, srcSubresRange);
+
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0u, 0u, DE_NULL, 0u, DE_NULL, 1u, &preCopyBarrier);
+ }
+ else if (depth)
+ {
+ const VkImageSubresourceRange preCopySubresRange = makeImageSubresourceRange (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 1u, 0u, 1u);
+ const VkImageMemoryBarrier preCopyBarrier = makeImageMemoryBarrier (VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT,
+ VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
+ *srcImage, preCopySubresRange);
+
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0u, 0u, DE_NULL, 0u, DE_NULL, 1u, &preCopyBarrier);
+ }
+ }
+
+ beginRenderPass(vk, *cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_imageExtent2D), clearColor);
+ {
+ vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline);
+
+ vk.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *pipelineLayout, 0u, 1u, &descriptorSet.get(), 0u, DE_NULL);
+
+ vk.cmdBindVertexBuffers(*cmdBuffer, 0u, 1u, &*vertexBuffer, &vertexBufferOffset);
+
+ vk.cmdPushConstants(*cmdBuffer, *pipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, 0u, sizeof(sampleID), &sampleID);
+
+ vk.cmdDraw(*cmdBuffer, vertexCount, 1u, 0u, 0u);
+ }
+ endRenderPass(vk, *cmdBuffer);
+
+ // Image copy
+ {
+ const VkImageMemoryBarrier preCopyBarrier = makeImageMemoryBarrier (VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ *dstImage, dstSubresRange);
+ const VkBufferImageCopy region = makeBufferImageCopy (makeExtent3D(m_imageExtent2D.width, m_imageExtent2D.height, 1u),
+ makeImageSubresourceLayers(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 0u, 1u));
+ const VkBufferMemoryBarrier postCopyBarrier = makeBufferMemoryBarrier (VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *dstBuffer, 0ull, VK_WHOLE_SIZE);
+
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0u, 0u, DE_NULL, 0u, DE_NULL, 1u, &preCopyBarrier);
+ vk.cmdCopyImageToBuffer(*cmdBuffer, *dstImage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *dstBuffer, 1u, ®ion);
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, 0u, 0u, DE_NULL, 1u, &postCopyBarrier, DE_NULL, 0u);
+ }
+ }
+ endCommandBuffer(vk, *cmdBuffer);
+ submitCommandsAndWait(vk, device, queue, *cmdBuffer);
+}
+
+bool ColorImagelessTestInstance::verifyBufferInternal (const void* resultData, const tcu::TextureFormat& textureFormat, const tcu::TextureLevel& referenceImage, const std::string& name)
+{
+ const int dataSize (m_imageExtent2D.width * m_imageExtent2D.height * textureFormat.getPixelSize());
+ const tcu::ConstPixelBufferAccess referenceAccess (referenceImage.getAccess());
+
+ if (deMemCmp(resultData, referenceAccess.getDataPtr(), dataSize) != 0)
+ {
+ const tcu::ConstPixelBufferAccess resultImage (textureFormat, m_imageExtent2D.width, m_imageExtent2D.height, 1u, resultData);
+ bool ok;
+
+ ok = tcu::intThresholdCompare(m_context.getTestContext().getLog(), name.c_str(), "", referenceAccess, resultImage, tcu::UVec4(1), tcu::COMPARE_LOG_RESULT);
+
+ return ok;
+ }
+
+ return true;
+}
+
+bool ColorImagelessTestInstance::verifyBuffer (const UniquePtr<Allocation>& bufAlloc, const VkFormat bufferFormat, const std::string& name, const AspectFlags aspectFlags, const deUint32 sample, const deUint32 subpass)
+{
+ invalidateMappedMemoryRange(m_context.getDeviceInterface(), m_context.getDevice(), bufAlloc->getMemory(), bufAlloc->getOffset(), VK_WHOLE_SIZE);
+
+ const tcu::TextureFormat bufferTextureFormat (mapVkFormat(bufferFormat));
+ const bool multisampled (sample != NO_SAMPLE);
+ const bool depth ((aspectFlags & ASPECT_DEPTH) != 0);
+ const bool stencil ((aspectFlags & ASPECT_STENCIL) != 0);
+ const bool convertRequired ((depth || stencil) && !multisampled);
+ const tcu::TextureFormat convertTextureFormat (tcu::TextureFormat(tcu::TextureFormat::R, tcu::TextureFormat::UNORM_INT8));
+ const tcu::TextureFormat referenceTextureFormat (convertRequired ? convertTextureFormat : bufferTextureFormat);
+ const MovePtr<tcu::TextureLevel> referenceImage (generateReferenceImage(referenceTextureFormat, aspectFlags, sample, subpass));
+
+ if (!multisampled && depth)
+ {
+ MovePtr<tcu::TextureLevel> convertedImage (convertDepthToColor(bufferTextureFormat, m_imageExtent2D.width, m_imageExtent2D.height, bufAlloc->getHostPtr(), convertTextureFormat));
+ tcu::ConstPixelBufferAccess convertedAccess (convertedImage->getAccess());
+
+ return verifyBufferInternal(convertedAccess.getDataPtr(), convertTextureFormat, *referenceImage, name);
+ }
+ else if (!multisampled && stencil)
+ {
+ MovePtr<tcu::TextureLevel> convertedImage (convertStencilToColor(bufferTextureFormat, m_imageExtent2D.width, m_imageExtent2D.height, bufAlloc->getHostPtr(), convertTextureFormat));
+ tcu::ConstPixelBufferAccess convertedAccess (convertedImage->getAccess());
+
+ return verifyBufferInternal(convertedAccess.getDataPtr(), convertTextureFormat, *referenceImage, name);
+ }
+ else
+ {
+ const void* resultData (bufAlloc->getHostPtr());
+
+ return verifyBufferInternal(resultData, bufferTextureFormat, *referenceImage, name);
+ }
+}
+
+MovePtr<tcu::TextureLevel> ColorImagelessTestInstance::generateReferenceImage (const tcu::TextureFormat& textureFormat,
+ const AspectFlags aspectFlags,
+ const deUint32 sample,
+ const deUint32 subpass)
+{
+ const int width = m_imageExtent2D.width;
+ const int height = m_imageExtent2D.height;
+ const int componentValue (static_cast<int>(0.75f * 0x100));
+ const tcu::RGBA colorDrawRGBA (tcu::RGBA(componentValue, componentValue, componentValue, 0xFF));
+ const tcu::Vec4 colorDraw (colorDrawRGBA.toVec());
+ const tcu::Vec4 colorFill (tcu::RGBA::black().toVec());
+ MovePtr<tcu::TextureLevel> image (new tcu::TextureLevel(textureFormat, width, height));
+ tcu::PixelBufferAccess access (image->getAccess());
+
+ DE_UNREF(aspectFlags);
+ DE_ASSERT(aspectFlags == ASPECT_COLOR);
+ DE_UNREF(sample);
+ DE_ASSERT(sample == NO_SAMPLE);
+ DE_UNREF(subpass);
+ DE_ASSERT(subpass == NO_SUBPASS);
+
+ for (int y = 0; y < height; ++y)
+ {
+ const tcu::Vec4& validColor = (y < height / 2) ? colorFill : colorDraw;
+
+ for (int x = 0; x < width; ++x)
+ access.setPixel(validColor, x, y);
+ }
+
+ return image;
+}
+
+std::vector<float> ColorImagelessTestInstance::getVertices (void)
+{
+ const float verticesData[] =
+ {
+ -1.0f, 0.0f, 0.0f, 1.0f,
+ -1.0f, +1.0f, 0.0f, 1.0f,
+ +1.0f, 0.0f, 0.0f, 1.0f,
+ -1.0f, +1.0f, 0.0f, 1.0f,
+ +1.0f, 0.0f, 0.0f, 1.0f,
+ +1.0f, +1.0f, 0.0f, 1.0f,
+ };
+ const std::vector<float> vertices (verticesData, verticesData + DE_LENGTH_OF_ARRAY(verticesData));
+
+ return vertices;
+}
+
+tcu::TestStatus ColorImagelessTestInstance::iterate (void)
+{
+ const DeviceInterface& vk = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+ const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
+ const VkQueue queue = m_context.getUniversalQueue();
+ Allocator& allocator = m_context.getDefaultAllocator();
+
+ const tcu::Vec4 clearColor = tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f);
+ const VkFormat colorFormat = m_parameters.colorFormat;
+ const VkDeviceSize colorBufferSize = m_imageExtent2D.width * m_imageExtent2D.height * tcu::getPixelSize(mapVkFormat(colorFormat));
+ const VkImageSubresourceRange colorSubresRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u);
+
+ const Unique<VkImage> colorImage (makeImage (vk, device, makeImageCreateInfo(colorFormat, m_imageExtent2D, m_colorImageUsage)));
+ const UniquePtr<Allocation> colorImageAlloc (bindImage (vk, device, allocator, *colorImage, MemoryRequirement::Any));
+ const Unique<VkImageView> colorAttachment (makeImageView (vk, device, *colorImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorSubresRange));
+ const Unique<VkBuffer> colorBuffer (makeBuffer (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> colorBufferAlloc (bindBuffer (vk, device, allocator, *colorBuffer, MemoryRequirement::HostVisible));
+
+ const Unique<VkShaderModule> vertModule (createShaderModule (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+ const Unique<VkShaderModule> fragModule (createShaderModule (vk, device, m_context.getBinaryCollection().get("frag"), 0u));
+ const Unique<VkRenderPass> renderPass (makeRenderPass (vk, device, colorFormat, m_parameters.dsFormat));
+ const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, m_imageExtent2D, colorFormat, m_colorImageUsage, m_parameters.dsFormat));
+ const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout (vk, device));
+ const Unique<VkPipeline> pipeline (makeGraphicsPipeline (vk, device, *pipelineLayout, *renderPass, *vertModule, *fragModule, m_imageExtent2D));
+ const Unique<VkCommandPool> cmdPool (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+
+ const std::vector<float> vertexArray (getVertices());
+ const deUint32 vertexCount (static_cast<deUint32>(vertexArray.size() / 4u));
+ const VkDeviceSize vertexArraySize (vertexArray.size() * sizeof(vertexArray[0]));
+ const Unique<VkBuffer> vertexBuffer (makeBuffer (vk, device, makeBufferCreateInfo(vertexArraySize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT)));
+ const UniquePtr<Allocation> vertexBufferAlloc (bindBuffer (vk, device, allocator, *vertexBuffer, MemoryRequirement::HostVisible));
+ const VkDeviceSize vertexBufferOffset (0u);
+
+ fillBuffer(vk, device, *vertexBufferAlloc, &vertexArray[0], vertexArraySize);
+
+ beginCommandBuffer(vk, *cmdBuffer);
+ {
+ const VkRenderPassAttachmentBeginInfoKHR renderPassAttachmentBeginInfo =
+ {
+ VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ 1u, // deUint32 attachmentCount;
+ &*colorAttachment // const VkImageView* pAttachments;
+ };
+
+ beginRenderPass(vk, *cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_imageExtent2D), clearColor, &renderPassAttachmentBeginInfo);
+ {
+ vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline);
+
+ vk.cmdBindVertexBuffers(*cmdBuffer, 0u, 1u, &*vertexBuffer, &vertexBufferOffset);
+
+ vk.cmdDraw(*cmdBuffer, vertexCount, 1u, 0u, 0u);
+ }
+ endRenderPass(vk, *cmdBuffer);
+
+ // Color image copy
+ {
+ const VkImageMemoryBarrier preCopyBarrier = makeImageMemoryBarrier (VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ *colorImage, colorSubresRange);
+ const VkBufferImageCopy region = makeBufferImageCopy (makeExtent3D(m_imageExtent2D.width, m_imageExtent2D.height, 1u),
+ makeImageSubresourceLayers(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 0u, 1u));
+ const VkBufferMemoryBarrier postCopyBarrier = makeBufferMemoryBarrier (VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *colorBuffer, 0ull, VK_WHOLE_SIZE);
+
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0u, 0u, DE_NULL, 0u, DE_NULL, 1u, &preCopyBarrier);
+ vk.cmdCopyImageToBuffer(*cmdBuffer, *colorImage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *colorBuffer, 1u, ®ion);
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, 0u, 0u, DE_NULL, 1u, &postCopyBarrier, DE_NULL, 0u);
+ }
+ }
+ endCommandBuffer(vk, *cmdBuffer);
+ submitCommandsAndWait(vk, device, queue, *cmdBuffer);
+
+ if (verifyBuffer(colorBufferAlloc, colorFormat, "Color", ASPECT_COLOR))
+ return tcu::TestStatus::pass("Pass");
+ else
+ return tcu::TestStatus::fail("Fail");
+}
+
+class DepthImagelessTestInstance : public ColorImagelessTestInstance
+{
+public:
+ DepthImagelessTestInstance (Context& context, const TestParameters& parameters);
+
+protected:
+ virtual tcu::TestStatus iterate (void);
+
+ virtual std::vector<float> getVertices (void);
+
+ virtual MovePtr<tcu::TextureLevel> generateReferenceImage (const tcu::TextureFormat& textureFormat,
+ const AspectFlags aspectFlags,
+ const deUint32 sample,
+ const deUint32 subpass);
+
+ VkImageUsageFlags m_dsImageUsage;
+};
+
+DepthImagelessTestInstance::DepthImagelessTestInstance (Context& context, const TestParameters& parameters)
+ : ColorImagelessTestInstance (context, parameters)
+ , m_dsImageUsage (VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT)
+{
+ const InstanceInterface& vki = m_context.getInstanceInterface();
+ const VkPhysicalDevice physDevice = m_context.getPhysicalDevice();
+
+ checkImageFormatProperties(vki, physDevice, m_parameters.dsFormat, m_dsImageUsage, m_imageExtent2D);
+}
+
+MovePtr<tcu::TextureLevel> DepthImagelessTestInstance::generateReferenceImage (const tcu::TextureFormat& textureFormat,
+ const AspectFlags aspectFlags,
+ const deUint32 sample,
+ const deUint32 subpass)
+{
+ const bool color = ((aspectFlags & ASPECT_COLOR) != 0);
+ const bool depth = ((aspectFlags & ASPECT_DEPTH) != 0);
+ const bool stencil = ((aspectFlags & ASPECT_STENCIL) != 0);
+ const int width = m_imageExtent2D.width;
+ const int height = m_imageExtent2D.height;
+ MovePtr<tcu::TextureLevel> image (new tcu::TextureLevel(textureFormat, width, height));
+ tcu::PixelBufferAccess access (image->getAccess());
+
+ DE_ASSERT(dePop32(aspectFlags) == 1);
+ DE_UNREF(sample);
+ DE_ASSERT(sample == NO_SAMPLE);
+ DE_UNREF(subpass);
+ DE_ASSERT(subpass == NO_SUBPASS);
+
+ if (color)
+ {
+ const int componentValue (static_cast<int>(0.75f * 0x100));
+ const tcu::RGBA colorDrawRGBA (tcu::RGBA(componentValue, componentValue, componentValue, 0xFF));
+ const tcu::Vec4 colorDraw (colorDrawRGBA.toVec());
+ const tcu::Vec4 colorDrawTop (tcu::RGBA::white().toVec());
+ const tcu::Vec4 colorFill (tcu::RGBA::black().toVec());
+
+ for (int y = 0; y < height; ++y)
+ for (int x = 0; x < width; ++x)
+ {
+ const tcu::Vec4& validColor = (y < height / 2) ? colorFill
+ : (x < width / 2) ? colorDraw
+ : colorDrawTop;
+
+ access.setPixel(validColor, x, y);
+ }
+ }
+
+ if (depth)
+ {
+ const int colorFillValue (static_cast<int>(1.00f * 0x100));
+ const int colorDrawValue (static_cast<int>(0.50f * 0x100));
+ const int colorTopValue (static_cast<int>(0.25f * 0x100));
+ const tcu::IVec4 colorFill (colorFillValue, 0, 0, 0xFF);
+ const tcu::IVec4 colorDraw (colorDrawValue, 0, 0, 0xFF);
+ const tcu::IVec4 colorTop (colorTopValue, 0, 0, 0xFF);
+
+ for (int y = 0; y < height; ++y)
+ for (int x = 0; x < width; ++x)
+ {
+ const tcu::IVec4& validColor = (y < height / 2) ? colorFill
+ : (x < width / 2) ? colorDraw
+ : colorTop;
+
+ access.setPixel(validColor, x, y);
+ }
+ }
+
+ if (stencil)
+ {
+ const int colorFillValue (static_cast<int>(0.00f * 0x100));
+ const int colorDrawValue (static_cast<int>(0.25f * 0x100));
+ const int colorTopValue (static_cast<int>(0.50f * 0x100));
+ const tcu::IVec4 colorFill (colorFillValue, 0, 0, 0xFF);
+ const tcu::IVec4 colorDraw (colorDrawValue, 0, 0, 0xFF);
+ const tcu::IVec4 colorTop (colorTopValue, 0, 0, 0xFF);
+
+ for (int y = 0; y < height; ++y)
+ for (int x = 0; x < width; ++x)
+ {
+ const tcu::IVec4& validColor = (y < height / 2) ? colorFill
+ : (x < width / 2) ? colorDraw
+ : colorTop;
+
+ access.setPixel(validColor, x, y);
+ }
+ }
+
+ return image;
+}
+
+std::vector<float> DepthImagelessTestInstance::getVertices (void)
+{
+ const float verticesData[] =
+ {
+ -1.0f, 0.0f, 0.50f, 1.0f,
+ -1.0f, +1.0f, 0.50f, 1.0f,
+ +1.0f, 0.0f, 0.50f, 1.0f,
+ -1.0f, +1.0f, 0.50f, 1.0f,
+ +1.0f, 0.0f, 0.50f, 1.0f,
+ +1.0f, +1.0f, 0.50f, 1.0f,
+
+ 0.0f, 0.0f, 0.25f, 1.0f,
+ 0.0f, +1.0f, 0.25f, 1.0f,
+ +1.0f, 0.0f, 0.25f, 1.0f,
+ 0.0f, +1.0f, 0.25f, 1.0f,
+ +1.0f, 0.0f, 0.25f, 1.0f,
+ +1.0f, +1.0f, 0.25f, 1.0f,
+ };
+ const std::vector<float> vertices (verticesData, verticesData + DE_LENGTH_OF_ARRAY(verticesData));
+
+ return vertices;
+}
+
+tcu::TestStatus DepthImagelessTestInstance::iterate (void)
+{
+ const DeviceInterface& vk = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+ const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
+ const VkQueue queue = m_context.getUniversalQueue();
+ Allocator& allocator = m_context.getDefaultAllocator();
+
+ const tcu::Vec4 clearColor = tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f);
+ const VkFormat colorFormat = m_parameters.colorFormat;
+ const VkDeviceSize colorBufferSize = m_imageExtent2D.width * m_imageExtent2D.height * tcu::getPixelSize(mapVkFormat(colorFormat));
+ const VkImageSubresourceRange colorSubresRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u);
+
+ const Unique<VkImage> colorImage (makeImage (vk, device, makeImageCreateInfo(colorFormat, m_imageExtent2D, m_colorImageUsage)));
+ const UniquePtr<Allocation> colorImageAlloc (bindImage (vk, device, allocator, *colorImage, MemoryRequirement::Any));
+ const Unique<VkImageView> colorAttachment (makeImageView (vk, device, *colorImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorSubresRange));
+ const Unique<VkBuffer> colorBuffer (makeBuffer (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> colorBufferAlloc (bindBuffer (vk, device, allocator, *colorBuffer, MemoryRequirement::HostVisible));
+
+ const float clearDepth = 1.0f;
+ const deUint32 clearStencil = 0u;
+ const VkFormat dsFormat = m_parameters.dsFormat;
+ const deUint32 dsImagePixelSize = static_cast<deUint32>(tcu::getPixelSize(mapVkFormat(dsFormat)));
+ const VkImageAspectFlags dsAspectFlags = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
+ const VkImageSubresourceRange dsSubresRange = makeImageSubresourceRange(dsAspectFlags, 0u, 1u, 0u, 1u);
+
+ const VkDeviceSize depthBufferSize = m_imageExtent2D.width * m_imageExtent2D.height * dsImagePixelSize;
+ const VkFormat stencilBufferFormat = getStencilBufferFormat(dsFormat);
+ const deUint32 stencilPixelSize = static_cast<deUint32>(tcu::getPixelSize(mapVkFormat(stencilBufferFormat)));
+ const VkDeviceSize stencilBufferSize = m_imageExtent2D.width * m_imageExtent2D.height * stencilPixelSize;
+
+ const Unique<VkImage> dsImage (makeImage (vk, device, makeImageCreateInfo(dsFormat, m_imageExtent2D, m_dsImageUsage)));
+ const UniquePtr<Allocation> dsImageAlloc (bindImage (vk, device, allocator, *dsImage, MemoryRequirement::Any));
+ const Unique<VkImageView> dsAttachment (makeImageView (vk, device, *dsImage, VK_IMAGE_VIEW_TYPE_2D, dsFormat, dsSubresRange));
+ const Unique<VkBuffer> depthBuffer (makeBuffer (vk, device, makeBufferCreateInfo(depthBufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> depthBufferAlloc (bindBuffer (vk, device, allocator, *depthBuffer, MemoryRequirement::HostVisible));
+ const Unique<VkBuffer> stencilBuffer (makeBuffer (vk, device, makeBufferCreateInfo(stencilBufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> stencilBufferAlloc (bindBuffer (vk, device, allocator, *stencilBuffer, MemoryRequirement::HostVisible));
+
+ const Unique<VkShaderModule> vertModule (createShaderModule (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+ const Unique<VkShaderModule> fragModule (createShaderModule (vk, device, m_context.getBinaryCollection().get("frag"), 0u));
+ const Unique<VkRenderPass> renderPass (makeRenderPass (vk, device, colorFormat, dsFormat));
+ const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, m_imageExtent2D, colorFormat, m_colorImageUsage, dsFormat, m_dsImageUsage));
+ const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout (vk, device));
+ const Unique<VkPipeline> pipeline (makeGraphicsPipeline (vk, device, *pipelineLayout, *renderPass, *vertModule, *fragModule, m_imageExtent2D, ASPECT_DEPTH_STENCIL));
+ const Unique<VkCommandPool> cmdPool (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+
+ const std::vector<float> vertexArray (getVertices());
+ const deUint32 vertexCount (static_cast<deUint32>(vertexArray.size() / 4u));
+ const VkDeviceSize vertexArraySize (vertexArray.size() * sizeof(vertexArray[0]));
+ const Unique<VkBuffer> vertexBuffer (makeBuffer (vk, device, makeBufferCreateInfo(vertexArraySize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT)));
+ const UniquePtr<Allocation> vertexBufferAlloc (bindBuffer (vk, device, allocator, *vertexBuffer, MemoryRequirement::HostVisible));
+ const VkDeviceSize vertexBufferOffset (0u);
+
+ fillBuffer(vk, device, *vertexBufferAlloc, &vertexArray[0], vertexArraySize);
+
+ beginCommandBuffer(vk, *cmdBuffer);
+ {
+ const VkImageView attachments[] = { *colorAttachment, *dsAttachment };
+ const VkRenderPassAttachmentBeginInfoKHR renderPassAttachmentBeginInfo =
+ {
+ VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ DE_LENGTH_OF_ARRAY(attachments), // deUint32 attachmentCount;
+ attachments // const VkImageView* pAttachments;
+ };
+
+ beginRenderPass(vk, *cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_imageExtent2D), clearColor, clearDepth, clearStencil, &renderPassAttachmentBeginInfo);
+ {
+ vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline);
+
+ vk.cmdBindVertexBuffers(*cmdBuffer, 0u, 1u, &*vertexBuffer, &vertexBufferOffset);
+
+ vk.cmdDraw(*cmdBuffer, vertexCount, 1u, 0u, 0u);
+ }
+ endRenderPass(vk, *cmdBuffer);
+
+ // Color image copy
+ {
+ const VkImageMemoryBarrier preCopyBarrier = makeImageMemoryBarrier (VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ *colorImage, colorSubresRange);
+ const VkBufferImageCopy region = makeBufferImageCopy (makeExtent3D(m_imageExtent2D.width, m_imageExtent2D.height, 1u),
+ makeImageSubresourceLayers(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 0u, 1u));
+ const VkBufferMemoryBarrier postCopyBarrier = makeBufferMemoryBarrier (VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *colorBuffer, 0ull, VK_WHOLE_SIZE);
+
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0u, 0u, DE_NULL, 0u, DE_NULL, 1u, &preCopyBarrier);
+ vk.cmdCopyImageToBuffer(*cmdBuffer, *colorImage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *colorBuffer, 1u, ®ion);
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, 0u, 0u, DE_NULL, 1u, &postCopyBarrier, DE_NULL, 0u);
+ }
+
+ // Depth/Stencil image copy
+ {
+ const VkImageMemoryBarrier preCopyBarrier = makeImageMemoryBarrier(VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
+ VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *dsImage, dsSubresRange);
+ const VkBufferImageCopy depthCopyRegion = makeBufferImageCopy(makeExtent3D(m_imageExtent2D.width, m_imageExtent2D.height, 1u),
+ makeImageSubresourceLayers(VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 0u, 1u));
+ const VkBufferImageCopy stencilCopyRegion = makeBufferImageCopy(makeExtent3D(m_imageExtent2D.width, m_imageExtent2D.height, 1u),
+ makeImageSubresourceLayers(VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u));
+ const VkBufferMemoryBarrier postCopyBarriers[] =
+ {
+ makeBufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *depthBuffer, 0ull, VK_WHOLE_SIZE),
+ makeBufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *stencilBuffer, 0ull, VK_WHOLE_SIZE),
+ };
+
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0u, 0u, DE_NULL, 0u, DE_NULL, 1u, &preCopyBarrier);
+ vk.cmdCopyImageToBuffer(*cmdBuffer, *dsImage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *depthBuffer, 1u, &depthCopyRegion);
+ vk.cmdCopyImageToBuffer(*cmdBuffer, *dsImage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *stencilBuffer, 1u, &stencilCopyRegion);
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, 0u, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(postCopyBarriers), postCopyBarriers, DE_NULL, 0u);
+ }
+ }
+ endCommandBuffer(vk, *cmdBuffer);
+ submitCommandsAndWait(vk, device, queue, *cmdBuffer);
+
+ {
+ std::string result;
+
+ if (!verifyBuffer(colorBufferAlloc, colorFormat, "Color", ASPECT_COLOR))
+ result += " Color";
+
+ if (!verifyBuffer(depthBufferAlloc, dsFormat, "Depth", ASPECT_DEPTH))
+ result += " Depth";
+
+ if (!verifyBuffer(stencilBufferAlloc, stencilBufferFormat, "Stencil", ASPECT_STENCIL))
+ result += " Stencil";
+
+ if (result.empty())
+ return tcu::TestStatus::pass("Pass");
+ else
+ return tcu::TestStatus::fail("Following parts of image are incorrect:" + result);
+ }
+}
+
+class ColorResolveImagelessTestInstance : public ColorImagelessTestInstance
+{
+public:
+ ColorResolveImagelessTestInstance (Context& context, const TestParameters& parameters);
+protected:
+ virtual tcu::TestStatus iterate (void);
+
+ virtual MovePtr<tcu::TextureLevel> generateReferenceImage (const tcu::TextureFormat& textureFormat,
+ const AspectFlags aspectFlags,
+ const deUint32 sample,
+ const deUint32 subpass);
+
+ virtual std::vector<float> getVertices (void);
+};
+
+ColorResolveImagelessTestInstance::ColorResolveImagelessTestInstance (Context& context, const TestParameters& parameters)
+ : ColorImagelessTestInstance (context, parameters)
+{
+ const InstanceInterface& vki = m_context.getInstanceInterface();
+ const VkPhysicalDevice physDevice = m_context.getPhysicalDevice();
+
+ // To validate per-sample image image must also be sampled
+ m_colorImageUsage |= VK_IMAGE_USAGE_SAMPLED_BIT;
+
+ checkImageFormatProperties(vki, physDevice, m_parameters.colorFormat, m_colorImageUsage, m_imageExtent2D);
+}
+
+MovePtr<tcu::TextureLevel> ColorResolveImagelessTestInstance::generateReferenceImage (const tcu::TextureFormat& textureFormat,
+ const AspectFlags aspectFlags,
+ const deUint32 sample,
+ const deUint32 subpass)
+{
+ const int width = m_imageExtent2D.width;
+ const int height = m_imageExtent2D.height;
+ MovePtr<tcu::TextureLevel> image (new tcu::TextureLevel(textureFormat, width, height));
+ tcu::PixelBufferAccess access (image->getAccess());
+ const int componentValue (static_cast<int>(0.75f * 0x100));
+ const tcu::RGBA colorDrawRGBA (tcu::RGBA(componentValue, componentValue, componentValue, 0xFF));
+ const tcu::Vec4 colorDraw (colorDrawRGBA.toVec());
+ const tcu::Vec4 colorFill (tcu::RGBA::black().toVec());
+ const tcu::Vec4 colorEdge0 (colorFill);
+ const tcu::Vec4 colorEdge1 (colorDraw);
+ const tcu::Vec4 colorEdgeR ((colorDraw.x() + colorFill.x()) / 2, (colorDraw.y() + colorFill.y()) / 2, (colorDraw.z() + colorFill.z()) / 2, colorDraw.w());
+ const tcu::Vec4& colorEdge = sample == 0 ? colorEdge0
+ : sample == 1 ? colorEdge1
+ : colorEdgeR;
+
+ DE_UNREF(aspectFlags);
+ DE_ASSERT(dePop32(aspectFlags) == 1);
+ DE_ASSERT(aspectFlags == ASPECT_COLOR);
+ DE_UNREF(subpass);
+ DE_ASSERT(subpass == NO_SUBPASS);
+
+ for (int y = 0; y < height; ++y)
+ for (int x = 0; x < width; ++x)
+ {
+ const int mx = width - 1 - x;
+ const tcu::Vec4& validColor = (y == mx) ? colorEdge
+ : (y > mx) ? colorFill
+ : colorDraw;
+
+ access.setPixel(validColor, x, y);
+ }
+
+ return image;
+}
+
+std::vector<float> ColorResolveImagelessTestInstance::getVertices (void)
+{
+ const float verticesData[] =
+ {
+ -1.0f, -1.0f, 0.0f, 1.0f,
+ -1.0f, +1.0f, 0.0f, 1.0f,
+ +1.0f, -1.0f, 0.0f, 1.0f,
+ };
+ const std::vector<float> vertices (verticesData, verticesData + DE_LENGTH_OF_ARRAY(verticesData));
+
+ return vertices;
+}
+
+tcu::TestStatus ColorResolveImagelessTestInstance::iterate (void)
+{
+ const DeviceInterface& vk = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+ const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
+ const VkQueue queue = m_context.getUniversalQueue();
+ Allocator& allocator = m_context.getDefaultAllocator();
+
+ const VkSampleCountFlagBits sampleCount = VK_SAMPLE_COUNT_2_BIT;
+ const tcu::Vec4 clearColor = tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f);
+ const VkFormat colorFormat = m_parameters.colorFormat;
+ const VkDeviceSize colorBufferSize = m_imageExtent2D.width * m_imageExtent2D.height * tcu::getPixelSize(mapVkFormat(colorFormat));
+ const VkImageSubresourceRange colorSubresRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u);
+
+ const Unique<VkImage> colorImage (makeImage (vk, device, makeImageCreateInfo(colorFormat, m_imageExtent2D, m_colorImageUsage, sampleCount)));
+ const UniquePtr<Allocation> colorImageAlloc (bindImage (vk, device, allocator, *colorImage, MemoryRequirement::Any));
+ const Unique<VkImageView> colorAttachment (makeImageView (vk, device, *colorImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorSubresRange));
+
+ const Unique<VkImage> colorResolveImage (makeImage (vk, device, makeImageCreateInfo(colorFormat, m_imageExtent2D, m_colorImageUsage)));
+ const UniquePtr<Allocation> colorResolveImageAlloc (bindImage (vk, device, allocator, *colorResolveImage, MemoryRequirement::Any));
+ const Unique<VkImageView> colorResolveAttachment (makeImageView (vk, device, *colorResolveImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorSubresRange));
+ const Unique<VkBuffer> colorResolveBuffer (makeBuffer (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> colorResolveBufferAlloc (bindBuffer (vk, device, allocator, *colorResolveBuffer, MemoryRequirement::HostVisible));
+
+ const Unique<VkShaderModule> vertModule (createShaderModule (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+ const Unique<VkShaderModule> fragModule (createShaderModule (vk, device, m_context.getBinaryCollection().get("frag"), 0u));
+ const Unique<VkRenderPass> renderPass (makeRenderPass (vk, device, colorFormat, m_parameters.dsFormat, sampleCount));
+ const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, m_imageExtent2D, colorFormat, m_colorImageUsage, m_parameters.dsFormat, 0u, ASPECT_COLOR));
+ const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout (vk, device));
+ const Unique<VkPipeline> pipeline (makeGraphicsPipeline (vk, device, *pipelineLayout, *renderPass, *vertModule, *fragModule, m_imageExtent2D, ASPECT_NONE, sampleCount));
+ const Unique<VkCommandPool> cmdPool (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+
+ const std::vector<float> vertexArray (getVertices());
+ const deUint32 vertexCount (static_cast<deUint32>(vertexArray.size() / 4u));
+ const VkDeviceSize vertexArraySize (vertexArray.size() * sizeof(vertexArray[0]));
+ const Unique<VkBuffer> vertexBuffer (makeBuffer (vk, device, makeBufferCreateInfo(vertexArraySize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT)));
+ const UniquePtr<Allocation> vertexBufferAlloc (bindBuffer (vk, device, allocator, *vertexBuffer, MemoryRequirement::HostVisible));
+ const VkDeviceSize vertexBufferOffset (0u);
+
+ fillBuffer(vk, device, *vertexBufferAlloc, &vertexArray[0], vertexArraySize);
+
+ beginCommandBuffer(vk, *cmdBuffer);
+ {
+ const VkImageView attachments[] = { *colorAttachment, *colorResolveAttachment };
+ const VkRenderPassAttachmentBeginInfoKHR renderPassAttachmentBeginInfo =
+ {
+ VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ DE_LENGTH_OF_ARRAY(attachments), // deUint32 attachmentCount;
+ attachments // const VkImageView* pAttachments;
+ };
+
+ beginRenderPass(vk, *cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_imageExtent2D), clearColor, &renderPassAttachmentBeginInfo);
+ {
+ vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline);
+
+ vk.cmdBindVertexBuffers(*cmdBuffer, 0u, 1u, &*vertexBuffer, &vertexBufferOffset);
+
+ vk.cmdDraw(*cmdBuffer, vertexCount, 1u, 0u, 0u);
+ }
+ endRenderPass(vk, *cmdBuffer);
+
+ // Color image copy
+ {
+ const VkImageMemoryBarrier preCopyBarrier = makeImageMemoryBarrier (VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ *colorResolveImage, colorSubresRange);
+ const VkBufferImageCopy region = makeBufferImageCopy (makeExtent3D(m_imageExtent2D.width, m_imageExtent2D.height, 1u),
+ makeImageSubresourceLayers(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 0u, 1u));
+ const VkBufferMemoryBarrier postCopyBarrier = makeBufferMemoryBarrier (VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *colorResolveBuffer, 0ull, VK_WHOLE_SIZE);
+
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0u, 0u, DE_NULL, 0u, DE_NULL, 1u, &preCopyBarrier);
+ vk.cmdCopyImageToBuffer(*cmdBuffer, *colorResolveImage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *colorResolveBuffer, 1u, ®ion);
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, 0u, 0u, DE_NULL, 1u, &postCopyBarrier, DE_NULL, 0u);
+ }
+ }
+ endCommandBuffer(vk, *cmdBuffer);
+ submitCommandsAndWait(vk, device, queue, *cmdBuffer);
+
+ {
+ std::string result;
+
+ if (!verifyBuffer(colorResolveBufferAlloc, colorFormat, "ResolveColor", ASPECT_COLOR))
+ result += " ResolveColor";
+
+ // Parse color aspect of separate samples of multisample image
+ for (deUint32 sampleNdx = 0; sampleNdx < sampleCount; ++sampleNdx)
+ {
+ const std::string name ("Color" + de::toString(sampleNdx));
+ const Unique<VkImage> imageSample (makeImage (vk, device, makeImageCreateInfo(colorFormat, m_imageExtent2D, m_colorImageUsage)));
+ const UniquePtr<Allocation> imageSampleAlloc (bindImage (vk, device, allocator, *imageSample, MemoryRequirement::Any));
+ const Unique<VkBuffer> imageBuffer (makeBuffer (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> imageBufferAlloc (bindBuffer (vk, device, allocator, *imageBuffer, MemoryRequirement::HostVisible));
+
+ readOneSampleFromMultisampleImage(colorFormat, colorImage, sampleNdx, colorFormat, imageSample, imageBuffer, ASPECT_COLOR);
+
+ if (!verifyBuffer(imageBufferAlloc, colorFormat, name, ASPECT_COLOR, sampleNdx))
+ result += " " + name;
+ }
+
+
+ if (result.empty())
+ return tcu::TestStatus::pass("Pass");
+ else
+ return tcu::TestStatus::fail("Fail");
+ }
+}
+
+class DepthResolveImagelessTestInstance : public DepthImagelessTestInstance
+{
+public:
+ DepthResolveImagelessTestInstance (Context& context, const TestParameters& parameters);
+
+protected:
+ virtual tcu::TestStatus iterate (void);
+
+ virtual MovePtr<tcu::TextureLevel> generateReferenceImage (const tcu::TextureFormat& textureFormat,
+ const AspectFlags aspectFlags,
+ const deUint32 sample,
+ const deUint32 subpass);
+
+ virtual std::vector<float> getVertices (void);
+};
+
+DepthResolveImagelessTestInstance::DepthResolveImagelessTestInstance (Context& context, const TestParameters& parameters)
+ : DepthImagelessTestInstance (context, parameters)
+{
+ context.requireDeviceExtension("VK_KHR_depth_stencil_resolve");
+
+ const InstanceInterface& vki = m_context.getInstanceInterface();
+ const VkPhysicalDevice physDevice = m_context.getPhysicalDevice();
+ VkPhysicalDeviceProperties2 deviceProperties;
+ VkPhysicalDeviceDepthStencilResolvePropertiesKHR dsResolveProperties;
+
+ deMemset(&deviceProperties, 0, sizeof(deviceProperties));
+ deMemset(&dsResolveProperties, 0, sizeof(dsResolveProperties));
+
+ deviceProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+ deviceProperties.pNext = &dsResolveProperties;
+
+ dsResolveProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR;
+ dsResolveProperties.pNext = DE_NULL;
+
+ vki.getPhysicalDeviceProperties2(physDevice, &deviceProperties);
+
+ if ((dsResolveProperties.supportedDepthResolveModes & VK_RESOLVE_MODE_AVERAGE_BIT_KHR) == 0)
+ TCU_THROW(NotSupportedError, "Depth resolve does not support required VK_RESOLVE_MODE_AVERAGE_BIT_KHR");
+
+ if ((dsResolveProperties.supportedStencilResolveModes & VK_RESOLVE_MODE_MAX_BIT_KHR) == 0)
+ TCU_THROW(NotSupportedError, "Stencil resolve does not support required VK_RESOLVE_MODE_MAX_BIT_KHR");
+
+ m_colorImageUsage |= VK_IMAGE_USAGE_SAMPLED_BIT;
+
+ checkImageFormatProperties(vki, physDevice, m_parameters.colorFormat, m_colorImageUsage, m_imageExtent2D);
+
+ m_dsImageUsage |= VK_IMAGE_USAGE_SAMPLED_BIT;
+
+ checkImageFormatProperties(vki, physDevice, m_parameters.dsFormat, m_dsImageUsage, m_imageExtent2D);
+}
+
+MovePtr<tcu::TextureLevel> DepthResolveImagelessTestInstance::generateReferenceImage (const tcu::TextureFormat& textureFormat,
+ const AspectFlags aspectFlags,
+ const deUint32 sample,
+ const deUint32 subpass)
+{
+ const bool color = ((aspectFlags & ASPECT_COLOR) != 0);
+ const bool depth = ((aspectFlags & ASPECT_DEPTH) != 0);
+ const bool stencil = ((aspectFlags & ASPECT_STENCIL) != 0);
+ const int width = m_imageExtent2D.width;
+ const int height = m_imageExtent2D.height;
+ MovePtr<tcu::TextureLevel> image (new tcu::TextureLevel(textureFormat, width, height));
+ tcu::PixelBufferAccess access (image->getAccess());
+
+ DE_ASSERT(dePop32(aspectFlags) == 1);
+ DE_UNREF(subpass);
+
+ if (color)
+ {
+ const tcu::Vec4 colorDraw (tcu::RGBA::blue().toVec());
+ const tcu::Vec4 colorFill (tcu::RGBA::black().toVec());
+ const tcu::Vec4 colorEdge0 (colorFill);
+ const tcu::Vec4 colorEdge1 (colorDraw);
+ const tcu::Vec4 colorEdgeR ((colorDraw.x() + colorFill.x()) / 2, (colorDraw.y() + colorFill.y()) / 2, (colorDraw.z() + colorFill.z()) / 2, colorDraw.w());
+ const tcu::Vec4& colorEdge = sample == 0 ? colorEdge0
+ : sample == 1 ? colorEdge1
+ : colorEdgeR;
+
+ for (int y = 0; y < height; ++y)
+ for (int x = 0; x < width; ++x)
+ {
+ const int mx = width - 1 - x;
+ const tcu::Vec4& validColor = (y == mx) ? colorEdge
+ : (y > mx) ? colorFill
+ : colorDraw;
+
+ access.setPixel(validColor, x, y);
+ }
+ }
+
+ if (depth)
+ {
+ const int colorFillValue (static_cast<int>(1.00f * 0x100));
+ const int colorDrawValue (static_cast<int>(0.00f * 0x100));
+ const int colorEdgeValue (static_cast<int>(0.50f * 0x100));
+ const tcu::IVec4 colorFill (colorFillValue, colorFillValue, colorFillValue, 0xFF);
+ const tcu::IVec4 colorDraw (colorDrawValue, colorDrawValue, colorDrawValue, 0xFF);
+ const tcu::IVec4 colorEdge0 (colorFill);
+ const tcu::IVec4 colorEdge1 (colorDraw);
+ const tcu::IVec4 colorEdgeR (colorEdgeValue, colorEdgeValue, colorEdgeValue, 0xFF);
+ const tcu::IVec4& colorEdge = sample == 0 ? colorEdge0
+ : sample == 1 ? colorEdge1
+ : colorEdgeR;
+
+ for (int y = 0; y < height; ++y)
+ for (int x = 0; x < width; ++x)
+ {
+ const int mx = width - 1 - x;
+ const tcu::IVec4& validColor = (y == mx) ? colorEdge
+ : (y > mx) ? colorFill
+ : colorDraw;
+
+ access.setPixel(validColor, x, y);
+ }
+ }
+
+ if (stencil)
+ {
+ const int colorFillValue ((0 * 0x100) / 4);
+ const int colorDrawValue ((1 * 0x100) / 4);
+ const int colorEdgeValue ((1 * 0x100) / 4);
+ const tcu::IVec4 colorFill (colorFillValue, colorFillValue, colorFillValue, 0xFF);
+ const tcu::IVec4 colorDraw (colorDrawValue, colorDrawValue, colorDrawValue, 0xFF);
+ const tcu::IVec4 colorEdge0 (colorFill);
+ const tcu::IVec4 colorEdge1 (colorDraw);
+ const tcu::IVec4 colorEdgeR (colorEdgeValue, colorEdgeValue, colorEdgeValue, 0xFF);
+ const tcu::IVec4& colorEdge = sample == 0 ? colorEdge0
+ : sample == 1 ? colorEdge1
+ : colorEdgeR;
+
+ for (int y = 0; y < height; ++y)
+ for (int x = 0; x < width; ++x)
+ {
+ const int mx = width - 1 - x;
+ const tcu::IVec4& validColor = (y == mx) ? colorEdge
+ : (y > mx) ? colorFill
+ : colorDraw;
+
+ access.setPixel(validColor, x, y);
+ }
+ }
+
+ return image;
+}
+
+std::vector<float> DepthResolveImagelessTestInstance::getVertices (void)
+{
+ const float verticesData[] =
+ {
+ -1.0f, -1.0f, 0.0f, 1.0f,
+ -1.0f, +1.0f, 0.0f, 1.0f,
+ +1.0f, -1.0f, 0.0f, 1.0f,
+ -1.0f, -1.0f, 0.5f, 1.0f,
+ -1.0f, +1.0f, 0.5f, 1.0f,
+ +1.0f, -1.0f, 0.5f, 1.0f,
+ };
+ const std::vector<float> vertices (verticesData, verticesData + DE_LENGTH_OF_ARRAY(verticesData));
+
+ return vertices;
+}
+
+tcu::TestStatus DepthResolveImagelessTestInstance::iterate (void)
+{
+ const DeviceInterface& vk = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+ const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
+ const VkQueue queue = m_context.getUniversalQueue();
+ Allocator& allocator = m_context.getDefaultAllocator();
+
+ const deUint32 sampleCount = 2u;
+ const VkSampleCountFlagBits sampleCountFlag = sampleCountBitFromSampleCount(sampleCount);
+ const tcu::Vec4 clearColor = tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f);
+ const VkFormat colorFormat = m_parameters.colorFormat;
+ const VkDeviceSize colorBufferSize = m_imageExtent2D.width * m_imageExtent2D.height * tcu::getPixelSize(mapVkFormat(colorFormat));
+ const VkImageSubresourceRange colorSubresRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u);
+
+ const Unique<VkImage> colorImage (makeImage (vk, device, makeImageCreateInfo(colorFormat, m_imageExtent2D, m_colorImageUsage, sampleCountFlag)));
+ const UniquePtr<Allocation> colorImageAlloc (bindImage (vk, device, allocator, *colorImage, MemoryRequirement::Any));
+ const Unique<VkImageView> colorAttachment (makeImageView (vk, device, *colorImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorSubresRange));
+
+ const Unique<VkImage> colorResolveImage (makeImage (vk, device, makeImageCreateInfo(colorFormat, m_imageExtent2D, m_colorImageUsage)));
+ const UniquePtr<Allocation> colorResolveImageAlloc (bindImage (vk, device, allocator, *colorResolveImage, MemoryRequirement::Any));
+ const Unique<VkImageView> colorResolveAttachment (makeImageView (vk, device, *colorResolveImage, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorSubresRange));
+ const Unique<VkBuffer> colorResolveBuffer (makeBuffer (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> colorResolveBufferAlloc (bindBuffer (vk, device, allocator, *colorResolveBuffer, MemoryRequirement::HostVisible));
+
+ const float clearDepth = 1.0f;
+ const deUint32 clearStencil = 0u;
+ const VkFormat dsFormat = m_parameters.dsFormat;
+ const deUint32 dsImagePixelSize = static_cast<deUint32>(tcu::getPixelSize(mapVkFormat(dsFormat)));
+ const VkImageAspectFlags dsAspectFlags = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
+ const VkImageSubresourceRange dsSubresRange = makeImageSubresourceRange(dsAspectFlags, 0u, 1u, 0u, 1u);
+
+ const VkDeviceSize depthBufferSize = m_imageExtent2D.width * m_imageExtent2D.height * dsImagePixelSize;
+ const VkFormat stencilBufferFormat = getStencilBufferFormat(dsFormat);
+ const deUint32 stencilPixelSize = static_cast<deUint32>(tcu::getPixelSize(mapVkFormat(stencilBufferFormat)));
+ const VkDeviceSize stencilBufferSize = m_imageExtent2D.width * m_imageExtent2D.height * stencilPixelSize;
+
+ const Unique<VkImage> dsImage (makeImage (vk, device, makeImageCreateInfo(dsFormat, m_imageExtent2D, m_dsImageUsage, sampleCountFlag)));
+ const UniquePtr<Allocation> dsImageAlloc (bindImage (vk, device, allocator, *dsImage, MemoryRequirement::Any));
+ const Unique<VkImageView> dsAttachment (makeImageView (vk, device, *dsImage, VK_IMAGE_VIEW_TYPE_2D, dsFormat, dsSubresRange));
+
+ const Unique<VkImage> dsResolveImage (makeImage (vk, device, makeImageCreateInfo(dsFormat, m_imageExtent2D, m_dsImageUsage)));
+ const UniquePtr<Allocation> dsResolveImageAlloc (bindImage (vk, device, allocator, *dsResolveImage, MemoryRequirement::Any));
+ const Unique<VkImageView> dsResolveAttachment (makeImageView (vk, device, *dsResolveImage, VK_IMAGE_VIEW_TYPE_2D, dsFormat, dsSubresRange));
+ const Unique<VkBuffer> depthResolveBuffer (makeBuffer (vk, device, makeBufferCreateInfo(depthBufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> depthResolveBufferAlloc (bindBuffer (vk, device, allocator, *depthResolveBuffer, MemoryRequirement::HostVisible));
+ const Unique<VkBuffer> stencilResolveBuffer (makeBuffer (vk, device, makeBufferCreateInfo(stencilBufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> stencilResolveBufferAlloc (bindBuffer (vk, device, allocator, *stencilResolveBuffer, MemoryRequirement::HostVisible));
+
+ const Unique<VkShaderModule> vertModule (createShaderModule (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+ const Unique<VkShaderModule> fragModule (createShaderModule (vk, device, m_context.getBinaryCollection().get("frag"), 0u));
+ const Unique<VkRenderPass> renderPass (makeRenderPass (vk, device, colorFormat, m_parameters.dsFormat, sampleCountFlag, sampleCountFlag));
+ const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, m_imageExtent2D, colorFormat, m_colorImageUsage, m_parameters.dsFormat, m_dsImageUsage, ASPECT_COLOR|ASPECT_DEPTH_STENCIL));
+ const Unique<VkPipelineLayout> pipelineLayout (makePipelineLayout (vk, device));
+ const Unique<VkPipeline> pipeline (makeGraphicsPipeline (vk, device, *pipelineLayout, *renderPass, *vertModule, *fragModule, m_imageExtent2D, ASPECT_DEPTH_STENCIL, sampleCountFlag));
+ const Unique<VkCommandPool> cmdPool (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+
+ const std::vector<float> vertexArray (getVertices());
+ const deUint32 vertexCount (static_cast<deUint32>(vertexArray.size() / 4u));
+ const VkDeviceSize vertexArraySize (vertexArray.size() * sizeof(vertexArray[0]));
+ const Unique<VkBuffer> vertexBuffer (makeBuffer (vk, device, makeBufferCreateInfo(vertexArraySize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT)));
+ const UniquePtr<Allocation> vertexBufferAlloc (bindBuffer (vk, device, allocator, *vertexBuffer, MemoryRequirement::HostVisible));
+ const VkDeviceSize vertexBufferOffset (0u);
+
+ fillBuffer(vk, device, *vertexBufferAlloc, &vertexArray[0], vertexArraySize);
+
+ beginCommandBuffer(vk, *cmdBuffer);
+ {
+ const VkImageView attachments[] = { *colorAttachment, *dsAttachment, *colorResolveAttachment, *dsResolveAttachment };
+ const VkRenderPassAttachmentBeginInfoKHR renderPassAttachmentBeginInfo =
+ {
+ VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ DE_LENGTH_OF_ARRAY(attachments), // deUint32 attachmentCount;
+ attachments // const VkImageView* pAttachments;
+ };
+
+ beginRenderPass(vk, *cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_imageExtent2D), clearColor, clearDepth, clearStencil, &renderPassAttachmentBeginInfo);
+ {
+ vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline);
+
+ vk.cmdBindVertexBuffers(*cmdBuffer, 0u, 1u, &*vertexBuffer, &vertexBufferOffset);
+
+ vk.cmdDraw(*cmdBuffer, vertexCount, 1u, 0u, 0u);
+ }
+ endRenderPass(vk, *cmdBuffer);
+
+ // Color resolve image copy
+ {
+ const VkImageMemoryBarrier preCopyBarrier = makeImageMemoryBarrier (VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ *colorResolveImage, colorSubresRange);
+ const VkBufferImageCopy region = makeBufferImageCopy (makeExtent3D(m_imageExtent2D.width, m_imageExtent2D.height, 1u),
+ makeImageSubresourceLayers(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 0u, 1u));
+ const VkBufferMemoryBarrier postCopyBarrier = makeBufferMemoryBarrier (VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *colorResolveBuffer, 0ull, VK_WHOLE_SIZE);
+
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0u, 0u, DE_NULL, 0u, DE_NULL, 1u, &preCopyBarrier);
+ vk.cmdCopyImageToBuffer(*cmdBuffer, *colorResolveImage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *colorResolveBuffer, 1u, ®ion);
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, 0u, 0u, DE_NULL, 1u, &postCopyBarrier, DE_NULL, 0u);
+ }
+
+ // Depth/Stencil resolve image copy
+ {
+ const VkImageMemoryBarrier preCopyBarrier = makeImageMemoryBarrier(VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
+ VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ *dsResolveImage, dsSubresRange);
+ const VkBufferImageCopy depthCopyRegion = makeBufferImageCopy(makeExtent3D(m_imageExtent2D.width, m_imageExtent2D.height, 1u),
+ makeImageSubresourceLayers(VK_IMAGE_ASPECT_DEPTH_BIT, 0u, 0u, 1u));
+ const VkBufferImageCopy stencilCopyRegion = makeBufferImageCopy(makeExtent3D(m_imageExtent2D.width, m_imageExtent2D.height, 1u),
+ makeImageSubresourceLayers(VK_IMAGE_ASPECT_STENCIL_BIT, 0u, 0u, 1u));
+ const VkBufferMemoryBarrier postCopyBarriers[] =
+ {
+ makeBufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *depthResolveBuffer, 0ull, VK_WHOLE_SIZE),
+ makeBufferMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *stencilResolveBuffer, 0ull, VK_WHOLE_SIZE),
+ };
+
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0u, 0u, DE_NULL, 0u, DE_NULL, 1u, &preCopyBarrier);
+ vk.cmdCopyImageToBuffer(*cmdBuffer, *dsResolveImage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *depthResolveBuffer, 1u, &depthCopyRegion);
+ vk.cmdCopyImageToBuffer(*cmdBuffer, *dsResolveImage, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *stencilResolveBuffer, 1u, &stencilCopyRegion);
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, 0u, 0u, DE_NULL, DE_LENGTH_OF_ARRAY(postCopyBarriers), postCopyBarriers, DE_NULL, 0u);
+ }
+ }
+ endCommandBuffer(vk, *cmdBuffer);
+ submitCommandsAndWait(vk, device, queue, *cmdBuffer);
+
+ {
+ std::string result;
+
+ if (!verifyBuffer(colorResolveBufferAlloc, colorFormat, "ResolveColor", ASPECT_COLOR))
+ result += " ResolveColor";
+
+ if (!verifyBuffer(depthResolveBufferAlloc, dsFormat, "ResolveDepth", ASPECT_DEPTH))
+ result += " ResolveDepth";
+
+ if (!verifyBuffer(stencilResolveBufferAlloc, stencilBufferFormat, "ResolveStencil", ASPECT_STENCIL))
+ result += " ResolveStencil";
+
+ // Parse color aspect of separate samples of multisample image
+ for (deUint32 sampleNdx = 0; sampleNdx < sampleCount; ++sampleNdx)
+ {
+ const std::string name ("Color" + de::toString(sampleNdx));
+ const Unique<VkImage> imageSample (makeImage (vk, device, makeImageCreateInfo(colorFormat, m_imageExtent2D, m_colorImageUsage)));
+ const UniquePtr<Allocation> imageSampleAlloc (bindImage (vk, device, allocator, *imageSample, MemoryRequirement::Any));
+ const Unique<VkBuffer> imageBuffer (makeBuffer (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> imageBufferAlloc (bindBuffer (vk, device, allocator, *imageBuffer, MemoryRequirement::HostVisible));
+
+ readOneSampleFromMultisampleImage(colorFormat, colorImage, sampleNdx, colorFormat, imageSample, imageBuffer, ASPECT_COLOR);
+
+ if (!verifyBuffer(imageBufferAlloc, colorFormat, name, ASPECT_COLOR, sampleNdx))
+ result += " " + name;
+ }
+
+ // Parse depth aspect of separate samples of multisample image
+ for (deUint32 sampleNdx = 0; sampleNdx < sampleCount; ++sampleNdx)
+ {
+ const std::string name ("Depth" + de::toString(sampleNdx));
+ const Unique<VkImage> imageSample (makeImage (vk, device, makeImageCreateInfo(colorFormat, m_imageExtent2D, m_colorImageUsage)));
+ const UniquePtr<Allocation> imageSampleAlloc (bindImage (vk, device, allocator, *imageSample, MemoryRequirement::Any));
+ const Unique<VkBuffer> imageBuffer (makeBuffer (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> imageBufferAlloc (bindBuffer (vk, device, allocator, *imageBuffer, MemoryRequirement::HostVisible));
+
+ readOneSampleFromMultisampleImage(dsFormat, dsImage, sampleNdx, colorFormat, imageSample, imageBuffer, ASPECT_DEPTH);
+
+ if (!verifyBuffer(imageBufferAlloc, colorFormat, name, ASPECT_DEPTH, sampleNdx))
+ result += " " + name;
+ }
+
+ // Parse stencil aspect of separate samples of multisample image
+ for (deUint32 sampleNdx = 0; sampleNdx < sampleCount; ++sampleNdx)
+ {
+ const std::string name ("Stencil" + de::toString(sampleNdx));
+ const Unique<VkImage> imageSample (makeImage (vk, device, makeImageCreateInfo(colorFormat, m_imageExtent2D, m_colorImageUsage)));
+ const UniquePtr<Allocation> imageSampleAlloc (bindImage (vk, device, allocator, *imageSample, MemoryRequirement::Any));
+ const Unique<VkBuffer> imageBuffer (makeBuffer (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> imageBufferAlloc (bindBuffer (vk, device, allocator, *imageBuffer, MemoryRequirement::HostVisible));
+
+ readOneSampleFromMultisampleImage(dsFormat, dsImage, sampleNdx, colorFormat, imageSample, imageBuffer, ASPECT_STENCIL);
+
+ if (!verifyBuffer(imageBufferAlloc, colorFormat, name, ASPECT_STENCIL, sampleNdx))
+ result += " " + name;
+ }
+
+ if (result.empty())
+ return tcu::TestStatus::pass("Pass");
+ else
+ return tcu::TestStatus::fail("Following parts of image are incorrect:" + result);
+ }
+}
+
+class MultisubpassTestInstance : public ColorImagelessTestInstance
+{
+public:
+ MultisubpassTestInstance (Context& context, const TestParameters& parameters);
+
+protected:
+ virtual tcu::TestStatus iterate (void);
+
+ virtual std::vector<float> getVertices (void);
+
+ virtual MovePtr<tcu::TextureLevel> generateReferenceImage (const tcu::TextureFormat& textureFormat,
+ const AspectFlags aspectFlags,
+ const deUint32 sample,
+ const deUint32 subpass);
+};
+
+MultisubpassTestInstance::MultisubpassTestInstance (Context& context, const TestParameters& parameters)
+ : ColorImagelessTestInstance (context, parameters)
+{
+}
+
+std::vector<float> MultisubpassTestInstance::getVertices (void)
+{
+ const float verticesData[] =
+ {
+ -1.0f, 0.0f, 0.0f, 1.0f,
+ -1.0f, +1.0f, 0.0f, 1.0f,
+ +1.0f, 0.0f, 0.0f, 1.0f,
+ -1.0f, +1.0f, 0.0f, 1.0f,
+ +1.0f, 0.0f, 0.0f, 1.0f,
+ +1.0f, +1.0f, 0.0f, 1.0f,
+ };
+ const std::vector<float> vertices (verticesData, verticesData + DE_LENGTH_OF_ARRAY(verticesData));
+
+ return vertices;
+}
+
+MovePtr<tcu::TextureLevel> MultisubpassTestInstance::generateReferenceImage (const tcu::TextureFormat& textureFormat,
+ const AspectFlags aspectFlags,
+ const deUint32 sample,
+ const deUint32 subpass)
+{
+ const int width = m_imageExtent2D.width;
+ const int height = m_imageExtent2D.height;
+ const tcu::Vec4 colorDraw0 (0.0f, 0.0f, 1.0f, 1.0f);
+ const tcu::Vec4 colorFill0 (tcu::RGBA::black().toVec());
+ const tcu::Vec4 colorDraw1 (colorDraw0.x(), 1.0f, colorDraw0.z(), 1.0f);
+ const tcu::Vec4 colorFill1 (colorFill0.x(), 1.0f, colorFill0.z(), 1.0f);
+ const tcu::Vec4& colorDraw ((subpass == 0) ? colorDraw0 : colorDraw1);
+ const tcu::Vec4& colorFill ((subpass == 0) ? colorFill0 : colorFill1);
+ MovePtr<tcu::TextureLevel> image (new tcu::TextureLevel(textureFormat, width, height));
+ tcu::PixelBufferAccess access (image->getAccess());
+
+ DE_UNREF(aspectFlags);
+ DE_ASSERT(aspectFlags == ASPECT_COLOR);
+ DE_UNREF(sample);
+ DE_ASSERT(sample == NO_SAMPLE);
+ DE_ASSERT(subpass != NO_SUBPASS);
+
+ for (int y = 0; y < height; ++y)
+ {
+ const tcu::Vec4& validColor = (y < height / 2) ? colorFill : colorDraw;
+
+ for (int x = 0; x < width; ++x)
+ access.setPixel(validColor, x, y);
+ }
+
+ return image;
+}
+
+tcu::TestStatus MultisubpassTestInstance::iterate (void)
+{
+ const DeviceInterface& vk = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+ const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex();
+ const VkQueue queue = m_context.getUniversalQueue();
+ Allocator& allocator = m_context.getDefaultAllocator();
+
+ const tcu::Vec4 clearColor = tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f);
+ const VkFormat colorFormat = m_parameters.colorFormat;
+ const VkDeviceSize colorBufferSize = m_imageExtent2D.width * m_imageExtent2D.height * tcu::getPixelSize(mapVkFormat(colorFormat));
+ const VkImageSubresourceRange colorSubresRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u);
+
+ const Unique<VkImage> color0Image (makeImage (vk, device, makeImageCreateInfo(colorFormat, m_imageExtent2D, m_colorImageUsage | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT)));
+ const UniquePtr<Allocation> color0ImageAlloc (bindImage (vk, device, allocator, *color0Image, MemoryRequirement::Any));
+ const Unique<VkImageView> color0Attachment (makeImageView (vk, device, *color0Image, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorSubresRange));
+ const Unique<VkBuffer> color0Buffer (makeBuffer (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> color0BufferAlloc (bindBuffer (vk, device, allocator, *color0Buffer, MemoryRequirement::HostVisible));
+
+ const Unique<VkImage> color1Image (makeImage (vk, device, makeImageCreateInfo(colorFormat, m_imageExtent2D, m_colorImageUsage | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT)));
+ const UniquePtr<Allocation> color1ImageAlloc (bindImage (vk, device, allocator, *color1Image, MemoryRequirement::Any));
+ const Unique<VkImageView> color1Attachment (makeImageView (vk, device, *color1Image, VK_IMAGE_VIEW_TYPE_2D, colorFormat, colorSubresRange));
+ const Unique<VkBuffer> color1Buffer (makeBuffer (vk, device, makeBufferCreateInfo(colorBufferSize, VK_BUFFER_USAGE_TRANSFER_DST_BIT)));
+ const UniquePtr<Allocation> color1BufferAlloc (bindBuffer (vk, device, allocator, *color1Buffer, MemoryRequirement::HostVisible));
+
+ const VkDescriptorType descriptorType (VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT);
+ const Unique<VkDescriptorSetLayout> descriptorSetLayout (DescriptorSetLayoutBuilder()
+ .addSingleBinding(descriptorType, VK_SHADER_STAGE_FRAGMENT_BIT)
+ .build(vk, device));
+ const Unique<VkDescriptorPool> descriptorPool (DescriptorPoolBuilder()
+ .addType(descriptorType)
+ .build(vk, device, VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, 1u));
+ const Unique<VkDescriptorSet> descriptorSet (makeDescriptorSet(vk, device, *descriptorPool, *descriptorSetLayout));
+ const VkDescriptorImageInfo imageDescriptorInfo (makeDescriptorImageInfo(DE_NULL, *color0Attachment, VK_IMAGE_LAYOUT_GENERAL));
+
+ DescriptorSetUpdateBuilder()
+ .writeSingle(*descriptorSet, DescriptorSetUpdateBuilder::Location::binding(0u), descriptorType, &imageDescriptorInfo)
+ .update(vk, device);
+
+ const Unique<VkRenderPass> renderPass (makeRenderPass (vk, device, colorFormat, DE_NULL));
+ const Unique<VkFramebuffer> framebuffer (makeFramebuffer (vk, device, *renderPass, m_imageExtent2D, colorFormat, m_colorImageUsage, VK_FORMAT_UNDEFINED, 0u, ASPECT_NONE, 1u));
+ const Unique<VkCommandPool> cmdPool (createCommandPool (vk, device, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer (vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+
+ const Unique<VkShaderModule> vertModule0 (createShaderModule (vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+ const Unique<VkShaderModule> fragModule0 (createShaderModule (vk, device, m_context.getBinaryCollection().get("frag"), 0u));
+ const Unique<VkPipelineLayout> pipelineLayout0 (makePipelineLayout (vk, device));
+ const Unique<VkPipeline> pipeline0 (makeGraphicsPipeline (vk, device, *pipelineLayout0, *renderPass, *vertModule0, *fragModule0, m_imageExtent2D));
+
+ const Unique<VkShaderModule> vertModule1 (createShaderModule (vk, device, m_context.getBinaryCollection().get("vert1"), 0u));
+ const Unique<VkShaderModule> fragModule1 (createShaderModule (vk, device, m_context.getBinaryCollection().get("frag1"), 0u));
+ const Unique<VkPipelineLayout> pipelineLayout1 (makePipelineLayout (vk, device, 1u, &*descriptorSetLayout));
+ const Unique<VkPipeline> pipeline1 (makeGraphicsPipeline (vk, device, *pipelineLayout1, *renderPass, *vertModule1, *fragModule1, m_imageExtent2D, 0u, VK_SAMPLE_COUNT_1_BIT, 1u));
+
+ const std::vector<float> vertex0Array (getVertices());
+ const deUint32 vertex0Count (static_cast<deUint32>(vertex0Array.size() / 4u));
+ const VkDeviceSize vertex0ArraySize (vertex0Array.size() * sizeof(vertex0Array[0]));
+ const Unique<VkBuffer> vertex0Buffer (makeBuffer (vk, device, makeBufferCreateInfo(vertex0ArraySize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT)));
+ const UniquePtr<Allocation> vertex0BufferAlloc (bindBuffer (vk, device, allocator, *vertex0Buffer, MemoryRequirement::HostVisible));
+ const VkDeviceSize vertex0BufferOffset (0u);
+
+ const std::vector<float> vertex1Array (getFullQuadVertices());
+ const deUint32 vertex1Count (static_cast<deUint32>(vertex1Array.size() / 4u));
+ const VkDeviceSize vertex1ArraySize (vertex1Array.size() * sizeof(vertex1Array[0]));
+ const Unique<VkBuffer> vertex1Buffer (makeBuffer (vk, device, makeBufferCreateInfo(vertex1ArraySize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT)));
+ const UniquePtr<Allocation> vertex1BufferAlloc (bindBuffer (vk, device, allocator, *vertex1Buffer, MemoryRequirement::HostVisible));
+ const VkDeviceSize vertex1BufferOffset (0u);
+
+ fillBuffer(vk, device, *vertex0BufferAlloc, &vertex0Array[0], vertex0ArraySize);
+ fillBuffer(vk, device, *vertex1BufferAlloc, &vertex1Array[0], vertex1ArraySize);
+
+ beginCommandBuffer(vk, *cmdBuffer);
+ {
+ const VkImageView attachments[] = { *color0Attachment, *color1Attachment };
+ const VkRenderPassAttachmentBeginInfoKHR renderPassAttachmentBeginInfo =
+ {
+ VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR, // VkStructureType sType;
+ DE_NULL, // const void* pNext;
+ DE_LENGTH_OF_ARRAY(attachments), // deUint32 attachmentCount;
+ &attachments[0] // const VkImageView* pAttachments;
+ };
+
+ beginRenderPass(vk, *cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_imageExtent2D), clearColor, &renderPassAttachmentBeginInfo);
+ {
+ {
+ vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline0);
+
+ vk.cmdBindVertexBuffers(*cmdBuffer, 0u, 1u, &*vertex0Buffer, &vertex0BufferOffset);
+
+ vk.cmdDraw(*cmdBuffer, vertex0Count, 1u, 0u, 0u);
+ }
+
+ vk.cmdNextSubpass(*cmdBuffer, VK_SUBPASS_CONTENTS_INLINE);
+
+ {
+ vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline1);
+
+ vk.cmdBindVertexBuffers(*cmdBuffer, 0u, 1u, &*vertex1Buffer, &vertex1BufferOffset);
+
+ vk.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *pipelineLayout1, 0u, 1u, &descriptorSet.get(), 0u, DE_NULL);
+
+ vk.cmdDraw(*cmdBuffer, vertex1Count, 1u, 0u, 0u);
+ }
+ }
+ endRenderPass(vk, *cmdBuffer);
+
+ // Subpass0 color image copy
+ {
+ const VkImageMemoryBarrier preCopyBarrier = makeImageMemoryBarrier (VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
+ VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ *color0Image, colorSubresRange);
+ const VkBufferImageCopy region = makeBufferImageCopy (makeExtent3D(m_imageExtent2D.width, m_imageExtent2D.height, 1u),
+ makeImageSubresourceLayers(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 0u, 1u));
+ const VkBufferMemoryBarrier postCopyBarrier = makeBufferMemoryBarrier (VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *color0Buffer, 0ull, VK_WHOLE_SIZE);
+
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0u, 0u, DE_NULL, 0u, DE_NULL, 1u, &preCopyBarrier);
+ vk.cmdCopyImageToBuffer(*cmdBuffer, *color0Image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *color0Buffer, 1u, ®ion);
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, 0u, 0u, DE_NULL, 1u, &postCopyBarrier, DE_NULL, 0u);
+ }
+
+ // Subpass1 color image copy
+ {
+ const VkImageMemoryBarrier preCopyBarrier = makeImageMemoryBarrier (VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
+ VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ *color1Image, colorSubresRange);
+ const VkBufferImageCopy region = makeBufferImageCopy (makeExtent3D(m_imageExtent2D.width, m_imageExtent2D.height, 1u),
+ makeImageSubresourceLayers(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 0u, 1u));
+ const VkBufferMemoryBarrier postCopyBarrier = makeBufferMemoryBarrier (VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, *color1Buffer, 0ull, VK_WHOLE_SIZE);
+
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0u, 0u, DE_NULL, 0u, DE_NULL, 1u, &preCopyBarrier);
+ vk.cmdCopyImageToBuffer(*cmdBuffer, *color1Image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *color1Buffer, 1u, ®ion);
+ vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, 0u, 0u, DE_NULL, 1u, &postCopyBarrier, DE_NULL, 0u);
+ }
+ }
+ endCommandBuffer(vk, *cmdBuffer);
+ submitCommandsAndWait(vk, device, queue, *cmdBuffer);
+
+ {
+ std::string result;
+
+ if (!verifyBuffer(color0BufferAlloc, colorFormat, "ColorSubpass0", ASPECT_COLOR, NO_SAMPLE, 0u))
+ result += " ColorSubpass0";
+
+ if (!verifyBuffer(color1BufferAlloc, colorFormat, "ColorSubpass1", ASPECT_COLOR, NO_SAMPLE, 1u))
+ result += " ColorSubpass1";
+
+ if (result.empty())
+ return tcu::TestStatus::pass("Pass");
+ else
+ return tcu::TestStatus::fail("Following parts of image are incorrect:" + result);
+ }
+}
+
+class BaseTestCase : public TestCase
+{
+public:
+ BaseTestCase (tcu::TestContext& context, const std::string& name, const std::string& description, const TestParameters& parameters);
+ virtual ~BaseTestCase (void);
+
+protected:
+ virtual void initPrograms (SourceCollections& programCollection) const;
+ virtual TestInstance* createInstance (Context& context) const;
+
+ const TestParameters m_parameters;
+};
+
+BaseTestCase::BaseTestCase (tcu::TestContext& context, const std::string& name, const std::string& description, const TestParameters& parameters)
+ : TestCase (context, name, description)
+ , m_parameters (parameters)
+{
+}
+
+BaseTestCase::~BaseTestCase ()
+{
+}
+
+void BaseTestCase::initPrograms (SourceCollections& programCollection) const
+{
+ // Vertex shader
+ {
+ std::ostringstream src;
+
+ if (m_parameters.testType == TEST_TYPE_COLOR || m_parameters.testType == TEST_TYPE_COLOR_RESOLVE || m_parameters.testType == TEST_TYPE_DEPTH_STENCIL)
+ {
+ src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_440) << "\n"
+ << "\n"
+ << "layout(location = 0) in highp vec4 a_position;\n"
+ << "layout(location = 0) out highp vec4 a_color;\n"
+ << "\n"
+ << "void main (void)\n"
+ << "{\n"
+ << " gl_Position = a_position;\n"
+ << " if (gl_VertexIndex < 6)\n"
+ << " a_color = vec4(0.75f, 0.75f, 0.75f, 1.0f);\n"
+ << " else\n"
+ << " a_color = vec4(1.00f, 1.00f, 1.00f, 1.0f);\n"
+ << "}\n";
+ }
+
+ if (m_parameters.testType == TEST_TYPE_DEPTH_STENCIL_RESOLVE)
+ {
+ src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_440) << "\n"
+ << "\n"
+ << "layout(location = 0) in highp vec4 a_position;\n"
+ << "layout(location = 0) out highp vec4 a_color;\n"
+ << "\n"
+ << "void main (void)\n"
+ << "{\n"
+ << " gl_Position = a_position;\n"
+ << " if (gl_VertexIndex < 3)\n"
+ << " a_color = vec4(0.00f, 0.00f, 1.00f, 1.0f);\n"
+ << " else\n"
+ << " a_color = vec4(0.00f, 1.00f, 0.00f, 1.0f);\n"
+ << "}\n";
+ }
+
+ if (m_parameters.testType == TEST_TYPE_MULTISUBPASS)
+ {
+ src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_440) << "\n"
+ << "\n"
+ << "layout(location = 0) in highp vec4 a_position;\n"
+ << "layout(location = 0) out highp vec4 a_color;\n"
+ << "\n"
+ << "void main (void)\n"
+ << "{\n"
+ << " gl_Position = a_position;\n"
+ << " a_color = vec4(0.0f, 0.0f, 1.0f, 1.0f);\n"
+ << "}\n";
+ }
+
+ programCollection.glslSources.add("vert") << glu::VertexSource(src.str());
+ }
+
+ // Fragment shader
+ {
+ std::ostringstream src;
+
+ src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_440) << "\n"
+ << "\n"
+ << "layout(location = 0) in highp vec4 a_color;\n"
+ << "layout(location = 0) out highp vec4 o_color;\n"
+ << "\n"
+ << "void main (void)\n"
+ << "{\n"
+ << " o_color = a_color;\n"
+ << "}\n";
+
+ programCollection.glslSources.add("frag") << glu::FragmentSource(src.str());
+ }
+
+ // Additional shaders
+ if (m_parameters.testType == TEST_TYPE_COLOR_RESOLVE || m_parameters.testType == TEST_TYPE_DEPTH_STENCIL_RESOLVE)
+ {
+ // Vertex shader
+ {
+ std::ostringstream src;
+
+ src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_440) << "\n"
+ << "\n"
+ << "layout(location = 0) in highp vec4 a_position;\n"
+ << "\n"
+ << "void main (void)\n"
+ << "{\n"
+ << " gl_Position = a_position;\n"
+ << "}\n";
+
+ programCollection.glslSources.add("demultisample-vert") << glu::VertexSource(src.str());
+ }
+
+ // Fragment shader
+ {
+ // Color
+ {
+ std::ostringstream src;
+
+ src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_440) << "\n"
+ << "\n"
+ << "layout(set = 0, binding = 0) uniform sampler2DMS u_ms_image_sampler;\n"
+ << "layout(push_constant) uniform PushConstantsBlock {\n"
+ << " highp int sampleID;\n"
+ << "} pushConstants;\n"
+ << "layout(location = 0) out highp vec4 o_color;\n"
+ << "\n"
+ << "void main (void)\n"
+ << "{\n"
+ << " o_color = texelFetch(u_ms_image_sampler, ivec2(gl_FragCoord.xy), pushConstants.sampleID);\n"
+ << "}\n";
+
+ programCollection.glslSources.add("demultisample-color-frag") << glu::FragmentSource(src.str());
+ }
+
+ // Depth
+ {
+ std::ostringstream src;
+
+ // Depth-component textures are treated as one-component floating-point textures.
+ src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_440) << "\n"
+ << "\n"
+ << "layout(binding = 0) uniform sampler2DMS u_ms_image_sampler;\n"
+ << "layout(push_constant) uniform PushConstantsBlock {\n"
+ << " highp int sampleID;\n"
+ << "} pushConstants;\n"
+ << "layout(location = 0) out highp vec4 o_color;\n"
+ << "\n"
+ << "void main (void)\n"
+ << "{\n"
+ << " vec4 val = texelFetch(u_ms_image_sampler, ivec2(gl_FragCoord.xy), pushConstants.sampleID);\n"
+ << " o_color = vec4(val.x, val.x, val.x, 1.0);\n"
+ << "}\n";
+
+ programCollection.glslSources.add("demultisample-depth-frag") << glu::FragmentSource(src.str());
+ }
+
+ // Stencil
+ {
+ std::ostringstream src;
+
+ // Stencil-component textures are treated as one-component unsigned integer textures.
+ src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_440) << "\n"
+ << "\n"
+ << "layout(binding = 0) uniform usampler2DMS u_ms_image_sampler;\n"
+ << "layout(push_constant) uniform PushConstantsBlock {\n"
+ << " highp int sampleID;\n"
+ << "} pushConstants;\n"
+ << "layout(location = 0) out highp vec4 o_color;\n"
+ << "\n"
+ << "void main (void)\n"
+ << "{\n"
+ << " uvec4 uVal = texelFetch(u_ms_image_sampler, ivec2(gl_FragCoord.xy), pushConstants.sampleID);\n"
+ << " float val = float(uVal.x) / 4.0f;\n"
+ << " o_color = vec4(val, val, val, 1.0);\n"
+ << "}\n";
+
+ programCollection.glslSources.add("demultisample-stencil-frag") << glu::FragmentSource(src.str());
+ }
+ }
+ }
+
+ if (m_parameters.testType == TEST_TYPE_MULTISUBPASS)
+ {
+ // Vertex shader
+ {
+ std::ostringstream src;
+
+ src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_440) << "\n"
+ << "\n"
+ << "layout(location = 0) in highp vec4 a_position;\n"
+ << "\n"
+ << "void main (void)\n"
+ << "{\n"
+ << " gl_Position = a_position;\n"
+ << "}\n";
+
+ programCollection.glslSources.add("vert1") << glu::VertexSource(src.str());
+ }
+
+ // Fragment shader
+ {
+ std::ostringstream src;
+
+ src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_440) << "\n"
+ << "\n"
+ << "layout(input_attachment_index = 0, set = 0, binding = 0) uniform subpassInput u_colors;\n"
+ << "layout(location = 0) out highp vec4 o_color;\n"
+ << "\n"
+ << "void main (void)\n"
+ << "{\n"
+ << " o_color = subpassLoad(u_colors);\n"
+ << " o_color.g = 1.0f;\n"
+ << " o_color.a = 1.0f;\n"
+ << "}\n";
+
+ programCollection.glslSources.add("frag1") << glu::FragmentSource(src.str());
+ }
+ }
+
+
+ return;
+}
+
+TestInstance* BaseTestCase::createInstance (Context& context) const
+{
+ if (m_parameters.testType == TEST_TYPE_COLOR)
+ return new ColorImagelessTestInstance(context, m_parameters);
+
+ if (m_parameters.testType == TEST_TYPE_DEPTH_STENCIL)
+ return new DepthImagelessTestInstance(context, m_parameters);
+
+ if (m_parameters.testType == TEST_TYPE_COLOR_RESOLVE)
+ return new ColorResolveImagelessTestInstance(context, m_parameters);
+
+ if (m_parameters.testType == TEST_TYPE_DEPTH_STENCIL_RESOLVE)
+ return new DepthResolveImagelessTestInstance(context, m_parameters);
+
+ if (m_parameters.testType == TEST_TYPE_MULTISUBPASS)
+ return new MultisubpassTestInstance(context, m_parameters);
+
+ TCU_THROW(InternalError, "Unknown test type specified");
+}
+
+tcu::TestNode* imagelessColorTests (tcu::TestContext& testCtx)
+{
+ TestParameters parameters =
+ {
+ TEST_TYPE_COLOR, // TestType testType;
+ VK_FORMAT_R8G8B8A8_UNORM, // VkFormat colorFormat;
+ VK_FORMAT_UNDEFINED, // VkFormat dsFormat;
+ };
+
+ return new BaseTestCase(testCtx, "color", "Imageless color attachment test", parameters);
+}
+
+tcu::TestNode* imagelessDepthStencilTests (tcu::TestContext& testCtx)
+{
+ TestParameters parameters =
+ {
+ TEST_TYPE_DEPTH_STENCIL, // TestType testType;
+ VK_FORMAT_R8G8B8A8_UNORM, // VkFormat colorFormat;
+ VK_FORMAT_D24_UNORM_S8_UINT, // VkFormat dsFormat;
+ };
+
+ return new BaseTestCase(testCtx, "depth_stencil", "Imageless depth/stencil attachment test", parameters);
+}
+
+tcu::TestNode* imagelessColorResolveTests (tcu::TestContext& testCtx)
+{
+ TestParameters parameters =
+ {
+ TEST_TYPE_COLOR_RESOLVE, // TestType testType;
+ VK_FORMAT_R8G8B8A8_UNORM, // VkFormat colorFormat;
+ VK_FORMAT_UNDEFINED, // VkFormat dsFormat;
+ };
+
+ return new BaseTestCase(testCtx, "color_resolve", "Imageless color attachment resolve test", parameters);
+}
+
+tcu::TestNode* imagelessDepthStencilResolveTests (tcu::TestContext& testCtx)
+{
+ TestParameters parameters =
+ {
+ TEST_TYPE_DEPTH_STENCIL_RESOLVE, // TestType testType;
+ VK_FORMAT_R8G8B8A8_UNORM, // VkFormat colorFormat;
+ VK_FORMAT_D24_UNORM_S8_UINT, // VkFormat dsFormat;
+ };
+
+ return new BaseTestCase(testCtx, "depth_stencil_resolve", "Imageless color and depth/stencil attachment resolve test", parameters);
+}
+
+tcu::TestNode* imagelessMultisubpass (tcu::TestContext& testCtx)
+{
+ TestParameters parameters =
+ {
+ TEST_TYPE_MULTISUBPASS, // TestType testType;
+ VK_FORMAT_R8G8B8A8_UNORM, // VkFormat colorFormat;
+ VK_FORMAT_D24_UNORM_S8_UINT, // VkFormat dsFormat;
+ };
+
+ return new BaseTestCase(testCtx, "multisubpass", "Multi-subpass test", parameters);
+}
+
+} // anonymous
+
+tcu::TestCaseGroup* createTests (tcu::TestContext& testCtx)
+{
+ de::MovePtr<tcu::TestCaseGroup> imagelessFramebufferGroup (new tcu::TestCaseGroup(testCtx, "imageless_framebuffer", "Imageless Framebuffer tests"));
+
+ imagelessFramebufferGroup->addChild(imagelessColorTests(testCtx)); // Color only test
+ imagelessFramebufferGroup->addChild(imagelessDepthStencilTests(testCtx)); // Color and depth/stencil test
+ imagelessFramebufferGroup->addChild(imagelessColorResolveTests(testCtx)); // Color and color resolve test
+ imagelessFramebufferGroup->addChild(imagelessDepthStencilResolveTests(testCtx)); // Color, depth and depth resolve test (interaction with VK_KHR_depth_stencil_resolve)
+ imagelessFramebufferGroup->addChild(imagelessMultisubpass(testCtx)); // Multi-subpass test
+
+ return imagelessFramebufferGroup.release();
+}
+
+} // imageless
+} // vkt
--- /dev/null
+#ifndef _VKTIMAGELESSFRAMEBUFFERTESTS_HPP
+#define _VKTIMAGELESSFRAMEBUFFERTESTS_HPP
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2019 The Khronos Group 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.
+ *
+ *//*!
+ * \file
+ * \brief Vulkan Imageless Framebuffer Tests
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuDefs.hpp"
+#include "tcuTestCase.hpp"
+
+namespace vkt
+{
+namespace imageless
+{
+
+tcu::TestCaseGroup* createTests (tcu::TestContext& testCtx);
+
+} // imageless
+} // vkt
+
+#endif // _VKTIMAGELESSFRAMEBUFFERTESTS_HPP
)
PCH(DEQP_VK_PIPELINE_SRCS ../pch.cpp)
+include_directories("../../../../amber/src/include")
+include_directories("../amber")
add_library(deqp-vk-pipeline STATIC ${DEQP_VK_PIPELINE_SRCS})
target_link_libraries(deqp-vk-pipeline ${DEQP_VK_PIPELINE_LIBS})
vktQueryPoolTests.cpp
vktQueryPoolOcclusionTests.hpp
vktQueryPoolOcclusionTests.cpp
+ vktQueryPoolPerformanceTests.hpp
+ vktQueryPoolPerformanceTests.cpp
vktQueryPoolStatisticsTests.hpp
vktQueryPoolStatisticsTests.cpp
)
--- /dev/null
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2018 The Khronos Group 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.
+ *
+ *//*!
+ * \file
+ * \brief Vulkan Performance Query Tests
+ *//*--------------------------------------------------------------------*/
+
+#include "vktQueryPoolPerformanceTests.hpp"
+#include "vktTestCase.hpp"
+
+#include "vktDrawImageObjectUtil.hpp"
+#include "vktDrawBufferObjectUtil.hpp"
+#include "vktDrawCreateInfoUtil.hpp"
+#include "vkBuilderUtil.hpp"
+#include "vkRefUtil.hpp"
+#include "vkPrograms.hpp"
+#include "vkTypeUtil.hpp"
+#include "vkCmdUtil.hpp"
+#include "vkQueryUtil.hpp"
+
+#include "deMath.h"
+
+#include "tcuTestLog.hpp"
+#include "tcuResource.hpp"
+#include "tcuImageCompare.hpp"
+#include "vkImageUtil.hpp"
+#include "tcuCommandLine.hpp"
+#include "tcuRGBA.hpp"
+
+namespace vkt
+{
+namespace QueryPool
+{
+namespace
+{
+
+using namespace vk;
+using namespace Draw;
+
+std::string uuidToHex(const deUint8 uuid[])
+{
+ const size_t bytesPerPart[] = {4, 2, 2, 2, 6};
+ const deUint8* ptr = &uuid[0];
+ const size_t stringSize = VK_UUID_SIZE * 2 + DE_LENGTH_OF_ARRAY(bytesPerPart) - 1;
+ std::string result;
+
+ result.reserve(stringSize);
+
+ for (size_t partNdx = 0; partNdx < DE_LENGTH_OF_ARRAY(bytesPerPart); ++partNdx)
+ {
+ const size_t bytesInPart = bytesPerPart[partNdx];
+ const size_t symbolsInPart = 2 * bytesInPart;
+ deUint64 part = 0;
+ std::string partString;
+
+ for (size_t byteInPartNdx = 0; byteInPartNdx < bytesInPart; ++byteInPartNdx)
+ {
+ part = (part << 8) | *ptr;
+ ++ptr;
+ }
+
+ partString = tcu::toHex(part).toString();
+
+ DE_ASSERT(partString.size() > symbolsInPart);
+
+ result += (symbolsInPart >= partString.size()) ? partString : partString.substr(partString.size() - symbolsInPart);
+
+ if (partNdx + 1 != DE_LENGTH_OF_ARRAY(bytesPerPart))
+ result += '-';
+ }
+
+ DE_ASSERT(ptr == &uuid[VK_UUID_SIZE]);
+ DE_ASSERT(result.size() == stringSize);
+
+ return result;
+}
+
+class EnumerateAndValidateTest : public TestInstance
+{
+public:
+ EnumerateAndValidateTest (vkt::Context& context, VkQueueFlagBits queueFlagBits);
+ tcu::TestStatus iterate (void);
+
+protected:
+ void basicValidateCounter (const deUint32 familyIndex);
+
+private:
+ VkQueueFlagBits m_queueFlagBits;
+ bool m_requiredExtensionsPresent;
+};
+
+EnumerateAndValidateTest::EnumerateAndValidateTest (vkt::Context& context, VkQueueFlagBits queueFlagBits)
+ : TestInstance(context)
+ , m_queueFlagBits(queueFlagBits)
+ , m_requiredExtensionsPresent(context.requireDeviceExtension("VK_KHR_performance_query"))
+{
+}
+
+tcu::TestStatus EnumerateAndValidateTest::iterate (void)
+{
+ const InstanceInterface& vki = m_context.getInstanceInterface();
+ const VkPhysicalDevice physicalDevice = m_context.getPhysicalDevice();
+ const std::vector<VkQueueFamilyProperties> queueProperties = getPhysicalDeviceQueueFamilyProperties(vki, physicalDevice);
+
+ for (deUint32 queueNdx = 0; queueNdx < queueProperties.size(); queueNdx++)
+ {
+ if ((queueProperties[queueNdx].queueFlags & m_queueFlagBits) == 0)
+ continue;
+
+ deUint32 counterCount = 0;
+ vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueNdx, &counterCount, DE_NULL, DE_NULL);
+ if (counterCount == 0)
+ continue;
+
+ {
+ std::vector<VkPerformanceCounterKHR> counters (counterCount);
+ deUint32 counterCountRead = counterCount;
+ std::map<std::string, size_t> uuidValidator;
+
+ vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueNdx, &counterCountRead, &counters[0], DE_NULL);
+
+ if (counterCountRead != counterCount)
+ TCU_FAIL("Number of counters read (" + de::toString(counterCountRead) + ") is not equal to number of counters reported (" + de::toString(counterCount) + ")");
+
+ for (size_t counterNdx = 0; counterNdx < counters.size(); ++counterNdx)
+ {
+ const VkPerformanceCounterKHR& counter = counters[counterNdx];
+ const std::string uuidStr = uuidToHex(counter.uuid);
+
+ if (uuidValidator.find(uuidStr) != uuidValidator.end())
+ TCU_FAIL("Duplicate counter UUID detected " + uuidStr);
+ else
+ uuidValidator[uuidStr] = counterNdx;
+
+ if (counter.scope >= VK_PERFORMANCE_COUNTER_SCOPE_KHR_LAST)
+ TCU_FAIL("Counter scope is invalid " + de::toString(static_cast<size_t>(counter.scope)));
+
+ if (counter.storage >= VK_PERFORMANCE_COUNTER_STORAGE_KHR_LAST)
+ TCU_FAIL("Counter storage is invalid " + de::toString(static_cast<size_t>(counter.storage)));
+
+ if (counter.unit >= VK_PERFORMANCE_COUNTER_UNIT_KHR_LAST)
+ TCU_FAIL("Counter unit is invalid " + de::toString(static_cast<size_t>(counter.unit)));
+ }
+ }
+ {
+ std::vector<VkPerformanceCounterDescriptionKHR> counterDescriptors (counterCount);
+ deUint32 counterCountRead = counterCount;
+
+ vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueNdx, &counterCountRead, DE_NULL, &counterDescriptors[0]);
+
+ if (counterCountRead != counterCount)
+ TCU_FAIL("Number of counters read (" + de::toString(counterCountRead) + ") is not equal to number of counters reported (" + de::toString(counterCount) + ")");
+
+ for (size_t counterNdx = 0; counterNdx < counterDescriptors.size(); ++counterNdx)
+ {
+ const VkPerformanceCounterDescriptionKHR& counterDescriptor = counterDescriptors[counterNdx];
+ const VkPerformanceCounterDescriptionFlagsKHR allowedFlags = VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_KHR
+ | VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_KHR;
+
+ if ((counterDescriptor.flags & ~allowedFlags) != 0)
+ TCU_FAIL("Invalid flags present in VkPerformanceCounterDescriptionFlagsKHR");
+ }
+ }
+ }
+
+ return tcu::TestStatus::pass("Pass");
+}
+
+class QueryTestBase : public TestInstance
+{
+public:
+ QueryTestBase (vkt::Context& context);
+
+protected:
+
+ void setupCounters (void);
+ Move<VkQueryPool> createQueryPool (deUint32 enabledCounterOffset, deUint32 enabledCounterStride);
+ bool acquireProfilingLock (void);
+ void releaseProfilingLock (void);
+ bool verifyQueryResults (VkQueryPool queryPool);
+ deUint32 getRequiredNumerOfPasses(void);
+
+private:
+
+ bool m_requiredExtensionsPresent;
+ deUint32 m_requiredNumerOfPasses;
+ std::map<deUint64, deUint32> m_enabledCountersCountMap; // number of counters that were enabled per query pool
+ std::vector<VkPerformanceCounterKHR> m_counters; // counters provided by the device
+};
+
+QueryTestBase::QueryTestBase(vkt::Context& context)
+ : TestInstance (context)
+ , m_requiredExtensionsPresent(context.requireDeviceExtension("VK_KHR_performance_query"))
+ , m_requiredNumerOfPasses(0)
+{
+}
+
+void QueryTestBase::setupCounters()
+{
+ const InstanceInterface& vki = m_context.getInstanceInterface();
+ const VkPhysicalDevice physicalDevice = m_context.getPhysicalDevice();
+ const CmdPoolCreateInfo cmdPoolCreateInfo = m_context.getUniversalQueueFamilyIndex();
+ deUint32 queueFamilyIndex = cmdPoolCreateInfo.queueFamilyIndex;
+ deUint32 counterCount;
+
+ if (!m_context.getPerformanceCounterFeatures().performanceCounterQueryPools)
+ TCU_THROW(NotSupportedError, "Performance counter query pools feature not supported");
+
+ // get the number of supported counters
+ vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueFamilyIndex, &counterCount, NULL, NULL);
+ if (!counterCount)
+ TCU_THROW(NotSupportedError, "QualityWarning: there are no performance counters");
+
+ // get supported counters
+ m_counters.resize(counterCount);
+ vki.enumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(physicalDevice, queueFamilyIndex, &counterCount, &m_counters[0], DE_NULL);
+}
+
+Move<VkQueryPool> QueryTestBase::createQueryPool(deUint32 enabledCounterOffset, deUint32 enabledCounterStride)
+{
+ const InstanceInterface& vki = m_context.getInstanceInterface();
+ const DeviceInterface& vkd = m_context.getDeviceInterface();
+ const VkPhysicalDevice physicalDevice = m_context.getPhysicalDevice();
+ const VkDevice device = m_context.getDevice();
+ const CmdPoolCreateInfo cmdPoolCreateInfo = m_context.getUniversalQueueFamilyIndex();
+ const deUint32 counterCount = (deUint32)m_counters.size();
+ deUint32 enabledIndex = enabledCounterOffset ? 0 : enabledCounterStride;
+ std::vector<deUint32> enabledCounters;
+
+ // enable every <enabledCounterStride> counter that has command or render pass scope
+ for (deUint32 i = 0; i < counterCount; i++)
+ {
+ // skip counters with command buffer scope
+ if (m_counters[i].scope == VK_QUERY_SCOPE_COMMAND_BUFFER_KHR)
+ continue;
+
+ // handle offset
+ if (enabledCounterOffset)
+ {
+ if (enabledCounterOffset == enabledIndex)
+ {
+ // disable handling offset
+ enabledCounterOffset = 0;
+
+ // eneble next index in stride condition
+ enabledIndex = enabledCounterStride;
+ }
+ else
+ {
+ ++enabledIndex;
+ continue;
+ }
+ }
+
+ // handle stride
+ if (enabledIndex == enabledCounterStride)
+ {
+ enabledCounters.push_back(i);
+ enabledIndex = 0;
+ }
+ else
+ ++enabledIndex;
+ }
+
+ // get number of counters that were enabled for this query pool
+ deUint32 enabledCountersCount = static_cast<deUint32>(enabledCounters.size());
+ if (!enabledCountersCount)
+ TCU_THROW(NotSupportedError, "QualityWarning: no performance counters");
+
+ // define performance query
+ VkPerformanceQueryCreateInfoKHR performanceQueryCreateInfo =
+ {
+ VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_CREATE_INFO_KHR,
+ NULL,
+ cmdPoolCreateInfo.queueFamilyIndex, // queue family that this performance query is performed on
+ enabledCountersCount, // number of counters to enable
+ &enabledCounters[0] // array of indices of counters to enable
+ };
+
+ // get the number of passes counters will require
+ vki.getPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(physicalDevice, &performanceQueryCreateInfo, &m_requiredNumerOfPasses);
+
+ // create query pool
+ VkQueryPoolCreateInfo queryPoolCreateInfo =
+ {
+ VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO,
+ &performanceQueryCreateInfo,
+ 0, // flags
+ VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR, // new query type
+ 1, // queryCount
+ 0
+ };
+
+ Move<VkQueryPool> queryPool = vk::createQueryPool(vkd, device, &queryPoolCreateInfo);
+
+ // memorize number of enabled counters for this query pool
+ m_enabledCountersCountMap[queryPool.get().getInternal()] = enabledCountersCount;
+
+ return queryPool;
+}
+
+bool QueryTestBase::acquireProfilingLock()
+{
+ const DeviceInterface& vkd = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+
+ // acquire profiling lock before we record command buffers
+ VkAcquireProfilingLockInfoKHR lockInfo =
+ {
+ VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR,
+ NULL,
+ 0,
+ 2000000000ull // wait 2s for the lock
+ };
+
+ VkResult result = vkd.acquireProfilingLockKHR(device, &lockInfo);
+ if (result == VK_TIMEOUT)
+ {
+ m_context.getTestContext().getLog() << tcu::TestLog::Message
+ << "Timeout reached, profiling lock wasn't acquired - test had to end earlier"
+ << tcu::TestLog::EndMessage;
+ return false;
+ }
+ if (result != VK_SUCCESS)
+ TCU_FAIL("Profiling lock wasn't acquired");
+
+ return true;
+}
+
+void QueryTestBase::releaseProfilingLock()
+{
+ const DeviceInterface& vkd = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+
+ // release the profiling lock after the command buffer is no longer in the pending state
+ vkd.releaseProfilingLockKHR(device);
+}
+
+bool QueryTestBase::verifyQueryResults(VkQueryPool queryPool)
+{
+ const DeviceInterface& vkd = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+
+ // create an array to hold the results of all counters
+ deUint32 enabledCounterCount = m_enabledCountersCountMap[queryPool.getInternal()];
+ std::vector<VkPerformanceCounterResultKHR> recordedCounters(enabledCounterCount);
+
+ // verify that query result can be retrieved
+ VkResult result = vkd.getQueryPoolResults(device, queryPool, 0, 1, sizeof(VkPerformanceCounterResultKHR) * enabledCounterCount,
+ &recordedCounters[0], sizeof(VkPerformanceCounterResultKHR), VK_QUERY_RESULT_WAIT_BIT);
+ if (result == VK_NOT_READY)
+ {
+ m_context.getTestContext().getLog() << tcu::TestLog::Message
+ << "Pass but result is not ready"
+ << tcu::TestLog::EndMessage;
+ return true;
+ }
+ return (result == VK_SUCCESS);
+}
+
+deUint32 QueryTestBase::getRequiredNumerOfPasses()
+{
+ return m_requiredNumerOfPasses;
+}
+
+// Base class for all graphic tests
+class GraphicQueryTestBase : public QueryTestBase
+{
+public:
+ GraphicQueryTestBase(vkt::Context& context);
+
+protected:
+ void initStateObjects(void);
+
+protected:
+ Move<VkPipeline> m_pipeline;
+ Move<VkPipelineLayout> m_pipelineLayout;
+
+ de::SharedPtr<Image> m_colorAttachmentImage;
+ Move<VkImageView> m_attachmentView;
+
+ Move<VkRenderPass> m_renderPass;
+ Move<VkFramebuffer> m_framebuffer;
+
+ de::SharedPtr<Buffer> m_vertexBuffer;
+
+ VkFormat m_colorAttachmentFormat;
+ deUint32 m_size;
+};
+
+GraphicQueryTestBase::GraphicQueryTestBase(vkt::Context& context)
+ : QueryTestBase(context)
+ , m_colorAttachmentFormat(VK_FORMAT_R8G8B8A8_UNORM)
+ , m_size(32)
+{
+}
+
+void GraphicQueryTestBase::initStateObjects(void)
+{
+ const VkDevice device = m_context.getDevice();
+ const DeviceInterface& vkd = m_context.getDeviceInterface();
+
+ //attachment images and views
+ {
+ VkExtent3D imageExtent =
+ {
+ m_size, // width
+ m_size, // height
+ 1 // depth
+ };
+
+ const ImageCreateInfo colorImageCreateInfo(VK_IMAGE_TYPE_2D, m_colorAttachmentFormat, imageExtent, 1, 1,
+ VK_SAMPLE_COUNT_1_BIT, VK_IMAGE_TILING_OPTIMAL,
+ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT);
+
+ m_colorAttachmentImage = Image::createAndAlloc(vkd, device, colorImageCreateInfo, m_context.getDefaultAllocator(),
+ m_context.getUniversalQueueFamilyIndex());
+
+ const ImageViewCreateInfo attachmentViewInfo(m_colorAttachmentImage->object(), VK_IMAGE_VIEW_TYPE_2D, m_colorAttachmentFormat);
+ m_attachmentView = createImageView(vkd, device, &attachmentViewInfo);
+ }
+
+ // renderpass and framebuffer
+ {
+ RenderPassCreateInfo renderPassCreateInfo;
+ renderPassCreateInfo.addAttachment(AttachmentDescription(m_colorAttachmentFormat, // format
+ VK_SAMPLE_COUNT_1_BIT, // samples
+ VK_ATTACHMENT_LOAD_OP_CLEAR, // loadOp
+ VK_ATTACHMENT_STORE_OP_DONT_CARE, // storeOp
+ VK_ATTACHMENT_LOAD_OP_DONT_CARE, // stencilLoadOp
+ VK_ATTACHMENT_STORE_OP_DONT_CARE, // stencilLoadOp
+ VK_IMAGE_LAYOUT_GENERAL, // initialLauout
+ VK_IMAGE_LAYOUT_GENERAL)); // finalLayout
+
+ const VkAttachmentReference colorAttachmentReference =
+ {
+ 0, // attachment
+ VK_IMAGE_LAYOUT_GENERAL // layout
+ };
+
+ renderPassCreateInfo.addSubpass(SubpassDescription(VK_PIPELINE_BIND_POINT_GRAPHICS, // pipelineBindPoint
+ 0, // flags
+ 0, // inputCount
+ DE_NULL, // pInputAttachments
+ 1, // colorCount
+ &colorAttachmentReference, // pColorAttachments
+ DE_NULL, // pResolveAttachments
+ AttachmentReference(), // depthStencilAttachment
+ 0, // preserveCount
+ DE_NULL)); // preserveAttachments
+
+ m_renderPass = createRenderPass(vkd, device, &renderPassCreateInfo);
+
+ std::vector<VkImageView> attachments(1);
+ attachments[0] = *m_attachmentView;
+
+ FramebufferCreateInfo framebufferCreateInfo(*m_renderPass, attachments, m_size, m_size, 1);
+ m_framebuffer = createFramebuffer(vkd, device, &framebufferCreateInfo);
+ }
+
+ // pipeline
+ {
+ Unique<VkShaderModule> vs(createShaderModule(vkd, device, m_context.getBinaryCollection().get("vert"), 0));
+ Unique<VkShaderModule> fs(createShaderModule(vkd, device, m_context.getBinaryCollection().get("frag"), 0));
+
+ const PipelineCreateInfo::ColorBlendState::Attachment attachmentState;
+
+ const PipelineLayoutCreateInfo pipelineLayoutCreateInfo;
+ m_pipelineLayout = createPipelineLayout(vkd, device, &pipelineLayoutCreateInfo);
+
+ const VkVertexInputBindingDescription vf_binding_desc =
+ {
+ 0, // binding
+ 4 * (deUint32)sizeof(float), // stride
+ VK_VERTEX_INPUT_RATE_VERTEX // inputRate
+ };
+
+ const VkVertexInputAttributeDescription vf_attribute_desc =
+ {
+ 0, // location
+ 0, // binding
+ VK_FORMAT_R32G32B32A32_SFLOAT, // format
+ 0 // offset
+ };
+
+ const VkPipelineVertexInputStateCreateInfo vf_info =
+ {
+ VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, // sType
+ NULL, // pNext
+ 0u, // flags
+ 1, // vertexBindingDescriptionCount
+ &vf_binding_desc, // pVertexBindingDescriptions
+ 1, // vertexAttributeDescriptionCount
+ &vf_attribute_desc // pVertexAttributeDescriptions
+ };
+
+ PipelineCreateInfo pipelineCreateInfo(*m_pipelineLayout, *m_renderPass, 0, 0);
+ pipelineCreateInfo.addShader(PipelineCreateInfo::PipelineShaderStage(*vs, "main", VK_SHADER_STAGE_VERTEX_BIT));
+ pipelineCreateInfo.addShader(PipelineCreateInfo::PipelineShaderStage(*fs, "main", VK_SHADER_STAGE_FRAGMENT_BIT));
+ pipelineCreateInfo.addState(PipelineCreateInfo::InputAssemblerState(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
+ pipelineCreateInfo.addState(PipelineCreateInfo::ColorBlendState(1, &attachmentState));
+ const VkViewport viewport = makeViewport(m_size, m_size);
+ const VkRect2D scissor = makeRect2D(m_size, m_size);
+ pipelineCreateInfo.addState(PipelineCreateInfo::ViewportState(1, std::vector<VkViewport>(1, viewport), std::vector<VkRect2D>(1, scissor)));
+ pipelineCreateInfo.addState(PipelineCreateInfo::DepthStencilState(false, false, VK_COMPARE_OP_GREATER_OR_EQUAL));
+ pipelineCreateInfo.addState(PipelineCreateInfo::RasterizerState());
+ pipelineCreateInfo.addState(PipelineCreateInfo::MultiSampleState());
+ pipelineCreateInfo.addState(vf_info);
+ m_pipeline = createGraphicsPipeline(vkd, device, DE_NULL, &pipelineCreateInfo);
+ }
+
+ // vertex buffer
+ {
+ std::vector<tcu::Vec4> vertices(3);
+ vertices[0] = tcu::Vec4(0.5, 0.5, 0.0, 1.0);
+ vertices[1] = tcu::Vec4(0.5, 0.0, 0.0, 1.0);
+ vertices[2] = tcu::Vec4(0.0, 0.5, 0.0, 1.0);
+
+ const size_t kBufferSize = vertices.size() * sizeof(tcu::Vec4);
+ m_vertexBuffer = Buffer::createAndAlloc(vkd, device, BufferCreateInfo(kBufferSize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT), m_context.getDefaultAllocator(), MemoryRequirement::HostVisible);
+
+ tcu::Vec4 *ptr = reinterpret_cast<tcu::Vec4*>(m_vertexBuffer->getBoundMemory().getHostPtr());
+ deMemcpy(ptr, &vertices[0], kBufferSize);
+
+ flushMappedMemoryRange(vkd, device, m_vertexBuffer->getBoundMemory().getMemory(), m_vertexBuffer->getBoundMemory().getOffset(), VK_WHOLE_SIZE);
+ }
+}
+
+
+class GraphicQueryTest : public GraphicQueryTestBase
+{
+public:
+ GraphicQueryTest (vkt::Context& context);
+ tcu::TestStatus iterate (void);
+};
+
+GraphicQueryTest::GraphicQueryTest(vkt::Context& context)
+ : GraphicQueryTestBase(context)
+{
+}
+
+tcu::TestStatus GraphicQueryTest::iterate(void)
+{
+ const DeviceInterface& vkd = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+ const VkQueue queue = m_context.getUniversalQueue();
+ const CmdPoolCreateInfo cmdPoolCreateInfo = m_context.getUniversalQueueFamilyIndex();
+ Unique<VkCommandPool> cmdPool (createCommandPool(vkd, device, &cmdPoolCreateInfo));
+ Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vkd, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+
+ initStateObjects();
+ setupCounters();
+
+ vk::Unique<VkQueryPool> queryPool(createQueryPool(0, 1));
+
+ if (!acquireProfilingLock())
+ {
+ // lock was not acquired in given time, we can't fail the test
+ return tcu::TestStatus::pass("Pass");
+ }
+
+ // begin command buffer
+ const VkCommandBufferBeginInfo commandBufBeginParams =
+ {
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ DE_NULL,
+ VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT,
+ (const VkCommandBufferInheritanceInfo*)DE_NULL,
+ };
+ VK_CHECK(vkd.beginCommandBuffer(*cmdBuffer, &commandBufBeginParams));
+
+ initialTransitionColor2DImage(vkd, *cmdBuffer, m_colorAttachmentImage->object(), VK_IMAGE_LAYOUT_GENERAL,
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT);
+
+ // begin render pass
+ VkClearValue renderPassClearValue;
+ deMemset(&renderPassClearValue, 0, sizeof(VkClearValue));
+
+ // reset query pool
+ vkd.cmdResetQueryPool(*cmdBuffer, *queryPool, 0, 1);
+
+ // perform query during triangle draw
+ vkd.cmdBeginQuery(*cmdBuffer, *queryPool, 0, VK_QUERY_CONTROL_PRECISE_BIT);
+
+ beginRenderPass(vkd, *cmdBuffer, *m_renderPass, *m_framebuffer,
+ makeRect2D(0, 0, m_size, m_size),
+ 1, &renderPassClearValue);
+
+ // bind pipeline
+ vkd.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
+
+ // bind vertex buffer
+ VkBuffer vertexBuffer = m_vertexBuffer->object();
+ const VkDeviceSize vertexBufferOffset = 0;
+ vkd.cmdBindVertexBuffers(*cmdBuffer, 0, 1, &vertexBuffer, &vertexBufferOffset);
+
+ vkd.cmdDraw(*cmdBuffer, 3, 1, 0, 0);
+
+ endRenderPass(vkd, *cmdBuffer);
+
+ vkd.cmdEndQuery(*cmdBuffer, *queryPool, 0);
+
+ transition2DImage(vkd, *cmdBuffer, m_colorAttachmentImage->object(), VK_IMAGE_ASPECT_COLOR_BIT,
+ VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
+ VK_ACCESS_TRANSFER_READ_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
+
+ endCommandBuffer(vkd, *cmdBuffer);
+
+ // submit command buffer for each pass and wait for its completion
+ for (deUint32 passIndex = 0; passIndex < getRequiredNumerOfPasses(); passIndex++)
+ {
+ const Unique<VkFence> fence(createFence(vkd, device));
+
+ VkPerformanceQuerySubmitInfoKHR performanceQuerySubmitInfo =
+ {
+ VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR,
+ NULL,
+ passIndex
+ };
+
+ const VkSubmitInfo submitInfo =
+ {
+ VK_STRUCTURE_TYPE_SUBMIT_INFO, // sType
+ &performanceQuerySubmitInfo, // pNext
+ 0u, // waitSemaphoreCount
+ DE_NULL, // pWaitSemaphores
+ (const VkPipelineStageFlags*)DE_NULL, // pWaitDstStageMask
+ 1u, // commandBufferCount
+ &cmdBuffer.get(), // pCommandBuffers
+ 0u, // signalSemaphoreCount
+ DE_NULL, // pSignalSemaphores
+ };
+
+ VK_CHECK(vkd.queueSubmit(queue, 1u, &submitInfo, *fence));
+ VK_CHECK(vkd.waitForFences(device, 1u, &fence.get(), DE_TRUE, ~0ull));
+ }
+
+ releaseProfilingLock();
+
+ VK_CHECK(vkd.resetCommandBuffer(*cmdBuffer, 0));
+
+ if (verifyQueryResults(*queryPool))
+ return tcu::TestStatus::pass("Pass");
+ return tcu::TestStatus::fail("Fail");
+}
+
+class GraphicMultiplePoolsTest : public GraphicQueryTestBase
+{
+public:
+ GraphicMultiplePoolsTest (vkt::Context& context);
+ tcu::TestStatus iterate (void);
+};
+
+GraphicMultiplePoolsTest::GraphicMultiplePoolsTest(vkt::Context& context)
+ : GraphicQueryTestBase(context)
+{
+}
+
+tcu::TestStatus GraphicMultiplePoolsTest::iterate(void)
+{
+ if (!m_context.getPerformanceCounterFeatures().performanceCounterMultipleQueryPools)
+ throw tcu::NotSupportedError("MultipleQueryPools not supported");
+
+ const DeviceInterface& vkd = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+ const VkQueue queue = m_context.getUniversalQueue();
+ const CmdPoolCreateInfo cmdPoolCreateInfo = m_context.getUniversalQueueFamilyIndex();
+ Unique<VkCommandPool> cmdPool (createCommandPool(vkd, device, &cmdPoolCreateInfo));
+ Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vkd, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+
+ initStateObjects();
+ setupCounters();
+
+ vk::Unique<VkQueryPool> queryPool1(createQueryPool(0, 2)),
+ queryPool2(createQueryPool(1, 2));
+
+ if (!acquireProfilingLock())
+ {
+ // lock was not acquired in given time, we can't fail the test
+ return tcu::TestStatus::pass("Pass");
+ }
+
+ // begin command buffer
+ const VkCommandBufferBeginInfo commandBufBeginParams =
+ {
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
+ DE_NULL,
+ VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT,
+ (const VkCommandBufferInheritanceInfo*)DE_NULL,
+ };
+ VK_CHECK(vkd.beginCommandBuffer(*cmdBuffer, &commandBufBeginParams));
+
+ initialTransitionColor2DImage(vkd, *cmdBuffer, m_colorAttachmentImage->object(), VK_IMAGE_LAYOUT_GENERAL,
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT);
+
+ // begin render pass
+ VkClearValue renderPassClearValue;
+ deMemset(&renderPassClearValue, 0, sizeof(VkClearValue));
+
+ VkBuffer vertexBuffer = m_vertexBuffer->object();
+ const VkDeviceSize vertexBufferOffset = 0;
+ const VkQueryPool queryPools[] =
+ {
+ *queryPool1,
+ *queryPool2
+ };
+
+ // reset query pools
+ vkd.cmdResetQueryPool(*cmdBuffer, queryPools[0], 0u, 1u);
+ vkd.cmdResetQueryPool(*cmdBuffer, queryPools[1], 0u, 1u);
+
+ // perform two queries during triangle draw
+ for (deUint32 loop = 0; loop < DE_LENGTH_OF_ARRAY(queryPools); ++loop)
+ {
+ const VkQueryPool queryPool = queryPools[loop];
+ vkd.cmdBeginQuery(*cmdBuffer, queryPool, 0u, (VkQueryControlFlags)0u);
+ beginRenderPass(vkd, *cmdBuffer, *m_renderPass, *m_framebuffer,
+ makeRect2D(0, 0, m_size, m_size),
+ 1, &renderPassClearValue);
+
+ vkd.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
+ vkd.cmdBindVertexBuffers(*cmdBuffer, 0, 1, &vertexBuffer, &vertexBufferOffset);
+ vkd.cmdDraw(*cmdBuffer, 3, 1, 0, 0);
+
+ endRenderPass(vkd, *cmdBuffer);
+ vkd.cmdEndQuery(*cmdBuffer, queryPool, 0u);
+ }
+
+ transition2DImage(vkd, *cmdBuffer, m_colorAttachmentImage->object(), VK_IMAGE_ASPECT_COLOR_BIT,
+ VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
+ VK_ACCESS_TRANSFER_READ_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
+
+ endCommandBuffer(vkd, *cmdBuffer);
+
+ // submit command buffer for each pass and wait for its completion
+ for (deUint32 passIndex = 0; passIndex < getRequiredNumerOfPasses(); passIndex++)
+ {
+ const Unique<VkFence> fence(createFence(vkd, device));
+
+ VkPerformanceQuerySubmitInfoKHR performanceQuerySubmitInfo =
+ {
+ VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR,
+ NULL,
+ passIndex
+ };
+
+ const VkSubmitInfo submitInfo =
+ {
+ VK_STRUCTURE_TYPE_SUBMIT_INFO, // sType
+ &performanceQuerySubmitInfo, // pNext
+ 0u, // waitSemaphoreCount
+ DE_NULL, // pWaitSemaphores
+ (const VkPipelineStageFlags*)DE_NULL, // pWaitDstStageMask
+ 1u, // commandBufferCount
+ &cmdBuffer.get(), // pCommandBuffers
+ 0u, // signalSemaphoreCount
+ DE_NULL, // pSignalSemaphores
+ };
+
+ VK_CHECK(vkd.queueSubmit(queue, 1u, &submitInfo, *fence));
+ VK_CHECK(vkd.waitForFences(device, 1u, &fence.get(), DE_TRUE, ~0ull));
+ }
+
+ releaseProfilingLock();
+
+ VK_CHECK(vkd.resetCommandBuffer(*cmdBuffer, 0));
+
+ if (verifyQueryResults(*queryPool1) && verifyQueryResults(*queryPool2))
+ return tcu::TestStatus::pass("Pass");
+ return tcu::TestStatus::fail("Fail");
+}
+
+// Base class for all compute tests
+class ComputeQueryTestBase : public QueryTestBase
+{
+public:
+ ComputeQueryTestBase(vkt::Context& context);
+
+protected:
+ void initStateObjects(void);
+
+protected:
+ Move<VkPipeline> m_pipeline;
+ Move<VkPipelineLayout> m_pipelineLayout;
+ de::SharedPtr<Buffer> m_buffer;
+ Move<VkDescriptorPool> m_descriptorPool;
+ Move<VkDescriptorSet> m_descriptorSet;
+ VkDescriptorBufferInfo m_descriptorBufferInfo;
+ VkBufferMemoryBarrier m_computeFinishBarrier;
+};
+
+ComputeQueryTestBase::ComputeQueryTestBase(vkt::Context& context)
+ : QueryTestBase(context)
+{
+}
+
+void ComputeQueryTestBase::initStateObjects(void)
+{
+ const DeviceInterface& vkd = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+ const VkDeviceSize bufferSize = 32 * sizeof(deUint32);
+ const CmdPoolCreateInfo cmdPoolCreateInfo(m_context.getUniversalQueueFamilyIndex());
+ const Unique<VkCommandPool> cmdPool(createCommandPool(vkd, device, &cmdPoolCreateInfo));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vkd, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+
+ const Unique<VkDescriptorSetLayout> descriptorSetLayout(DescriptorSetLayoutBuilder()
+ .addSingleBinding(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_SHADER_STAGE_COMPUTE_BIT)
+ .build(vkd, device));
+
+ // create pipeline layout
+ {
+ const VkPipelineLayoutCreateInfo pipelineLayoutParams =
+ {
+ VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, // sType
+ DE_NULL, // pNext
+ 0u, // flags
+ 1u, // setLayoutCount
+ &(*descriptorSetLayout), // pSetLayouts
+ 0u, // pushConstantRangeCount
+ DE_NULL, // pPushConstantRanges
+ };
+ m_pipelineLayout = createPipelineLayout(vkd, device, &pipelineLayoutParams);
+ }
+
+ // create compute pipeline
+ {
+ const Unique<VkShaderModule> cs(createShaderModule(vkd, device, m_context.getBinaryCollection().get("comp"), 0u));
+ const VkPipelineShaderStageCreateInfo pipelineShaderStageParams =
+ {
+ VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, // sType
+ DE_NULL, // pNext
+ (VkPipelineShaderStageCreateFlags)0u, // flags
+ VK_SHADER_STAGE_COMPUTE_BIT, // stage
+ *cs, // module
+ "main", // pName
+ DE_NULL, // pSpecializationInfo
+ };
+ const VkComputePipelineCreateInfo pipelineCreateInfo =
+ {
+ VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO, // sType
+ DE_NULL, // pNext
+ (VkPipelineCreateFlags)0u, // flags
+ pipelineShaderStageParams, // stage
+ *m_pipelineLayout, // layout
+ DE_NULL, // basePipelineHandle
+ 0, // basePipelineIndex
+ };
+ m_pipeline = createComputePipeline(vkd, device, DE_NULL, &pipelineCreateInfo);
+ }
+
+ m_buffer = Buffer::createAndAlloc(vkd, device, BufferCreateInfo(bufferSize, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT),
+ m_context.getDefaultAllocator(), MemoryRequirement::HostVisible);
+ m_descriptorPool = DescriptorPoolBuilder()
+ .addType(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER)
+ .build(vkd, device, VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, 1u);
+ const VkDescriptorSetAllocateInfo allocateParams =
+ {
+ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, // sType
+ DE_NULL, // pNext
+ *m_descriptorPool, // descriptorPool
+ 1u, // setLayoutCount
+ &(*descriptorSetLayout), // pSetLayouts
+ };
+
+ m_descriptorSet = allocateDescriptorSet(vkd, device, &allocateParams);
+ const VkDescriptorBufferInfo descriptorInfo =
+ {
+ m_buffer->object(), // buffer
+ 0ull, // offset
+ bufferSize, // range
+ };
+
+ DescriptorSetUpdateBuilder()
+ .writeSingle(*m_descriptorSet, DescriptorSetUpdateBuilder::Location::binding(0u), VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, &descriptorInfo)
+ .update(vkd, device);
+
+ // clear buffer
+ const std::vector<deUint8> data((size_t)bufferSize, 0u);
+ const Allocation& allocation = m_buffer->getBoundMemory();
+ void* allocationData = allocation.getHostPtr();
+ invalidateMappedMemoryRange(vkd, device, allocation.getMemory(), allocation.getOffset(), bufferSize);
+ deMemcpy(allocationData, &data[0], (size_t)bufferSize);
+
+ const VkBufferMemoryBarrier barrier =
+ {
+ VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, // sType
+ DE_NULL, // pNext
+ VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, // srcAccessMask
+ VK_ACCESS_HOST_READ_BIT, // dstAccessMask
+ VK_QUEUE_FAMILY_IGNORED, // srcQueueFamilyIndex
+ VK_QUEUE_FAMILY_IGNORED, // destQueueFamilyIndex
+ m_buffer->object(), // buffer
+ 0ull, // offset
+ bufferSize, // size
+ };
+ m_computeFinishBarrier = barrier;
+}
+
+class ComputeQueryTest : public ComputeQueryTestBase
+{
+public:
+ ComputeQueryTest (vkt::Context& context);
+ tcu::TestStatus iterate (void);
+};
+
+ComputeQueryTest::ComputeQueryTest(vkt::Context& context)
+ : ComputeQueryTestBase(context)
+{
+}
+
+tcu::TestStatus ComputeQueryTest::iterate(void)
+{
+ const DeviceInterface& vkd = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+ const VkQueue queue = m_context.getUniversalQueue();
+ const CmdPoolCreateInfo cmdPoolCreateInfo (m_context.getUniversalQueueFamilyIndex());
+ const Unique<VkCommandPool> cmdPool (createCommandPool(vkd, device, &cmdPoolCreateInfo));
+ const Unique<VkCommandBuffer> cmdBuffer (allocateCommandBuffer(vkd, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+
+ initStateObjects();
+ setupCounters();
+
+ vk::Unique<VkQueryPool> queryPool(createQueryPool(0, 1));
+
+ if (!acquireProfilingLock())
+ {
+ // lock was not acquired in given time, we can't fail the test
+ return tcu::TestStatus::pass("Pass");
+ }
+
+ beginCommandBuffer(vkd, *cmdBuffer);
+ vkd.cmdResetQueryPool(*cmdBuffer, *queryPool, 0u, 1u);
+
+ vkd.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *m_pipeline);
+ vkd.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *m_pipelineLayout, 0u, 1u, &(m_descriptorSet.get()), 0u, DE_NULL);
+
+ vkd.cmdBeginQuery(*cmdBuffer, *queryPool, 0u, (VkQueryControlFlags)0u);
+ vkd.cmdDispatch(*cmdBuffer, 2, 2, 2);
+ vkd.cmdEndQuery(*cmdBuffer, *queryPool, 0u);
+
+ vkd.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_HOST_BIT,
+ (VkDependencyFlags)0u, 0u, (const VkMemoryBarrier*)DE_NULL, 1u, &m_computeFinishBarrier, 0u, (const VkImageMemoryBarrier*)DE_NULL);
+ endCommandBuffer(vkd, *cmdBuffer);
+
+ // submit command buffer for each pass and wait for its completion
+ for (deUint32 passIndex = 0; passIndex < getRequiredNumerOfPasses(); passIndex++)
+ {
+ const Unique<VkFence> fence(createFence(vkd, device));
+
+ VkPerformanceQuerySubmitInfoKHR performanceQuerySubmitInfo =
+ {
+ VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR,
+ NULL,
+ passIndex
+ };
+
+ const VkSubmitInfo submitInfo =
+ {
+ VK_STRUCTURE_TYPE_SUBMIT_INFO, // sType
+ &performanceQuerySubmitInfo, // pNext
+ 0u, // waitSemaphoreCount
+ DE_NULL, // pWaitSemaphores
+ (const VkPipelineStageFlags*)DE_NULL, // pWaitDstStageMask
+ 1u, // commandBufferCount
+ &cmdBuffer.get(), // pCommandBuffers
+ 0u, // signalSemaphoreCount
+ DE_NULL, // pSignalSemaphores
+ };
+
+ VK_CHECK(vkd.queueSubmit(queue, 1u, &submitInfo, *fence));
+ VK_CHECK(vkd.waitForFences(device, 1u, &fence.get(), DE_TRUE, ~0ull));
+ }
+
+ releaseProfilingLock();
+
+ VK_CHECK(vkd.resetCommandBuffer(*cmdBuffer, 0));
+
+ if (verifyQueryResults(*queryPool))
+ return tcu::TestStatus::pass("Pass");
+ return tcu::TestStatus::fail("Fail");
+}
+
+class ComputeMultiplePoolsTest : public ComputeQueryTestBase
+{
+public:
+ ComputeMultiplePoolsTest (vkt::Context& context);
+ tcu::TestStatus iterate (void);
+};
+
+ComputeMultiplePoolsTest::ComputeMultiplePoolsTest(vkt::Context& context)
+ : ComputeQueryTestBase(context)
+{
+}
+
+tcu::TestStatus ComputeMultiplePoolsTest::iterate(void)
+{
+ if (!m_context.getPerformanceCounterFeatures().performanceCounterMultipleQueryPools)
+ throw tcu::NotSupportedError("MultipleQueryPools not supported");
+
+ const DeviceInterface& vkd = m_context.getDeviceInterface();
+ const VkDevice device = m_context.getDevice();
+ const VkQueue queue = m_context.getUniversalQueue();
+ const CmdPoolCreateInfo cmdPoolCreateInfo(m_context.getUniversalQueueFamilyIndex());
+ const Unique<VkCommandPool> cmdPool(createCommandPool(vkd, device, &cmdPoolCreateInfo));
+ const Unique<VkCommandBuffer> cmdBuffer(allocateCommandBuffer(vkd, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY));
+
+ initStateObjects();
+ setupCounters();
+
+ vk::Unique<VkQueryPool> queryPool1(createQueryPool(0, 2)),
+ queryPool2(createQueryPool(1, 2));
+
+ if (!acquireProfilingLock())
+ {
+ // lock was not acquired in given time, we can't fail the test
+ return tcu::TestStatus::pass("Pass");
+ }
+
+ const VkQueryPool queryPools[] =
+ {
+ *queryPool1,
+ *queryPool2
+ };
+
+ beginCommandBuffer(vkd, *cmdBuffer);
+ vkd.cmdResetQueryPool(*cmdBuffer, queryPools[0], 0u, 1u);
+ vkd.cmdResetQueryPool(*cmdBuffer, queryPools[1], 0u, 1u);
+
+ vkd.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *m_pipeline);
+ vkd.cmdBindDescriptorSets(*cmdBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, *m_pipelineLayout, 0u, 1u, &(m_descriptorSet.get()), 0u, DE_NULL);
+
+ // perform two queries
+ for (deUint32 loop = 0; loop < DE_LENGTH_OF_ARRAY(queryPools); ++loop)
+ {
+ const VkQueryPool queryPool = queryPools[loop];
+ vkd.cmdBeginQuery(*cmdBuffer, queryPool, 0u, (VkQueryControlFlags)0u);
+ vkd.cmdDispatch(*cmdBuffer, 2, 2, 2);
+ vkd.cmdEndQuery(*cmdBuffer, queryPool, 0u);
+ }
+
+ vkd.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_HOST_BIT,
+ (VkDependencyFlags)0u, 0u, (const VkMemoryBarrier*)DE_NULL, 1u, &m_computeFinishBarrier, 0u, (const VkImageMemoryBarrier*)DE_NULL);
+ endCommandBuffer(vkd, *cmdBuffer);
+
+ // submit command buffer for each pass and wait for its completion
+ for (deUint32 passIndex = 0; passIndex < getRequiredNumerOfPasses(); passIndex++)
+ {
+ const Unique<VkFence> fence(createFence(vkd, device));
+
+ VkPerformanceQuerySubmitInfoKHR performanceQuerySubmitInfo =
+ {
+ VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR,
+ NULL,
+ passIndex
+ };
+
+ const VkSubmitInfo submitInfo =
+ {
+ VK_STRUCTURE_TYPE_SUBMIT_INFO, // sType
+ &performanceQuerySubmitInfo, // pNext
+ 0u, // waitSemaphoreCount
+ DE_NULL, // pWaitSemaphores
+ (const VkPipelineStageFlags*)DE_NULL, // pWaitDstStageMask
+ 1u, // commandBufferCount
+ &cmdBuffer.get(), // pCommandBuffers
+ 0u, // signalSemaphoreCount
+ DE_NULL, // pSignalSemaphores
+ };
+
+ VK_CHECK(vkd.queueSubmit(queue, 1u, &submitInfo, *fence));
+ VK_CHECK(vkd.waitForFences(device, 1u, &fence.get(), DE_TRUE, ~0ull));
+ }
+
+ releaseProfilingLock();
+
+ VK_CHECK(vkd.resetCommandBuffer(*cmdBuffer, 0));
+
+ if (verifyQueryResults(*queryPool1) && verifyQueryResults(*queryPool2))
+ return tcu::TestStatus::pass("Pass");
+ return tcu::TestStatus::fail("Fail");
+}
+
+enum TestType
+{
+ TT_ENUMERATE_AND_VALIDATE = 0,
+ TT_QUERY,
+ TT_MULTIPLE_POOLS
+};
+
+class QueryPoolPerformanceTest : public TestCase
+{
+public:
+ QueryPoolPerformanceTest (tcu::TestContext &context, TestType testType, VkQueueFlagBits queueFlagBits, const char *name)
+ : TestCase (context, name, "")
+ , m_testType (testType)
+ , m_queueFlagBits (queueFlagBits)
+ {
+ }
+
+ vkt::TestInstance* createInstance (vkt::Context& context) const
+ {
+ if (m_testType == TT_ENUMERATE_AND_VALIDATE)
+ return new EnumerateAndValidateTest(context, m_queueFlagBits);
+
+ if (m_queueFlagBits == VK_QUEUE_GRAPHICS_BIT)
+ {
+ if (m_testType == TT_QUERY)
+ return new GraphicQueryTest(context);
+ return new GraphicMultiplePoolsTest(context);
+ }
+
+ // tests for VK_QUEUE_COMPUTE_BIT
+ if (m_testType == TT_QUERY)
+ return new ComputeQueryTest(context);
+ return new ComputeMultiplePoolsTest(context);
+ }
+
+ void initPrograms (SourceCollections& programCollection) const
+ {
+ // validation test do not need programs
+ if (m_testType == TT_ENUMERATE_AND_VALIDATE)
+ return;
+
+ if (m_queueFlagBits == VK_QUEUE_COMPUTE_BIT)
+ {
+ programCollection.glslSources.add("comp")
+ << glu::ComputeSource("#version 430\n"
+ "layout (local_size_x = 1) in;\n"
+ "layout(binding = 0) writeonly buffer Output {\n"
+ " uint values[];\n"
+ "} sb_out;\n\n"
+ "void main (void) {\n"
+ " uint index = uint(gl_GlobalInvocationID.x);\n"
+ " sb_out.values[index] += gl_GlobalInvocationID.y*2;\n"
+ "}\n");
+ return;
+ }
+
+ programCollection.glslSources.add("frag")
+ << glu::FragmentSource("#version 430\n"
+ "layout(location = 0) out vec4 out_FragColor;\n"
+ "void main()\n"
+ "{\n"
+ " out_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n"
+ "}\n");
+
+ programCollection.glslSources.add("vert")
+ << glu::VertexSource("#version 430\n"
+ "layout(location = 0) in vec4 in_Position;\n"
+ "out gl_PerVertex { vec4 gl_Position; float gl_PointSize; };\n"
+ "void main() {\n"
+ " gl_Position = in_Position;\n"
+ " gl_PointSize = 1.0;\n"
+ "}\n");
+ }
+
+private:
+
+ TestType m_testType;
+ VkQueueFlagBits m_queueFlagBits;
+};
+
+} //anonymous
+
+QueryPoolPerformanceTests::QueryPoolPerformanceTests (tcu::TestContext &testCtx)
+ : TestCaseGroup(testCtx, "performance_query", "Tests for performance queries")
+{
+}
+
+void QueryPoolPerformanceTests::init (void)
+{
+ addChild(new QueryPoolPerformanceTest(m_testCtx, TT_ENUMERATE_AND_VALIDATE, VK_QUEUE_GRAPHICS_BIT, "enumerate_and_validate_graphic"));
+ addChild(new QueryPoolPerformanceTest(m_testCtx, TT_ENUMERATE_AND_VALIDATE, VK_QUEUE_COMPUTE_BIT, "enumerate_and_validate_compute"));
+ addChild(new QueryPoolPerformanceTest(m_testCtx, TT_QUERY, VK_QUEUE_GRAPHICS_BIT, "query_graphic"));
+ addChild(new QueryPoolPerformanceTest(m_testCtx, TT_QUERY, VK_QUEUE_COMPUTE_BIT, "query_compute"));
+ addChild(new QueryPoolPerformanceTest(m_testCtx, TT_MULTIPLE_POOLS, VK_QUEUE_GRAPHICS_BIT, "multiple_pools_graphic"));
+ addChild(new QueryPoolPerformanceTest(m_testCtx, TT_MULTIPLE_POOLS, VK_QUEUE_COMPUTE_BIT, "multiple_pools_compute"));
+}
+
+} //QueryPool
+} //vkt
+
--- /dev/null
+#ifndef _VKTQUERYPOOLPERFORMANCETESTS_HPP
+#define _VKTQUERYPOOLPERFORMANCETESTS_HPP
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2018 The Khronos Group 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.
+ *
+ *//*!
+ * \file
+ * \brief Vulkan Performance Query Tests
+ *//*--------------------------------------------------------------------*/
+
+#include "vktTestCase.hpp"
+
+namespace vkt
+{
+namespace QueryPool
+{
+
+class QueryPoolPerformanceTests : public tcu::TestCaseGroup
+{
+public:
+ QueryPoolPerformanceTests (tcu::TestContext &testCtx);
+ ~QueryPoolPerformanceTests (void) {}
+ void init (void);
+
+private:
+ QueryPoolPerformanceTests (const QueryPoolPerformanceTests &other);
+ QueryPoolPerformanceTests& operator= (const QueryPoolPerformanceTests &other);
+};
+
+} // QueryPool
+} // vkt
+
+#endif // _VKTQUERYPOOLPERFORMANCETESTS_HPP
#include "vktTestGroupUtil.hpp"
#include "vktQueryPoolOcclusionTests.hpp"
#include "vktQueryPoolStatisticsTests.hpp"
+#include "vktQueryPoolPerformanceTests.hpp"
namespace vkt
{
queryPoolTests->addChild(new QueryPoolOcclusionTests(testCtx));
queryPoolTests->addChild(new QueryPoolStatisticsTests(testCtx));
+ queryPoolTests->addChild(new QueryPoolPerformanceTests(testCtx));
}
} // anonymous
libamber
)
+include_directories("../../../../../external/amber/src/include")
add_library(deqp-vk-rasterization STATIC ${DEQP_VK_RASTERIZATION_SRCS})
target_link_libraries(deqp-vk-rasterization ${DEQP_VK_RASTERIZATION_LIBS})
vktSpvAsmVariableInitTests.hpp
vktSpvAsmVariablePointersTests.cpp
vktSpvAsmVariablePointersTests.hpp
+ vktSpvAsmSpirvVersion1p4Tests.cpp
+ vktSpvAsmSpirvVersion1p4Tests.hpp
vktSpvAsmSpirvVersionTests.cpp
vktSpvAsmSpirvVersionTests.hpp
vktSpvAsmLoopDepLenTests.cpp
elseif (DE_COMPILER_IS_MSC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4068")
endif()
+include_directories("../../../../amber/src/include")
include_directories("../amber")
add_library(deqp-vk-spirv-assembly STATIC ${DEQP_VK_SPIRV_ASSEMBLY_SRCS})
#include "vktSpvAsmVariablePointersTests.hpp"
#include "vktSpvAsmVariableInitTests.hpp"
#include "vktSpvAsmPointerParameterTests.hpp"
+#include "vktSpvAsmSpirvVersion1p4Tests.hpp"
#include "vktSpvAsmSpirvVersionTests.hpp"
#include "vktTestCaseUtil.hpp"
#include "vktSpvAsmLoopDepLenTests.hpp"
instructionTests->addChild(computeTests.release());
instructionTests->addChild(graphicsTests.release());
+ instructionTests->addChild(createSpirvVersion1p4Group(testCtx));
return instructionTests.release();
}
--- /dev/null
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2019 Google LLC
+ * Copyright (c) 2019 The Khronos Group 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.
+ *
+ *//*!
+ * \file
+ * \brief Test new features in SPIR-V 1.4.
+ *//*--------------------------------------------------------------------*/
+
+#include <string>
+#include <amber/amber.h>
+
+#include "tcuDefs.hpp"
+
+#include "vkDefs.hpp"
+#include "vktAmberTestCase.hpp"
+#include "vktAmberTestCaseUtil.hpp"
+#include "vktSpvAsmSpirvVersion1p4Tests.hpp"
+#include "vktTestGroupUtil.hpp"
+
+namespace vkt
+{
+namespace SpirVAssembly
+{
+namespace
+{
+
+struct Case
+{
+ Case(const char* b, const char* d) : basename(b), description(d) { }
+ const char *basename;
+ const char *description;
+};
+struct CaseGroup
+{
+ CaseGroup(const char* the_data_dir, const char* the_subdir) : data_dir(the_data_dir), subdir(the_subdir) { }
+ void add(const char* basename, const char* description) { cases.push_back(Case(basename, description)); }
+
+ const char* data_dir;
+ const char* subdir;
+ std::vector<Case> cases;
+};
+
+
+void addTestsForAmberFiles (tcu::TestCaseGroup* tests, CaseGroup group)
+{
+ tcu::TestContext& testCtx = tests->getTestContext();
+ const std::string data_dir(group.data_dir);
+ const std::string subdir(group.subdir);
+ const std::string category = data_dir + "/" + subdir;
+ std::vector<Case> cases(group.cases);
+ vk::SpirVAsmBuildOptions asm_options(VK_MAKE_VERSION(1, 1, 0), vk::SPIRV_VERSION_1_4);
+ asm_options.supports_VK_KHR_spirv_1_4 = true;
+
+ for (unsigned i = 0; i < cases.size() ; ++i)
+ {
+
+ const std::string file = std::string(cases[i].basename) + ".amber";
+ cts_amber::AmberTestCase *testCase = cts_amber::createAmberTestCase(testCtx,
+ cases[i].basename,
+ cases[i].description,
+ category.c_str(),
+ file);
+ DE_ASSERT(testCase != DE_NULL);
+ // Add Vulkan extension requirements.
+ // VK_KHR_spirv_1_4 requires Vulkan 1.1, which includes many common extensions.
+ // So for, example, these tests never have to request VK_KHR_storage_buffer_storage_class,
+ // or VK_KHR_variable_pointers since those extensions were promoted to core features
+ // in Vulkan 1.1. Note that feature bits may still be optional.
+ testCase->addRequirement("VK_KHR_spirv_1_4");
+ // The tests often use StorageBuffer storage class.
+ // We do not have to request VK_KHR_storage_buffer_storage_class because that extension
+ // is about enabling use of SPV_KHR_storage_buffer_storage_class. But SPIR-V 1.4 allows
+ // use of StorageBuffer storage class without any further declarations of extensions
+ // or capabilities. This will also hold for tests that use features introduced by
+ // extensions folded into SPIR-V 1.4 or earlier, and which don't require extra capabilities
+ // to be enabled by Vulkan. Other examples are functionality in SPV_GOOGLE_decorate_string,
+ // SPV_GOOGLE_hlsl_functionality1, and SPV_KHR_no_integer_wrap_decoration.
+
+ testCase->setSpirVAsmBuildOptions(asm_options);
+ tests->addChild(testCase);
+ }
+}
+
+} // anonymous
+
+tcu::TestCaseGroup* createSpirvVersion1p4Group (tcu::TestContext& testCtx)
+{
+ de::MovePtr<tcu::TestCaseGroup> spirv1p4Tests(new tcu::TestCaseGroup(testCtx, "spirv1p4", "SPIR-V 1.4 new features"));
+
+ // Location of the Amber script files under the data/vulkan/amber source tree.
+ const char* data_dir = "spirv_assembly/instruction/spirv1p4";
+
+ CaseGroup group(data_dir, "opcopylogical");
+ group.add("different_matrix_layout","different matrix layout");
+ group.add("different_matrix_strides","different matrix strides");
+ group.add("nested_arrays_different_inner_stride","nested_arrays_different_inner_stride");
+ group.add("nested_arrays_different_outer_stride","nested_arrays_different_inner_stride");
+ group.add("nested_arrays_different_strides","nested_arrays_different_strides");
+ group.add("same_array_two_ids","same array two ids");
+ group.add("same_struct_two_ids","same struct two ids");
+ group.add("ssbo_to_ubo","ssbo_to_ubo");
+ group.add("two_arrays_different_stride_1","two_arrays_different_stride_1");
+ group.add("two_arrays_different_stride_2","two_arrays_different_stride_2");
+ group.add("ubo_to_ssbo","ubo_to_ssbo");
+ spirv1p4Tests->addChild(createTestGroup(testCtx, "opcopylogical", "OpCopyLogical", addTestsForAmberFiles, group));
+
+ return spirv1p4Tests.release();
+}
+
+} // SpirVAssembly
+} // vkt
--- /dev/null
+#ifndef _VKTSPVASMSPIRVVERSION1P4TESTS_HPP
+#define _VKTSPVASMSPIRVVERSION1P4TESTS_HPP
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2019 Google LLC
+ * Copyright (c) 2019 The Khronos Group 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.
+ *
+ *//*!
+ * \file
+ * \brief Test new features in SPIR-V 1.4.
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuDefs.hpp"
+#include "tcuTestCase.hpp"
+
+namespace vkt
+{
+namespace SpirVAssembly
+{
+
+tcu::TestCaseGroup* createSpirvVersion1p4Group (tcu::TestContext& testCtx);
+
+} // SpirVAssembly
+} // vkt
+
+#endif // _VKTSPVASMSPIRVVERSION1P4TESTS_HPP
{ "1.1", VK_MAKE_VERSION(1, 1, 0) },
};
- DE_STATIC_ASSERT(vk::SPIRV_VERSION_1_3 + 1 == vk::SPIRV_VERSION_LAST);
+ DE_STATIC_ASSERT(vk::SPIRV_VERSION_1_4 + 1 == vk::SPIRV_VERSION_LAST);
parser << Option<opt::DstPath>("d", "dst-path", "Destination path", "out")
<< Option<opt::Cases>("n", "deqp-case", "Case path filter (works as in test binaries)")
#include "vktMemoryModelTests.hpp"
#include "vktAmberExampleTests.hpp"
#include "vktAmberGraphicsFuzzTests.hpp"
+#include "vktImagelessFramebufferTests.hpp"
#include "vktTransformFeedbackTests.hpp"
#include "vktDescriptorIndexingTests.hpp"
virtual tcu::TestNode::IterateResult iterate (tcu::TestCase* testCase);
private:
+ bool spirvVersionSupported(vk::SpirvVersion);
vk::BinaryCollection m_progCollection;
vk::BinaryRegistryReader m_prebuiltBinRegistry;
for (vk::GlslSourceCollection::Iterator progIter = sourceProgs.glslSources.begin(); progIter != sourceProgs.glslSources.end(); ++progIter)
{
- if (progIter.getProgram().buildOptions.targetVersion > vk::getMaxSpirvVersionForGlsl(m_context.getUsedApiVersion()))
+ if (!spirvVersionSupported(progIter.getProgram().buildOptions.targetVersion))
TCU_THROW(NotSupportedError, "Shader requires SPIR-V higher than available");
const vk::ProgramBinary* const binProg = buildProgram<glu::ShaderProgramInfo, vk::GlslSourceCollection::Iterator>(casePath, progIter, m_prebuiltBinRegistry, log, &m_progCollection, commandLine);
for (vk::HlslSourceCollection::Iterator progIter = sourceProgs.hlslSources.begin(); progIter != sourceProgs.hlslSources.end(); ++progIter)
{
- if (progIter.getProgram().buildOptions.targetVersion > vk::getMaxSpirvVersionForGlsl(m_context.getUsedApiVersion()))
+ if (!spirvVersionSupported(progIter.getProgram().buildOptions.targetVersion))
TCU_THROW(NotSupportedError, "Shader requires SPIR-V higher than available");
const vk::ProgramBinary* const binProg = buildProgram<glu::ShaderProgramInfo, vk::HlslSourceCollection::Iterator>(casePath, progIter, m_prebuiltBinRegistry, log, &m_progCollection, commandLine);
for (vk::SpirVAsmCollection::Iterator asmIterator = sourceProgs.spirvAsmSources.begin(); asmIterator != sourceProgs.spirvAsmSources.end(); ++asmIterator)
{
- if (asmIterator.getProgram().buildOptions.targetVersion > vk::getMaxSpirvVersionForAsm(m_context.getUsedApiVersion()))
+ if (!spirvVersionSupported(asmIterator.getProgram().buildOptions.targetVersion))
TCU_THROW(NotSupportedError, "Shader requires SPIR-V higher than available");
buildProgram<vk::SpirVProgramInfo, vk::SpirVAsmCollection::Iterator>(casePath, asmIterator, m_prebuiltBinRegistry, log, &m_progCollection, commandLine);
return tcu::TestNode::CONTINUE;
}
+bool TestCaseExecutor::spirvVersionSupported (vk::SpirvVersion spirvVersion)
+{
+ if (spirvVersion <= vk::getMaxSpirvVersionForVulkan(m_context.getUsedApiVersion()))
+ return true;
+
+ if (spirvVersion <= vk::SPIRV_VERSION_1_4)
+ return vk::isDeviceExtensionSupported(m_context.getUsedApiVersion(), m_context.getDeviceExtensions(), "VK_KHR_spirv_1_4");
+
+ return false;
+}
+
// GLSL shader tests
void createGlslTests (tcu::TestCaseGroup* glslTests)
addChild(conditional::createTests (m_testCtx));
addChild(cts_amber::createExampleTests (m_testCtx));
addChild(cts_amber::createGraphicsFuzzTests (m_testCtx));
+ addChild(imageless::createTests (m_testCtx));
addChild(TransformFeedback::createTests (m_testCtx));
addChild(DescriptorIndexing::createTests (m_testCtx));
}
dEQP-VK.spirv_assembly.instruction.compute.spirv_version.1_1_compute
dEQP-VK.spirv_assembly.instruction.compute.spirv_version.1_2_compute
dEQP-VK.spirv_assembly.instruction.compute.spirv_version.1_3_compute
+dEQP-VK.spirv_assembly.instruction.compute.spirv_version.1_4_compute
dEQP-VK.spirv_assembly.instruction.compute.localsize.literal_localsize
dEQP-VK.spirv_assembly.instruction.compute.localsize.literal_and_specid_localsize
dEQP-VK.spirv_assembly.instruction.compute.localsize.specid_localsize
dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_3_tesselation_control
dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_3_geometry
dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_3_fragment
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_vertex
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_tesselation_evaluation
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_tesselation_control
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_geometry
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_fragment
dEQP-VK.spirv_assembly.instruction.graphics.opnop.opnop_vert
dEQP-VK.spirv_assembly.instruction.graphics.opnop.opnop_tessc
dEQP-VK.spirv_assembly.instruction.graphics.opnop.opnop_tesse
dEQP-VK.spirv_assembly.instruction.graphics.spirv_ids_abuse.lots_ids_tesse
dEQP-VK.spirv_assembly.instruction.graphics.spirv_ids_abuse.lots_ids_geom
dEQP-VK.spirv_assembly.instruction.graphics.spirv_ids_abuse.lots_ids_frag
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.different_matrix_layout
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.different_matrix_strides
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.nested_arrays_different_inner_stride
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.nested_arrays_different_outer_stride
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.nested_arrays_different_strides
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.same_array_two_ids
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.same_struct_two_ids
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.ssbo_to_ubo
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.two_arrays_different_stride_1
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.two_arrays_different_stride_2
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.ubo_to_ssbo
dEQP-VK.spirv_assembly.type.scalar.i8.negate_vert
dEQP-VK.spirv_assembly.type.scalar.i8.negate_tessc
dEQP-VK.spirv_assembly.type.scalar.i8.negate_tesse
dEQP-VK.query_pool.statistics_query.reset_before_copy.tes_evaluation_shader_invocations.tes_evaluation_shader_invocations
dEQP-VK.query_pool.statistics_query.reset_before_copy.tes_evaluation_shader_invocations.tes_evaluation_shader_invocations_secondary
dEQP-VK.query_pool.statistics_query.reset_before_copy.tes_evaluation_shader_invocations.tes_evaluation_shader_invocations_secondary_inherited
+dEQP-VK.query_pool.performance_query.enumerate_and_validate_graphic
+dEQP-VK.query_pool.performance_query.enumerate_and_validate_compute
+dEQP-VK.query_pool.performance_query.query_graphic
+dEQP-VK.query_pool.performance_query.query_compute
+dEQP-VK.query_pool.performance_query.multiple_pools_graphic
+dEQP-VK.query_pool.performance_query.multiple_pools_compute
dEQP-VK.draw.simple_draw.simple_draw_triangle_list
dEQP-VK.draw.simple_draw.simple_draw_triangle_strip
dEQP-VK.draw.simple_draw.simple_draw_instanced_triangle_list
dEQP-VK.graphicsfuzz.pow-vec4
dEQP-VK.graphicsfuzz.swizzle-struct-init-min
dEQP-VK.graphicsfuzz.while-inside-switch
+dEQP-VK.imageless_framebuffer.color
+dEQP-VK.imageless_framebuffer.depth_stencil
+dEQP-VK.imageless_framebuffer.color_resolve
+dEQP-VK.imageless_framebuffer.depth_stencil_resolve
+dEQP-VK.imageless_framebuffer.multisubpass
dEQP-VK.transform_feedback.simple.basic_1_256
dEQP-VK.transform_feedback.simple.basic_1_512
dEQP-VK.transform_feedback.simple.basic_1_131072
dEQP-VK.spirv_assembly.instruction.compute.spirv_version.1_1_compute
dEQP-VK.spirv_assembly.instruction.compute.spirv_version.1_2_compute
dEQP-VK.spirv_assembly.instruction.compute.spirv_version.1_3_compute
+dEQP-VK.spirv_assembly.instruction.compute.spirv_version.1_4_compute
dEQP-VK.spirv_assembly.instruction.compute.localsize.literal_localsize
dEQP-VK.spirv_assembly.instruction.compute.localsize.literal_and_specid_localsize
dEQP-VK.spirv_assembly.instruction.compute.localsize.specid_localsize
dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_3_tesselation_control
dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_3_geometry
dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_3_fragment
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_vertex
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_tesselation_evaluation
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_tesselation_control
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_geometry
+dEQP-VK.spirv_assembly.instruction.graphics.spirv_version.1_4_fragment
dEQP-VK.spirv_assembly.instruction.graphics.opnop.opnop_vert
dEQP-VK.spirv_assembly.instruction.graphics.opnop.opnop_tessc
dEQP-VK.spirv_assembly.instruction.graphics.opnop.opnop_tesse
dEQP-VK.spirv_assembly.instruction.graphics.spirv_ids_abuse.lots_ids_tesse
dEQP-VK.spirv_assembly.instruction.graphics.spirv_ids_abuse.lots_ids_geom
dEQP-VK.spirv_assembly.instruction.graphics.spirv_ids_abuse.lots_ids_frag
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.different_matrix_layout
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.different_matrix_strides
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.nested_arrays_different_inner_stride
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.nested_arrays_different_outer_stride
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.nested_arrays_different_strides
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.same_array_two_ids
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.same_struct_two_ids
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.ssbo_to_ubo
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.two_arrays_different_stride_1
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.two_arrays_different_stride_2
+dEQP-VK.spirv_assembly.instruction.spirv1p4.opcopylogical.ubo_to_ssbo
dEQP-VK.spirv_assembly.type.scalar.i8.negate_vert
dEQP-VK.spirv_assembly.type.scalar.i8.negate_tessc
dEQP-VK.spirv_assembly.type.scalar.i8.negate_tesse
dEQP-VK.query_pool.statistics_query.reset_before_copy.tes_evaluation_shader_invocations.tes_evaluation_shader_invocations
dEQP-VK.query_pool.statistics_query.reset_before_copy.tes_evaluation_shader_invocations.tes_evaluation_shader_invocations_secondary
dEQP-VK.query_pool.statistics_query.reset_before_copy.tes_evaluation_shader_invocations.tes_evaluation_shader_invocations_secondary_inherited
+dEQP-VK.query_pool.performance_query.enumerate_and_validate_graphic
+dEQP-VK.query_pool.performance_query.enumerate_and_validate_compute
+dEQP-VK.query_pool.performance_query.query_graphic
+dEQP-VK.query_pool.performance_query.query_compute
+dEQP-VK.query_pool.performance_query.multiple_pools_graphic
+dEQP-VK.query_pool.performance_query.multiple_pools_compute
dEQP-VK.draw.simple_draw.simple_draw_triangle_list
dEQP-VK.draw.simple_draw.simple_draw_triangle_strip
dEQP-VK.draw.simple_draw.simple_draw_instanced_triangle_list
dEQP-VK.graphicsfuzz.pow-vec4
dEQP-VK.graphicsfuzz.swizzle-struct-init-min
dEQP-VK.graphicsfuzz.while-inside-switch
+dEQP-VK.imageless_framebuffer.color
+dEQP-VK.imageless_framebuffer.depth_stencil
+dEQP-VK.imageless_framebuffer.color_resolve
+dEQP-VK.imageless_framebuffer.depth_stencil_resolve
+dEQP-VK.imageless_framebuffer.multisubpass
dEQP-VK.transform_feedback.simple.basic_1_256
dEQP-VK.transform_feedback.simple.basic_1_512
dEQP-VK.transform_feedback.simple.basic_1_131072
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT = 1000102000,
VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT = 1000102001,
VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR = 1000108000,
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR = 1000108001,
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR = 1000108002,
+ VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR = 1000108003,
VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR = 1000109000,
VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR = 1000109001,
VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR = 1000109002,
VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR = 1000114002,
VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR = 1000115000,
VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR = 1000115001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_FEATURES_KHR = 1000116000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_COUNTER_PROPERTIES_KHR = 1000116001,
+ VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_CREATE_INFO_KHR = 1000116002,
+ VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR = 1000116003,
+ VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR = 1000116004,
+ VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR = 1000116005,
+ VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR = 1000116006,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR = 1000119000,
VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR = 1000119001,
VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR = 1000119002,
VK_QUERY_TYPE_PIPELINE_STATISTICS = 1,
VK_QUERY_TYPE_TIMESTAMP = 2,
VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT = 1000028004,
+ VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR = 1000116000,
VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV = 1000165000,
VK_QUERY_TYPE_BEGIN_RANGE = VK_QUERY_TYPE_OCCLUSION,
VK_QUERY_TYPE_END_RANGE = VK_QUERY_TYPE_TIMESTAMP,
} VkDescriptorPoolCreateFlagBits;
typedef VkFlags VkDescriptorPoolCreateFlags;
typedef VkFlags VkDescriptorPoolResetFlags;
+
+typedef enum VkFramebufferCreateFlagBits {
+ VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR = 0x00000001,
+ VK_FRAMEBUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkFramebufferCreateFlagBits;
typedef VkFlags VkFramebufferCreateFlags;
typedef VkFlags VkRenderPassCreateFlags;
const void* pData);
#endif
+#define VK_KHR_imageless_framebuffer 1
+#define VK_KHR_IMAGELESS_FRAMEBUFFER_SPEC_VERSION 1
+#define VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME "VK_KHR_imageless_framebuffer"
+
+typedef struct VkPhysicalDeviceImagelessFramebufferFeaturesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 imagelessFramebuffer;
+} VkPhysicalDeviceImagelessFramebufferFeaturesKHR;
+
+typedef struct VkFramebufferAttachmentImageInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkImageCreateFlags flags;
+ VkImageUsageFlags usage;
+ uint32_t width;
+ uint32_t height;
+ uint32_t layerCount;
+ uint32_t viewFormatCount;
+ const VkFormat* pViewFormats;
+} VkFramebufferAttachmentImageInfoKHR;
+
+typedef struct VkFramebufferAttachmentsCreateInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t attachmentImageInfoCount;
+ const VkFramebufferAttachmentImageInfoKHR* pAttachmentImageInfos;
+} VkFramebufferAttachmentsCreateInfoKHR;
+
+typedef struct VkRenderPassAttachmentBeginInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t attachmentCount;
+ const VkImageView* pAttachments;
+} VkRenderPassAttachmentBeginInfoKHR;
+
+
#define VK_KHR_create_renderpass2 1
#define VK_KHR_CREATE_RENDERPASS_2_SPEC_VERSION 1
#endif
+#define VK_KHR_performance_query 1
+#define VK_KHR_PERFORMANCE_QUERY_SPEC_VERSION 1
+#define VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME "VK_KHR_performance_query"
+
+
+typedef enum VkPerformanceCounterUnitKHR {
+ VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR = 0,
+ VK_PERFORMANCE_COUNTER_UNIT_PERCENTAGE_KHR = 1,
+ VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR = 2,
+ VK_PERFORMANCE_COUNTER_UNIT_BYTES_KHR = 3,
+ VK_PERFORMANCE_COUNTER_UNIT_BYTES_PER_SECOND_KHR = 4,
+ VK_PERFORMANCE_COUNTER_UNIT_KELVIN_KHR = 5,
+ VK_PERFORMANCE_COUNTER_UNIT_WATTS_KHR = 6,
+ VK_PERFORMANCE_COUNTER_UNIT_VOLTS_KHR = 7,
+ VK_PERFORMANCE_COUNTER_UNIT_AMPS_KHR = 8,
+ VK_PERFORMANCE_COUNTER_UNIT_HERTZ_KHR = 9,
+ VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR = 10,
+ VK_PERFORMANCE_COUNTER_UNIT_BEGIN_RANGE_KHR = VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR,
+ VK_PERFORMANCE_COUNTER_UNIT_END_RANGE_KHR = VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR,
+ VK_PERFORMANCE_COUNTER_UNIT_RANGE_SIZE_KHR = (VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR - VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR + 1),
+ VK_PERFORMANCE_COUNTER_UNIT_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkPerformanceCounterUnitKHR;
+
+typedef enum VkPerformanceCounterScopeKHR {
+ VK_QUERY_SCOPE_COMMAND_BUFFER_KHR = 0,
+ VK_QUERY_SCOPE_RENDER_PASS_KHR = 1,
+ VK_QUERY_SCOPE_COMMAND_KHR = 2,
+ VK_PERFORMANCE_COUNTER_SCOPE_BEGIN_RANGE_KHR = VK_QUERY_SCOPE_COMMAND_BUFFER_KHR,
+ VK_PERFORMANCE_COUNTER_SCOPE_END_RANGE_KHR = VK_QUERY_SCOPE_COMMAND_KHR,
+ VK_PERFORMANCE_COUNTER_SCOPE_RANGE_SIZE_KHR = (VK_QUERY_SCOPE_COMMAND_KHR - VK_QUERY_SCOPE_COMMAND_BUFFER_KHR + 1),
+ VK_PERFORMANCE_COUNTER_SCOPE_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkPerformanceCounterScopeKHR;
+
+typedef enum VkPerformanceCounterStorageKHR {
+ VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR = 0,
+ VK_PERFORMANCE_COUNTER_STORAGE_INT64_KHR = 1,
+ VK_PERFORMANCE_COUNTER_STORAGE_UINT32_KHR = 2,
+ VK_PERFORMANCE_COUNTER_STORAGE_UINT64_KHR = 3,
+ VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR = 4,
+ VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR = 5,
+ VK_PERFORMANCE_COUNTER_STORAGE_BEGIN_RANGE_KHR = VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR,
+ VK_PERFORMANCE_COUNTER_STORAGE_END_RANGE_KHR = VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR,
+ VK_PERFORMANCE_COUNTER_STORAGE_RANGE_SIZE_KHR = (VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR - VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR + 1),
+ VK_PERFORMANCE_COUNTER_STORAGE_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkPerformanceCounterStorageKHR;
+
+
+typedef enum VkPerformanceCounterDescriptionFlagBitsKHR {
+ VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_KHR = 0x00000001,
+ VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_KHR = 0x00000002,
+ VK_PERFORMANCE_COUNTER_DESCRIPTION_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkPerformanceCounterDescriptionFlagBitsKHR;
+typedef VkFlags VkPerformanceCounterDescriptionFlagsKHR;
+typedef VkFlags VkAcquireProfilingLockFlagsKHR;
+
+typedef struct VkPhysicalDevicePerformanceCounterFeaturesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 performanceCounterQueryPools;
+ VkBool32 performanceCounterMultipleQueryPools;
+} VkPhysicalDevicePerformanceCounterFeaturesKHR;
+
+typedef struct VkPhysicalDevicePerformanceCounterPropertiesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 allowCommandBufferQueryCopies;
+} VkPhysicalDevicePerformanceCounterPropertiesKHR;
+
+typedef struct VkPerformanceCounterKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkPerformanceCounterUnitKHR unit;
+ VkPerformanceCounterScopeKHR scope;
+ VkPerformanceCounterStorageKHR storage;
+ uint8_t uuid[VK_UUID_SIZE];
+} VkPerformanceCounterKHR;
+
+typedef struct VkPerformanceCounterDescriptionKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkPerformanceCounterDescriptionFlagsKHR flags;
+ char name[VK_MAX_DESCRIPTION_SIZE];
+ char category[VK_MAX_DESCRIPTION_SIZE];
+ char description[VK_MAX_DESCRIPTION_SIZE];
+} VkPerformanceCounterDescriptionKHR;
+
+typedef struct VkPerformanceQueryCreateInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t queueFamilyIndex;
+ uint32_t counterIndexCount;
+ const uint32_t* pCounterIndices;
+} VkPerformanceQueryCreateInfoKHR;
+
+typedef union VkPerformanceCounterResultKHR {
+ int32_t int32;
+ int64_t int64;
+ uint32_t uint32;
+ uint64_t uint64;
+ float float32;
+ double float64;
+} VkPerformanceCounterResultKHR;
+
+typedef struct VkAcquireProfilingLockInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkAcquireProfilingLockFlagsKHR flags;
+ uint64_t timeout;
+} VkAcquireProfilingLockInfoKHR;
+
+typedef struct VkPerformanceQuerySubmitInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t counterPassIndex;
+} VkPerformanceQuerySubmitInfoKHR;
+
+
+typedef void (VKAPI_PTR *PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions);
+typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR)(VkPhysicalDevice physicalDevice, const VkPerformanceQueryCreateInfoKHR* pPerformanceQueryCreateInfo, uint32_t* pNumPasses);
+typedef VkResult (VKAPI_PTR *PFN_vkAcquireProfilingLockKHR)(VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo);
+typedef void (VKAPI_PTR *PFN_vkReleaseProfilingLockKHR)(VkDevice device);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
+ VkPhysicalDevice physicalDevice,
+ uint32_t queueFamilyIndex,
+ uint32_t* pCounterCount,
+ VkPerformanceCounterKHR* pCounters,
+ VkPerformanceCounterDescriptionKHR* pCounterDescriptions);
+
+VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(
+ VkPhysicalDevice physicalDevice,
+ const VkPerformanceQueryCreateInfoKHR* pPerformanceQueryCreateInfo,
+ uint32_t* pNumPasses);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkAcquireProfilingLockKHR(
+ VkDevice device,
+ const VkAcquireProfilingLockInfoKHR* pInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkReleaseProfilingLockKHR(
+ VkDevice device);
+#endif
+
#define VK_KHR_maintenance2 1
#define VK_KHR_MAINTENANCE2_SPEC_VERSION 1
#define VK_KHR_MAINTENANCE2_EXTENSION_NAME "VK_KHR_maintenance2"
} VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV;
-
#define VK_EXT_buffer_device_address 1
typedef uint64_t VkDeviceAddress;
#define VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION 2