Add tests for VK_EXT_depth_clip_control
authorAri Suonpaa <ari.suonpaa@siru.fi>
Mon, 11 Oct 2021 08:34:47 +0000 (11:34 +0300)
committerAri Suonpaa <ari.suonpaa@siru.fi>
Mon, 11 Oct 2021 08:34:47 +0000 (11:34 +0300)
Also modified graphics pipeline creation framework
to provide default structures when passing null
pointers as arguments.

VK-GL-CTS Issue: 3086

New Tests:

dEQP-VK.pipeline.depth.depth_clip_control.*
dEQP-VK.transform_feedback.simple.depth_clip_control_*

Components: Vulkan, Framework
Change-Id: I60bb7fa8775ffc43c5accd5b49b2ed90d5c05ae6

26 files changed:
android/cts/master/vk-master-2021-03-01/pipeline.txt
android/cts/master/vk-master-2021-03-01/transform-feedback.txt
android/cts/master/vk-master/pipeline.txt
android/cts/master/vk-master/transform-feedback.txt
external/vulkancts/framework/vulkan/vkBasicTypes.inl
external/vulkancts/framework/vulkan/vkDeviceFeatureTest.inl
external/vulkancts/framework/vulkan/vkDeviceFeatures.inl
external/vulkancts/framework/vulkan/vkDeviceFeaturesForContextDecl.inl
external/vulkancts/framework/vulkan/vkDeviceFeaturesForContextDefs.inl
external/vulkancts/framework/vulkan/vkDeviceFeaturesForDefaultDeviceDefs.inl
external/vulkancts/framework/vulkan/vkExtensionFunctions.inl
external/vulkancts/framework/vulkan/vkGetStructureTypeImpl.inl
external/vulkancts/framework/vulkan/vkMandatoryFeatures.inl
external/vulkancts/framework/vulkan/vkObjUtil.cpp
external/vulkancts/framework/vulkan/vkObjUtil.hpp
external/vulkancts/framework/vulkan/vkStrUtil.inl
external/vulkancts/framework/vulkan/vkStrUtilImpl.inl
external/vulkancts/framework/vulkan/vkStructTypes.inl
external/vulkancts/framework/vulkan/vkVulkan_c.inl
external/vulkancts/modules/vulkan/pipeline/vktPipelineDepthTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineReferenceRenderer.hpp
external/vulkancts/modules/vulkan/transform_feedback/vktTransformFeedbackSimpleTests.cpp
external/vulkancts/mustpass/master/vk-default/pipeline.txt
external/vulkancts/mustpass/master/vk-default/transform-feedback.txt
external/vulkancts/scripts/src/mandatory_features.txt
external/vulkancts/scripts/src/vulkan_core.h

index 1a6ced9..c118b43 100644 (file)
@@ -4214,6 +4214,18 @@ dEQP-VK.pipeline.blend.dual_source.format.a4b4g4r4_unorm_pack16_ext.states.color
 dEQP-VK.pipeline.blend.dual_source.format.a4b4g4r4_unorm_pack16_ext.states.color_1mca_1mdc_min_alpha_ca_1ms1a_min-color_o_s1a_add_alpha_s1a_ca_add-color_sas_1mca_add_alpha_1msc_sa_sub-color_sc_1msc_max_alpha_1msc_sas_max
 dEQP-VK.pipeline.blend.dual_source.format.a4b4g4r4_unorm_pack16_ext.states.color_1mcc_s1c_max_alpha_da_sc_add-color_dc_1mcc_sub_alpha_s1a_o_sub-color_1ms1a_da_sub_alpha_cc_da_max-color_1msa_s1a_max_alpha_ca_s1a_add
 dEQP-VK.pipeline.blend.dual_source.format.a4b4g4r4_unorm_pack16_ext.states.color_1ms1a_o_rsub_alpha_o_sas_max-color_z_1msa_min_alpha_dc_sc_rsub-color_sc_1mda_add_alpha_1ms1c_cc_max-color_s1a_1ms1c_max_alpha_1mca_o_rsub
+dEQP-VK.pipeline.depth.depth_clip_control.d16_unorm_always
+dEQP-VK.pipeline.depth.depth_clip_control.d16_unorm_less
+dEQP-VK.pipeline.depth.depth_clip_control.x8_d24_unorm_pack32_always
+dEQP-VK.pipeline.depth.depth_clip_control.x8_d24_unorm_pack32_less
+dEQP-VK.pipeline.depth.depth_clip_control.d32_sfloat_always
+dEQP-VK.pipeline.depth.depth_clip_control.d32_sfloat_less
+dEQP-VK.pipeline.depth.depth_clip_control.d16_unorm_s8_uint_always
+dEQP-VK.pipeline.depth.depth_clip_control.d16_unorm_s8_uint_less
+dEQP-VK.pipeline.depth.depth_clip_control.d24_unorm_s8_uint_always
+dEQP-VK.pipeline.depth.depth_clip_control.d24_unorm_s8_uint_less
+dEQP-VK.pipeline.depth.depth_clip_control.d32_sfloat_s8_uint_always
+dEQP-VK.pipeline.depth.depth_clip_control.d32_sfloat_s8_uint_less
 dEQP-VK.pipeline.dynamic_offset.graphics.multiset.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_1.numnondynamicbindings_0
 dEQP-VK.pipeline.dynamic_offset.graphics.multiset.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_1.numnondynamicbindings_1
 dEQP-VK.pipeline.dynamic_offset.graphics.multiset.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_2.numnondynamicbindings_0
index bf98a42..69a7b79 100644 (file)
@@ -1565,6 +1565,9 @@ dEQP-VK.transform_feedback.simple.host_query_reset_triangle_strip_with_adjacency
 dEQP-VK.transform_feedback.simple.query_triangle_strip_with_adjacency_14_508_64bits
 dEQP-VK.transform_feedback.simple.query_copy_triangle_strip_with_adjacency_14_508_64bits
 dEQP-VK.transform_feedback.simple.host_query_reset_triangle_strip_with_adjacency_14_508_64bits
+dEQP-VK.transform_feedback.simple.depth_clip_control_vertex
+dEQP-VK.transform_feedback.simple.depth_clip_control_geometry
+dEQP-VK.transform_feedback.simple.depth_clip_control_tese
 dEQP-VK.transform_feedback.simple.multiquery_1
 dEQP-VK.transform_feedback.simple.multiquery_3
 dEQP-VK.transform_feedback.simple.multiquery_6
index 6337e14..a39b2a1 100644 (file)
@@ -68159,6 +68159,18 @@ dEQP-VK.pipeline.depth.nocolor.format.d32_sfloat_s8_uint_separate_layouts.compar
 dEQP-VK.pipeline.depth.nocolor.format.d32_sfloat_s8_uint_separate_layouts.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.nocolor.format.d32_sfloat_s8_uint_separate_layouts.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
 dEQP-VK.pipeline.depth.nocolor.format.d32_sfloat_s8_uint_separate_layouts.depth_test_disabled.depth_write_enabled
+dEQP-VK.pipeline.depth.depth_clip_control.d16_unorm_always
+dEQP-VK.pipeline.depth.depth_clip_control.d16_unorm_less
+dEQP-VK.pipeline.depth.depth_clip_control.x8_d24_unorm_pack32_always
+dEQP-VK.pipeline.depth.depth_clip_control.x8_d24_unorm_pack32_less
+dEQP-VK.pipeline.depth.depth_clip_control.d32_sfloat_always
+dEQP-VK.pipeline.depth.depth_clip_control.d32_sfloat_less
+dEQP-VK.pipeline.depth.depth_clip_control.d16_unorm_s8_uint_always
+dEQP-VK.pipeline.depth.depth_clip_control.d16_unorm_s8_uint_less
+dEQP-VK.pipeline.depth.depth_clip_control.d24_unorm_s8_uint_always
+dEQP-VK.pipeline.depth.depth_clip_control.d24_unorm_s8_uint_less
+dEQP-VK.pipeline.depth.depth_clip_control.d32_sfloat_s8_uint_always
+dEQP-VK.pipeline.depth.depth_clip_control.d32_sfloat_s8_uint_less
 dEQP-VK.pipeline.dynamic_offset.graphics.single_set.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_1.numnondynamicbindings_0
 dEQP-VK.pipeline.dynamic_offset.graphics.single_set.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_1.numnondynamicbindings_1
 dEQP-VK.pipeline.dynamic_offset.graphics.single_set.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_2.numnondynamicbindings_0
index 28ddae1..40ec423 100644 (file)
@@ -1973,6 +1973,9 @@ dEQP-VK.transform_feedback.simple.host_query_reset_triangle_strip_with_adjacency
 dEQP-VK.transform_feedback.simple.query_triangle_strip_with_adjacency_14_508_64bits
 dEQP-VK.transform_feedback.simple.query_copy_triangle_strip_with_adjacency_14_508_64bits
 dEQP-VK.transform_feedback.simple.host_query_reset_triangle_strip_with_adjacency_14_508_64bits
+dEQP-VK.transform_feedback.simple.depth_clip_control_vertex
+dEQP-VK.transform_feedback.simple.depth_clip_control_geometry
+dEQP-VK.transform_feedback.simple.depth_clip_control_tese
 dEQP-VK.transform_feedback.simple.streams_1
 dEQP-VK.transform_feedback.simple.streams_3
 dEQP-VK.transform_feedback.simple.streams_6
index 6a6eea1..ff5c410 100644 (file)
@@ -669,6 +669,8 @@ enum VkStructureType
        VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT                                                     = 1000340000,
        VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT                                                                      = 1000346000,
        VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE                        = 1000351000,
+       VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT                                       = 1000355000,
+       VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT                          = 1000355001,
        VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE                                                     = 1000351002,
        VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT                       = 1000352000,
        VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT                                                        = 1000352001,
@@ -4208,6 +4210,7 @@ VK_DEFINE_PLATFORM_TYPE(CAMetalLayer,                             void*)
 #define VK_EXT_4444_FORMATS_SPEC_VERSION 1
 #define VK_NV_ACQUIRE_WINRT_DISPLAY_SPEC_VERSION 1
 #define VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION 1
+#define VK_EXT_DEPTH_CLIP_CONTROL_SPEC_VERSION 1
 #define VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION 2
 #define VK_EXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION 1
 #define VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_SPEC_VERSION 1
index 670222b..9afc37c 100644 (file)
@@ -1000,6 +1000,16 @@ if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(de
        checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures);
 }
 
+if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceDepthClipControlFeaturesEXT>()))
+{
+       static const Feature features[] =
+       {
+               FEATURE_ITEM (VkPhysicalDeviceDepthClipControlFeaturesEXT, depthClipControl),
+       };
+       auto* supportedFeatures = reinterpret_cast<const VkPhysicalDeviceDepthClipControlFeaturesEXT*>(featuresStruct);
+       checkFeatures(vkp, instance, instanceDriver, physicalDevice, 1, features, supportedFeatures, queueFamilyIndex, queueCount, queuePriority, numErrors, resultCollector, &extensionNames, emptyDeviceFeatures);
+}
+
 if (const void* featuresStruct = findStructureInChain(const_cast<const void*>(deviceFeatures2.pNext), getStructureType<VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT>()))
 {
        static const Feature features[] =
index d15caad..61221f1 100644 (file)
@@ -22,6 +22,7 @@ namespace vk
 #define VK_NV_COVERAGE_REDUCTION_MODE_EXTENSION_NAME "VK_NV_coverage_reduction_mode"
 #define VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME "VK_EXT_custom_border_color"
 #define VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME "VK_NV_dedicated_allocation_image_aliasing"
+#define VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME "VK_EXT_depth_clip_control"
 #define VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME "VK_EXT_depth_clip_enable"
 #define VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME "VK_EXT_descriptor_indexing"
 #define VK_NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NV_device_generated_commands"
@@ -279,6 +280,7 @@ template<> void initFeatureFromBlob<VkPhysicalDeviceFragmentDensityMap2FeaturesE
 template<> void initFeatureFromBlob<VkPhysicalDeviceImageRobustnessFeaturesEXT>(VkPhysicalDeviceImageRobustnessFeaturesEXT&, const AllFeaturesBlobs&) {}
 template<> void initFeatureFromBlob<VkPhysicalDevice4444FormatsFeaturesEXT>(VkPhysicalDevice4444FormatsFeaturesEXT&, const AllFeaturesBlobs&) {}
 template<> void initFeatureFromBlob<VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE>(VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE&, const AllFeaturesBlobs&) {}
+template<> void initFeatureFromBlob<VkPhysicalDeviceDepthClipControlFeaturesEXT>(VkPhysicalDeviceDepthClipControlFeaturesEXT&, const AllFeaturesBlobs&) {}
 template<> void initFeatureFromBlob<VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT>(VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT&, const AllFeaturesBlobs&) {}
 template<> void initFeatureFromBlob<VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT>(VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT&, const AllFeaturesBlobs&) {}
 template<> void initFeatureFromBlob<VkPhysicalDeviceSubpassShadingFeaturesHUAWEI>(VkPhysicalDeviceSubpassShadingFeaturesHUAWEI&, const AllFeaturesBlobs&) {}
@@ -295,23 +297,24 @@ template<> void initFeatureFromBlob<VkPhysicalDeviceRayQueryFeaturesKHR>(VkPhysi
 template<> void initFeatureFromBlob<VkPhysicalDevicePortabilitySubsetFeaturesKHR>(VkPhysicalDevicePortabilitySubsetFeaturesKHR&, const AllFeaturesBlobs&) {}
 
 
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDevice16BitStorageFeatures>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, VK_KHR_16BIT_STORAGE_EXTENSION_NAME, VK_KHR_16BIT_STORAGE_SPEC_VERSION, 97}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDevice4444FormatsFeaturesEXT>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT, VK_EXT_4444_FORMATS_EXTENSION_NAME, VK_EXT_4444_FORMATS_SPEC_VERSION, 96}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDevice8BitStorageFeatures>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES, VK_KHR_8BIT_STORAGE_EXTENSION_NAME, VK_KHR_8BIT_STORAGE_SPEC_VERSION, 95}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceAccelerationStructureFeaturesKHR>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR, VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME, VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION, 94}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceASTCDecodeFeaturesEXT>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT, VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME, VK_EXT_ASTC_DECODE_MODE_SPEC_VERSION, 93}; }
-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, 92}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceBufferDeviceAddressFeatures>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES, VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME, VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSION, 91}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceBufferDeviceAddressFeaturesEXT>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT, VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME, VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION, 90}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceCoherentMemoryFeaturesAMD>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD, DECL_AMD_COHERENT_MEMORY_EXTENSION_NAME, 0, 89}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceColorWriteEnableFeaturesEXT>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT, VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME, VK_EXT_COLOR_WRITE_ENABLE_SPEC_VERSION, 88}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceComputeShaderDerivativesFeaturesNV>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV, VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME, VK_NV_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION, 87}; }
-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, 86}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceCooperativeMatrixFeaturesNV>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV, VK_NV_COOPERATIVE_MATRIX_EXTENSION_NAME, VK_NV_COOPERATIVE_MATRIX_SPEC_VERSION, 85}; }
-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, 84}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceCoverageReductionModeFeaturesNV>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV, VK_NV_COVERAGE_REDUCTION_MODE_EXTENSION_NAME, VK_NV_COVERAGE_REDUCTION_MODE_SPEC_VERSION, 83}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceCustomBorderColorFeaturesEXT>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT, VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, VK_EXT_CUSTOM_BORDER_COLOR_SPEC_VERSION, 82}; }
-template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV, VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME, VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION, 81}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDevice16BitStorageFeatures>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, VK_KHR_16BIT_STORAGE_EXTENSION_NAME, VK_KHR_16BIT_STORAGE_SPEC_VERSION, 98}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDevice4444FormatsFeaturesEXT>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT, VK_EXT_4444_FORMATS_EXTENSION_NAME, VK_EXT_4444_FORMATS_SPEC_VERSION, 97}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDevice8BitStorageFeatures>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES, VK_KHR_8BIT_STORAGE_EXTENSION_NAME, VK_KHR_8BIT_STORAGE_SPEC_VERSION, 96}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceAccelerationStructureFeaturesKHR>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR, VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME, VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION, 95}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceASTCDecodeFeaturesEXT>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT, VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME, VK_EXT_ASTC_DECODE_MODE_SPEC_VERSION, 94}; }
+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, 93}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceBufferDeviceAddressFeatures>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES, VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME, VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSION, 92}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceBufferDeviceAddressFeaturesEXT>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT, VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME, VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION, 91}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceCoherentMemoryFeaturesAMD>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD, DECL_AMD_COHERENT_MEMORY_EXTENSION_NAME, 0, 90}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceColorWriteEnableFeaturesEXT>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT, VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME, VK_EXT_COLOR_WRITE_ENABLE_SPEC_VERSION, 89}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceComputeShaderDerivativesFeaturesNV>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV, VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME, VK_NV_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION, 88}; }
+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, 87}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceCooperativeMatrixFeaturesNV>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV, VK_NV_COOPERATIVE_MATRIX_EXTENSION_NAME, VK_NV_COOPERATIVE_MATRIX_SPEC_VERSION, 86}; }
+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, 85}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceCoverageReductionModeFeaturesNV>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV, VK_NV_COVERAGE_REDUCTION_MODE_EXTENSION_NAME, VK_NV_COVERAGE_REDUCTION_MODE_SPEC_VERSION, 84}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceCustomBorderColorFeaturesEXT>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT, VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, VK_EXT_CUSTOM_BORDER_COLOR_SPEC_VERSION, 83}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV, VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME, VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION, 82}; }
+template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceDepthClipControlFeaturesEXT>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT, VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME, VK_EXT_DEPTH_CLIP_CONTROL_SPEC_VERSION, 81}; }
 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, 80}; }
 template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceDescriptorIndexingFeatures>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES, VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION, 79}; }
 template<> FeatureDesc makeFeatureDesc<VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV>(void) { return FeatureDesc{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV, VK_NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME, VK_NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION, 78}; }
@@ -413,6 +416,7 @@ static const FeatureStructCreationData featureStructCreationArray[] =
        { createFeatureStructWrapper<VkPhysicalDeviceCoverageReductionModeFeaturesNV>, VK_NV_COVERAGE_REDUCTION_MODE_EXTENSION_NAME, VK_NV_COVERAGE_REDUCTION_MODE_SPEC_VERSION },
        { createFeatureStructWrapper<VkPhysicalDeviceCustomBorderColorFeaturesEXT>, VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, VK_EXT_CUSTOM_BORDER_COLOR_SPEC_VERSION },
        { createFeatureStructWrapper<VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV>, VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME, VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION },
+       { createFeatureStructWrapper<VkPhysicalDeviceDepthClipControlFeaturesEXT>, VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME, VK_EXT_DEPTH_CLIP_CONTROL_SPEC_VERSION },
        { createFeatureStructWrapper<VkPhysicalDeviceDepthClipEnableFeaturesEXT>, VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME, VK_EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION },
        { createFeatureStructWrapper<VkPhysicalDeviceDescriptorIndexingFeatures>, VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION },
        { createFeatureStructWrapper<VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV>, VK_NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME, VK_NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION },
index 604cde9..ba1b4ab 100644 (file)
@@ -18,6 +18,7 @@ const vk::VkPhysicalDeviceCornerSampledImageFeaturesNV&                                       getCornerSampledImag
 const vk::VkPhysicalDeviceCoverageReductionModeFeaturesNV&                             getCoverageReductionModeFeatures                                (void) const;
 const vk::VkPhysicalDeviceCustomBorderColorFeaturesEXT&                                        getCustomBorderColorFeaturesEXT                                 (void) const;
 const vk::VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV&  getDedicatedAllocationImageAliasingFeatures             (void) const;
+const vk::VkPhysicalDeviceDepthClipControlFeaturesEXT&                                 getDepthClipControlFeaturesEXT                                  (void) const;
 const vk::VkPhysicalDeviceDepthClipEnableFeaturesEXT&                                  getDepthClipEnableFeaturesEXT                                   (void) const;
 const vk::VkPhysicalDeviceDescriptorIndexingFeatures&                                  getDescriptorIndexingFeatures                                   (void) const;
 const vk::VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV&                   getDeviceGeneratedCommandsFeatures                              (void) const;
index 08805bc..358240e 100644 (file)
@@ -18,6 +18,7 @@ const vk::VkPhysicalDeviceCornerSampledImageFeaturesNV&                                       Context::getCornerSa
 const vk::VkPhysicalDeviceCoverageReductionModeFeaturesNV&                             Context::getCoverageReductionModeFeatures                               (void) const { return m_device->getCoverageReductionModeFeatures();                             }
 const vk::VkPhysicalDeviceCustomBorderColorFeaturesEXT&                                        Context::getCustomBorderColorFeaturesEXT                                (void) const { return m_device->getCustomBorderColorFeaturesEXT();                              }
 const vk::VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV&  Context::getDedicatedAllocationImageAliasingFeatures    (void) const { return m_device->getDedicatedAllocationImageAliasingFeatures();  }
+const vk::VkPhysicalDeviceDepthClipControlFeaturesEXT&                                 Context::getDepthClipControlFeaturesEXT                                 (void) const { return m_device->getDepthClipControlFeaturesEXT();                               }
 const vk::VkPhysicalDeviceDepthClipEnableFeaturesEXT&                                  Context::getDepthClipEnableFeaturesEXT                                  (void) const { return m_device->getDepthClipEnableFeaturesEXT();                                }
 const vk::VkPhysicalDeviceDescriptorIndexingFeatures&                                  Context::getDescriptorIndexingFeatures                                  (void) const { return m_device->getDescriptorIndexingFeatures();                                }
 const vk::VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV&                   Context::getDeviceGeneratedCommandsFeatures                             (void) const { return m_device->getDeviceGeneratedCommandsFeatures();                   }
index 0150abc..8551a30 100644 (file)
@@ -18,6 +18,7 @@ const VkPhysicalDeviceCornerSampledImageFeaturesNV&                                   getCornerSampledImageFea
 const VkPhysicalDeviceCoverageReductionModeFeaturesNV&                         getCoverageReductionModeFeatures                                (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceCoverageReductionModeFeaturesNV>();                               }
 const VkPhysicalDeviceCustomBorderColorFeaturesEXT&                                    getCustomBorderColorFeaturesEXT                                 (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceCustomBorderColorFeaturesEXT>();                                  }
 const VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV&      getDedicatedAllocationImageAliasingFeatures             (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV>();    }
+const VkPhysicalDeviceDepthClipControlFeaturesEXT&                                     getDepthClipControlFeaturesEXT                                  (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceDepthClipControlFeaturesEXT>();                                   }
 const VkPhysicalDeviceDepthClipEnableFeaturesEXT&                                      getDepthClipEnableFeaturesEXT                                   (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceDepthClipEnableFeaturesEXT>();                                    }
 const VkPhysicalDeviceDescriptorIndexingFeatures&                                      getDescriptorIndexingFeatures                                   (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceDescriptorIndexingFeatures>();                                    }
 const VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV&                       getDeviceGeneratedCommandsFeatures                              (void) const { return m_deviceFeatures.getFeatureType<VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV>();                             }
index 1532802..e1b3c91 100644 (file)
@@ -901,6 +901,10 @@ void getInstanceExtensionFunctions (uint32_t apiVersion, ::std::string extName,
        {
                return;
        }
+       if (extName == "VK_EXT_depth_clip_control")
+       {
+               return;
+       }
        if (extName == "VK_EXT_vertex_input_dynamic_state")
        {
                return;
@@ -2128,6 +2132,10 @@ void getDeviceExtensionFunctions (uint32_t apiVersion, ::std::string extName, ::
        {
                return;
        }
+       if (extName == "VK_EXT_depth_clip_control")
+       {
+               return;
+       }
        if (extName == "VK_EXT_vertex_input_dynamic_state")
        {
                functions.push_back("vkCmdSetVertexInputEXT");
index a07788d..eb81726 100644 (file)
@@ -2211,6 +2211,16 @@ template<> VkStructureType getStructureType<VkMutableDescriptorTypeCreateInfoVAL
        return VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE;
 }
 
+template<> VkStructureType getStructureType<VkPhysicalDeviceDepthClipControlFeaturesEXT> (void)
+{
+       return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT;
+}
+
+template<> VkStructureType getStructureType<VkPipelineViewportDepthClipControlCreateInfoEXT> (void)
+{
+       return VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT;
+}
+
 template<> VkStructureType getStructureType<VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT> (void)
 {
        return VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT;
index 08aa888..e97558a 100644 (file)
@@ -86,6 +86,16 @@ bool checkMandatoryFeatures(const vkt::Context& context)
                nextPtr  = &physicalDeviceConditionalRenderingFeaturesEXT.pNext;
        }
 
+       vk::VkPhysicalDeviceDepthClipControlFeaturesEXT physicalDeviceDepthClipControlFeaturesEXT;
+       deMemset(&physicalDeviceDepthClipControlFeaturesEXT, 0, sizeof(physicalDeviceDepthClipControlFeaturesEXT));
+
+       if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_depth_clip_control")) )
+       {
+               physicalDeviceDepthClipControlFeaturesEXT.sType = getStructureType<VkPhysicalDeviceDepthClipControlFeaturesEXT>();
+               *nextPtr = &physicalDeviceDepthClipControlFeaturesEXT;
+               nextPtr  = &physicalDeviceDepthClipControlFeaturesEXT.pNext;
+       }
+
        vk::VkPhysicalDeviceDepthClipEnableFeaturesEXT physicalDeviceDepthClipEnableFeaturesEXT;
        deMemset(&physicalDeviceDepthClipEnableFeaturesEXT, 0, sizeof(physicalDeviceDepthClipEnableFeaturesEXT));
 
@@ -1824,6 +1834,15 @@ bool checkMandatoryFeatures(const vkt::Context& context)
                }
        }
 
+       if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_depth_clip_control")) )
+       {
+               if ( physicalDeviceDepthClipControlFeaturesEXT.depthClipControl == VK_FALSE )
+               {
+                       log << tcu::TestLog::Message << "Mandatory feature depthClipControl not supported" << tcu::TestLog::EndMessage;
+                       result = false;
+               }
+       }
+
        if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_global_priority_query")) )
        {
                if ( physicalDeviceGlobalPriorityQueryFeaturesEXT.globalPriorityQuery == VK_FALSE )
index f178c12..de94283 100644 (file)
@@ -84,10 +84,88 @@ Move<VkPipeline> makeGraphicsPipeline(const DeviceInterface&                                                vk,
                                                                          const VkPipelineMultisampleStateCreateInfo*   multisampleStateCreateInfo,
                                                                          const VkPipelineDepthStencilStateCreateInfo*  depthStencilStateCreateInfo,
                                                                          const VkPipelineColorBlendStateCreateInfo*    colorBlendStateCreateInfo,
-                                                                         const VkPipelineDynamicStateCreateInfo*               dynamicStateCreateInfo)
+                                                                         const VkPipelineDynamicStateCreateInfo*               dynamicStateCreateInfo,
+                                                                         const void*                                                                   pNext)
 {
+       const VkPipelineInputAssemblyStateCreateInfo    inputAssemblyStateCreateInfo            =
+       {
+               VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,    // VkStructureType                            sType
+               DE_NULL,                                                                                                                // const void*                                pNext
+               0u,                                                                                                                             // VkPipelineInputAssemblyStateCreateFlags    flags
+               topology,                                                                                                               // VkPrimitiveTopology                        topology
+               VK_FALSE                                                                                                                // VkBool32                                   primitiveRestartEnable
+       };
+
+       const VkPipelineTessellationStateCreateInfo             tessStateCreateInfo                                     =
+       {
+               VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO,      // VkStructureType                           sType
+               DE_NULL,                                                                                                        // const void*                               pNext
+               0u,                                                                                                                     // VkPipelineTessellationStateCreateFlags    flags
+               patchControlPoints                                                                                      // deUint32                                  patchControlPoints
+       };
+
+       const VkPipelineViewportStateCreateInfo                 viewportStateCreateInfo                         =
+       {
+               VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,  // VkStructureType                             sType
+               DE_NULL,                                                                                                // const void*                                 pNext
+               (VkPipelineViewportStateCreateFlags)0,                                  // VkPipelineViewportStateCreateFlags          flags
+               viewports.empty() ? 1u : (deUint32)viewports.size(),    // deUint32                                    viewportCount
+               viewports.empty() ? DE_NULL : &viewports[0],                    // const VkViewport*                           pViewports
+               viewports.empty() ? 1u : (deUint32)scissors.size(),             // deUint32                                    scissorCount
+               scissors.empty() ? DE_NULL : &scissors[0]                               // const VkRect2D*                             pScissors
+       };
+
+       std::vector<VkDynamicState>                                             dynamicStates;
+
+       if (viewports.empty())
+               dynamicStates.push_back(VK_DYNAMIC_STATE_VIEWPORT);
+       if (scissors.empty())
+               dynamicStates.push_back(VK_DYNAMIC_STATE_SCISSOR);
+
+       const VkPipelineDynamicStateCreateInfo                  dynamicStateCreateInfoDefault           =
+       {
+               VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,   // VkStructureType                      sType
+               DE_NULL,                                                                                                // const void*                          pNext
+               0u,                                                                                                             // VkPipelineDynamicStateCreateFlags    flags
+               (deUint32)dynamicStates.size(),                                                 // deUint32                             dynamicStateCount
+               dynamicStates.empty() ? DE_NULL : &dynamicStates[0]             // const VkDynamicState*                pDynamicStates
+       };
+
+       const VkPipelineDynamicStateCreateInfo*                 dynamicStateCreateInfoDefaultPtr        = dynamicStates.empty() ? DE_NULL : &dynamicStateCreateInfoDefault;
+
+       return makeGraphicsPipeline (vk, device, pipelineLayout, vertexShaderModule, tessellationControlShaderModule,
+                                                                tessellationEvalShaderModule, geometryShaderModule, fragmentShaderModule,
+                                                                renderPass, subpass, vertexInputStateCreateInfo, &inputAssemblyStateCreateInfo,
+                                                                &tessStateCreateInfo, &viewportStateCreateInfo, rasterizationStateCreateInfo,
+                                                                multisampleStateCreateInfo, depthStencilStateCreateInfo, colorBlendStateCreateInfo,
+                                                                dynamicStateCreateInfo ? dynamicStateCreateInfo : dynamicStateCreateInfoDefaultPtr,
+                                                                pNext);
+}
+
+Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&                                                  vk,
+                                                                          const VkDevice                                                                       device,
+                                                                          const VkPipelineLayout                                                       pipelineLayout,
+                                                                          const VkShaderModule                                                         vertexShaderModule,
+                                                                          const VkShaderModule                                                         tessellationControlShaderModule,
+                                                                          const VkShaderModule                                                         tessellationEvalShaderModule,
+                                                                          const VkShaderModule                                                         geometryShaderModule,
+                                                                          const VkShaderModule                                                         fragmentShaderModule,
+                                                                          const VkRenderPass                                                           renderPass,
+                                                                          const deUint32                                                                       subpass,
+                                                                          const VkPipelineVertexInputStateCreateInfo*          vertexInputStateCreateInfo,
+                                                                          const VkPipelineInputAssemblyStateCreateInfo*        inputAssemblyStateCreateInfo,
+                                                                          const VkPipelineTessellationStateCreateInfo*         tessStateCreateInfo,
+                                                                          const VkPipelineViewportStateCreateInfo*                     viewportStateCreateInfo,
+                                                                          const VkPipelineRasterizationStateCreateInfo*        rasterizationStateCreateInfo,
+                                                                          const VkPipelineMultisampleStateCreateInfo*          multisampleStateCreateInfo,
+                                                                          const VkPipelineDepthStencilStateCreateInfo*         depthStencilStateCreateInfo,
+                                                                          const VkPipelineColorBlendStateCreateInfo*           colorBlendStateCreateInfo,
+                                                                          const VkPipelineDynamicStateCreateInfo*                      dynamicStateCreateInfo,
+                                                                          const void*                                                                          pNext)
+{
+       DE_ASSERT(tessStateCreateInfo || (tessellationControlShaderModule == DE_NULL && tessellationEvalShaderModule == DE_NULL));
+
        const VkBool32                                                                  disableRasterization                            = (fragmentShaderModule == DE_NULL);
-       const bool                                                                              hasTessellation                                         = (tessellationControlShaderModule != DE_NULL || tessellationEvalShaderModule != DE_NULL);
 
        VkPipelineShaderStageCreateInfo                                 stageCreateInfo                                         =
        {
@@ -162,32 +240,27 @@ Move<VkPipeline> makeGraphicsPipeline(const DeviceInterface&                                              vk,
                &vertexInputAttributeDescription                                                        // const VkVertexInputAttributeDescription*    pVertexAttributeDescriptions
        };
 
-       const VkPipelineInputAssemblyStateCreateInfo    inputAssemblyStateCreateInfo            =
+       const VkPipelineInputAssemblyStateCreateInfo    inputAssemblyStateCreateInfoDefault     =
        {
                VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,    // VkStructureType                            sType
                DE_NULL,                                                                                                                // const void*                                pNext
                0u,                                                                                                                             // VkPipelineInputAssemblyStateCreateFlags    flags
-               topology,                                                                                                               // VkPrimitiveTopology                        topology
+               VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,                                                    // VkPrimitiveTopology                        topology
                VK_FALSE                                                                                                                // VkBool32                                   primitiveRestartEnable
        };
 
-       const VkPipelineTessellationStateCreateInfo             tessStateCreateInfo                                     =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO,      // VkStructureType                           sType
-               DE_NULL,                                                                                                        // const void*                               pNext
-               0u,                                                                                                                     // VkPipelineTessellationStateCreateFlags    flags
-               patchControlPoints                                                                                      // deUint32                                  patchControlPoints
-       };
+       const VkViewport                                                                viewport                                                        = makeViewport(256, 256);
+       const VkRect2D                                                                  scissor                                                         = makeRect2D(256, 256);
 
-       const VkPipelineViewportStateCreateInfo                 viewportStateCreateInfo                         =
+       const VkPipelineViewportStateCreateInfo                 viewportStateCreateInfoDefault          =
        {
                VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,  // VkStructureType                             sType
                DE_NULL,                                                                                                // const void*                                 pNext
                (VkPipelineViewportStateCreateFlags)0,                                  // VkPipelineViewportStateCreateFlags          flags
-               viewports.empty() ? 1u : (deUint32)viewports.size(),    // deUint32                                    viewportCount
-               viewports.empty() ? DE_NULL : &viewports[0],                    // const VkViewport*                           pViewports
-               viewports.empty() ? 1u : (deUint32)scissors.size(),             // deUint32                                    scissorCount
-               scissors.empty() ? DE_NULL : &scissors[0]                               // const VkRect2D*                             pScissors
+               1u,                                                                                                             // deUint32                                    viewportCount
+               &viewport,                                                                                              // const VkViewport*                           pViewports
+               1u,                                                                                                             // deUint32                                    scissorCount
+               &scissor                                                                                                // const VkRect2D*                             pScissors
        };
 
        const VkPipelineRasterizationStateCreateInfo    rasterizationStateCreateInfoDefault     =
@@ -274,40 +347,22 @@ Move<VkPipeline> makeGraphicsPipeline(const DeviceInterface&                                              vk,
                { 0.0f, 0.0f, 0.0f, 0.0f }                                                                      // float                                         blendConstants[4]
        };
 
-       std::vector<VkDynamicState>                                             dynamicStates;
-
-       if (viewports.empty())
-               dynamicStates.push_back(VK_DYNAMIC_STATE_VIEWPORT);
-       if (scissors.empty())
-               dynamicStates.push_back(VK_DYNAMIC_STATE_SCISSOR);
-
-       const VkPipelineDynamicStateCreateInfo                  dynamicStateCreateInfoDefault           =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,   // VkStructureType                      sType
-               DE_NULL,                                                                                                // const void*                          pNext
-               0u,                                                                                                             // VkPipelineDynamicStateCreateFlags    flags
-               (deUint32)dynamicStates.size(),                                                 // deUint32                             dynamicStateCount
-               dynamicStates.empty() ? DE_NULL : &dynamicStates[0]             // const VkDynamicState*                pDynamicStates
-       };
-
-       const VkPipelineDynamicStateCreateInfo*                 dynamicStateCreateInfoDefaultPtr        = dynamicStates.empty() ? DE_NULL : &dynamicStateCreateInfoDefault;
-
        const VkGraphicsPipelineCreateInfo                              pipelineCreateInfo                                      =
        {
                VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,                                                                                                                // VkStructureType                                  sType
-               DE_NULL,                                                                                                                                                                                                // const void*                                      pNext
+               pNext,                                                                                                                                                                                                  // const void*                                      pNext
                0u,                                                                                                                                                                                                             // VkPipelineCreateFlags                            flags
                (deUint32)pipelineShaderStageParams.size(),                                                                                                                             // deUint32                                         stageCount
                &pipelineShaderStageParams[0],                                                                                                                                                  // const VkPipelineShaderStageCreateInfo*           pStages
                vertexInputStateCreateInfo ? vertexInputStateCreateInfo : &vertexInputStateCreateInfoDefault,                   // const VkPipelineVertexInputStateCreateInfo*      pVertexInputState
-               &inputAssemblyStateCreateInfo,                                                                                                                                                  // const VkPipelineInputAssemblyStateCreateInfo*    pInputAssemblyState
-               hasTessellation ? &tessStateCreateInfo : DE_NULL,                                                                                                               // const VkPipelineTessellationStateCreateInfo*     pTessellationState
-               &viewportStateCreateInfo,                                                                                                                                                               // const VkPipelineViewportStateCreateInfo*         pViewportState
+               inputAssemblyStateCreateInfo ? inputAssemblyStateCreateInfo : &inputAssemblyStateCreateInfoDefault,             // const VkPipelineInputAssemblyStateCreateInfo*    pInputAssemblyState
+               tessStateCreateInfo,                                                                                                                                                                    // const VkPipelineTessellationStateCreateInfo*     pTessellationState
+               viewportStateCreateInfo ? viewportStateCreateInfo : &viewportStateCreateInfoDefault,                                    // const VkPipelineViewportStateCreateInfo*         pViewportState
                rasterizationStateCreateInfo ? rasterizationStateCreateInfo : &rasterizationStateCreateInfoDefault,             // const VkPipelineRasterizationStateCreateInfo*    pRasterizationState
                multisampleStateCreateInfo ? multisampleStateCreateInfo: &multisampleStateCreateInfoDefault,                    // const VkPipelineMultisampleStateCreateInfo*      pMultisampleState
                depthStencilStateCreateInfo ? depthStencilStateCreateInfo : &depthStencilStateCreateInfoDefault,                // const VkPipelineDepthStencilStateCreateInfo*     pDepthStencilState
                colorBlendStateCreateInfo ? colorBlendStateCreateInfo : &colorBlendStateCreateInfoDefault,                              // const VkPipelineColorBlendStateCreateInfo*       pColorBlendState
-               dynamicStateCreateInfo ? dynamicStateCreateInfo : dynamicStateCreateInfoDefaultPtr,                                             // const VkPipelineDynamicStateCreateInfo*          pDynamicState
+               dynamicStateCreateInfo ? dynamicStateCreateInfo : DE_NULL,                                                                                              // const VkPipelineDynamicStateCreateInfo*          pDynamicState
                pipelineLayout,                                                                                                                                                                                 // VkPipelineLayout                                 layout
                renderPass,                                                                                                                                                                                             // VkRenderPass                                     renderPass
                subpass,                                                                                                                                                                                                // deUint32                                         subpass
@@ -318,99 +373,6 @@ Move<VkPipeline> makeGraphicsPipeline(const DeviceInterface&                                               vk,
        return createGraphicsPipeline(vk, device, DE_NULL, &pipelineCreateInfo);
 }
 
-Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&                                                  vk,
-                                                                          const VkDevice                                                                       device,
-                                                                          const VkPipelineLayout                                                       pipelineLayout,
-                                                                          const VkShaderModule                                                         vertexShaderModule,
-                                                                          const VkShaderModule                                                         tessellationControlShaderModule,
-                                                                          const VkShaderModule                                                         tessellationEvalShaderModule,
-                                                                          const VkShaderModule                                                         geometryShaderModule,
-                                                                          const VkShaderModule                                                         fragmentShaderModule,
-                                                                          const VkRenderPass                                                           renderPass,
-                                                                          const deUint32                                                                       subpass,
-                                                                          const VkPipelineVertexInputStateCreateInfo*          vertexInputStateCreateInfo,
-                                                                          const VkPipelineInputAssemblyStateCreateInfo*        inputAssemblyStateCreateInfo,
-                                                                          const VkPipelineTessellationStateCreateInfo*         tessStateCreateInfo,
-                                                                          const VkPipelineViewportStateCreateInfo*                     viewportStateCreateInfo,
-                                                                          const VkPipelineRasterizationStateCreateInfo*        rasterizationStateCreateInfo,
-                                                                          const VkPipelineMultisampleStateCreateInfo*          multisampleStateCreateInfo,
-                                                                          const VkPipelineDepthStencilStateCreateInfo*         depthStencilStateCreateInfo,
-                                                                          const VkPipelineColorBlendStateCreateInfo*           colorBlendStateCreateInfo,
-                                                                          const VkPipelineDynamicStateCreateInfo*                      dynamicStateCreateInfo)
-{
-       VkPipelineShaderStageCreateInfo                                 stageCreateInfo         =
-       {
-               VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,    // VkStructureType                     sType
-               DE_NULL,                                                                                                // const void*                         pNext
-               0u,                                                                                                             // VkPipelineShaderStageCreateFlags    flags
-               VK_SHADER_STAGE_VERTEX_BIT,                                                             // VkShaderStageFlagBits               stage
-               DE_NULL,                                                                                                // VkShaderModule                      module
-               "main",                                                                                                 // const char*                         pName
-               DE_NULL                                                                                                 // const VkSpecializationInfo*         pSpecializationInfo
-       };
-
-       std::vector<VkPipelineShaderStageCreateInfo>    pipelineShaderStageParams;
-
-       {
-               stageCreateInfo.stage   = VK_SHADER_STAGE_VERTEX_BIT;
-               stageCreateInfo.module  = vertexShaderModule;
-               pipelineShaderStageParams.push_back(stageCreateInfo);
-       }
-
-       if (tessellationControlShaderModule != DE_NULL)
-       {
-               stageCreateInfo.stage   = VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
-               stageCreateInfo.module  = tessellationControlShaderModule;
-               pipelineShaderStageParams.push_back(stageCreateInfo);
-       }
-
-       if (tessellationEvalShaderModule != DE_NULL)
-       {
-               stageCreateInfo.stage   = VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT;
-               stageCreateInfo.module  = tessellationEvalShaderModule;
-               pipelineShaderStageParams.push_back(stageCreateInfo);
-       }
-
-       if (geometryShaderModule != DE_NULL)
-       {
-               stageCreateInfo.stage   = VK_SHADER_STAGE_GEOMETRY_BIT;
-               stageCreateInfo.module  = geometryShaderModule;
-               pipelineShaderStageParams.push_back(stageCreateInfo);
-       }
-
-       if (fragmentShaderModule != DE_NULL)
-       {
-               stageCreateInfo.stage   = VK_SHADER_STAGE_FRAGMENT_BIT;
-               stageCreateInfo.module  = fragmentShaderModule;
-               pipelineShaderStageParams.push_back(stageCreateInfo);
-       }
-
-       const VkGraphicsPipelineCreateInfo                              pipelineCreateInfo      =
-       {
-               VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,        // VkStructureType                                  sType
-               DE_NULL,                                                                                        // const void*                                      pNext
-               0u,                                                                                                     // VkPipelineCreateFlags                            flags
-               (deUint32)pipelineShaderStageParams.size(),                     // deUint32                                         stageCount
-               &pipelineShaderStageParams[0],                                          // const VkPipelineShaderStageCreateInfo*           pStages
-               vertexInputStateCreateInfo,                                                     // const VkPipelineVertexInputStateCreateInfo*      pVertexInputState
-               inputAssemblyStateCreateInfo,                                           // const VkPipelineInputAssemblyStateCreateInfo*    pInputAssemblyState
-               tessStateCreateInfo,                                                            // const VkPipelineTessellationStateCreateInfo*     pTessellationState
-               viewportStateCreateInfo,                                                        // const VkPipelineViewportStateCreateInfo*         pViewportState
-               rasterizationStateCreateInfo,                                           // const VkPipelineRasterizationStateCreateInfo*    pRasterizationState
-               multisampleStateCreateInfo,                                                     // const VkPipelineMultisampleStateCreateInfo*      pMultisampleState
-               depthStencilStateCreateInfo,                                            // const VkPipelineDepthStencilStateCreateInfo*     pDepthStencilState
-               colorBlendStateCreateInfo,                                                      // const VkPipelineColorBlendStateCreateInfo*       pColorBlendState
-               dynamicStateCreateInfo,                                                         // const VkPipelineDynamicStateCreateInfo*          pDynamicState
-               pipelineLayout,                                                                         // VkPipelineLayout                                 layout
-               renderPass,                                                                                     // VkRenderPass                                     renderPass
-               subpass,                                                                                        // deUint32                                         subpass
-               DE_NULL,                                                                                        // VkPipeline                                       basePipelineHandle
-               0                                                                                                       // deInt32                                          basePipelineIndex;
-       };
-
-       return createGraphicsPipeline(vk, device, DE_NULL, &pipelineCreateInfo);
-}
-
 Move<VkRenderPass> makeRenderPass (const DeviceInterface&                              vk,
                                                                   const VkDevice                                               device,
                                                                   const VkFormat                                               colorFormat,
index 19b51ef..da70e2d 100644 (file)
@@ -56,7 +56,8 @@ Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&                                                 vk,
                                                                           const VkPipelineMultisampleStateCreateInfo*          multisampleStateCreateInfo = DE_NULL,
                                                                           const VkPipelineDepthStencilStateCreateInfo*         depthStencilStateCreateInfo = DE_NULL,
                                                                           const VkPipelineColorBlendStateCreateInfo*           colorBlendStateCreateInfo = DE_NULL,
-                                                                          const VkPipelineDynamicStateCreateInfo*                      dynamicStateCreateInfo = DE_NULL);
+                                                                          const VkPipelineDynamicStateCreateInfo*                      dynamicStateCreateInfo = DE_NULL,
+                                                                          const void*                                                                          pNext = DE_NULL);
 
 Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&                                                  vk,
                                                                           const VkDevice                                                                       device,
@@ -76,7 +77,8 @@ Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&                                                 vk,
                                                                           const VkPipelineMultisampleStateCreateInfo*          multisampleStateCreateInfo = DE_NULL,
                                                                           const VkPipelineDepthStencilStateCreateInfo*         depthStencilStateCreateInfo = DE_NULL,
                                                                           const VkPipelineColorBlendStateCreateInfo*           colorBlendStateCreateInfo = DE_NULL,
-                                                                          const VkPipelineDynamicStateCreateInfo*                      dynamicStateCreateInfo = DE_NULL);
+                                                                          const VkPipelineDynamicStateCreateInfo*                      dynamicStateCreateInfo = DE_NULL,
+                                                                          const void*                                                                          pNext = DE_NULL);
 
 Move<VkRenderPass> makeRenderPass (const DeviceInterface&                              vk,
                                                                   const VkDevice                                               device,
index 58d86a6..5b1833f 100644 (file)
@@ -1060,6 +1060,8 @@ std::ostream&     operator<<      (std::ostream& s, const VkPhysicalDevice4444FormatsFeat
 std::ostream&  operator<<      (std::ostream& s, const VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE& value);
 std::ostream&  operator<<      (std::ostream& s, const VkMutableDescriptorTypeListVALVE& value);
 std::ostream&  operator<<      (std::ostream& s, const VkMutableDescriptorTypeCreateInfoVALVE& value);
+std::ostream&  operator<<      (std::ostream& s, const VkPhysicalDeviceDepthClipControlFeaturesEXT& value);
+std::ostream&  operator<<      (std::ostream& s, const VkPipelineViewportDepthClipControlCreateInfoEXT& value);
 std::ostream&  operator<<      (std::ostream& s, const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT& value);
 std::ostream&  operator<<      (std::ostream& s, const VkVertexInputBindingDescription2EXT& value);
 std::ostream&  operator<<      (std::ostream& s, const VkVertexInputAttributeDescription2EXT& value);
index 20d061a..06d64c5 100644 (file)
@@ -670,6 +670,8 @@ const char* getStructureTypeName (VkStructureType value)
                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT:                                                       return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT";
                case VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT:                                                                        return "VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT";
                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE:                          return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE";
+               case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT:                                         return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT";
+               case VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT:                            return "VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT";
                case VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE:                                                       return "VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE";
                case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT:                         return "VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT";
                case VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT:                                                          return "VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT";
@@ -11384,6 +11386,26 @@ std::ostream& operator<< (std::ostream& s, const VkMutableDescriptorTypeCreateIn
        return s;
 }
 
+std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceDepthClipControlFeaturesEXT& value)
+{
+       s << "VkPhysicalDeviceDepthClipControlFeaturesEXT = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\tdepthClipControl = " << value.depthClipControl << '\n';
+       s << '}';
+       return s;
+}
+
+std::ostream& operator<< (std::ostream& s, const VkPipelineViewportDepthClipControlCreateInfoEXT& value)
+{
+       s << "VkPipelineViewportDepthClipControlCreateInfoEXT = {\n";
+       s << "\tsType = " << value.sType << '\n';
+       s << "\tpNext = " << value.pNext << '\n';
+       s << "\tnegativeOneToOne = " << value.negativeOneToOne << '\n';
+       s << '}';
+       return s;
+}
+
 std::ostream& operator<< (std::ostream& s, const VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT& value)
 {
        s << "VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT = {\n";
index 8c0cda0..3dc4d1a 100644 (file)
@@ -5273,6 +5273,20 @@ struct VkMutableDescriptorTypeCreateInfoVALVE
        const VkMutableDescriptorTypeListVALVE* pMutableDescriptorTypeLists;
 };
 
+struct VkPhysicalDeviceDepthClipControlFeaturesEXT
+{
+       VkStructureType sType;
+       void*                   pNext;
+       VkBool32                depthClipControl;
+};
+
+struct VkPipelineViewportDepthClipControlCreateInfoEXT
+{
+       VkStructureType sType;
+       const void*             pNext;
+       VkBool32                negativeOneToOne;
+};
+
 struct VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT
 {
        VkStructureType sType;
index eae7df4..ce35138 100644 (file)
@@ -1725,6 +1725,8 @@ typedef enum VkStructureType {
     VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT = 1000340000,
     VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT = 1000346000,
     VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE = 1000351000,
+    VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT = 1000355000,
+    VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT = 1000355001,
     VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE = 1000351002,
     VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT = 1000352000,
     VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT = 1000352001,
@@ -13349,6 +13351,23 @@ typedef struct VkMutableDescriptorTypeCreateInfoVALVE {
 
 
 
+#define VK_EXT_depth_clip_control 1
+#define VK_EXT_DEPTH_CLIP_CONTROL_SPEC_VERSION 1
+#define VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME "VK_EXT_depth_clip_control"
+typedef struct VkPhysicalDeviceDepthClipControlFeaturesEXT {
+        VkStructureType    sType;
+            void*              pNext;
+                VkBool32           depthClipControl;
+} VkPhysicalDeviceDepthClipControlFeaturesEXT;
+
+typedef struct VkPipelineViewportDepthClipControlCreateInfoEXT {
+        VkStructureType    sType;
+            const void*        pNext;
+                VkBool32           negativeOneToOne;
+} VkPipelineViewportDepthClipControlCreateInfoEXT;
+
+
+
 #define VK_EXT_vertex_input_dynamic_state 1
 #define VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION 2
 #define VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME "VK_EXT_vertex_input_dynamic_state"
index 29f01cf..f782c9b 100644 (file)
@@ -113,6 +113,7 @@ public:
        };
 
        static const float                                      quadDepths[QUAD_COUNT];
+       static const float                                      quadDepthsMinusOneToOne[QUAD_COUNT];
 
                                                                                DepthTest                               (tcu::TestContext&              testContext,
                                                                                                                                 const std::string&             name,
@@ -125,7 +126,8 @@ public:
                                                                                                                                 const float                    depthBoundsMax                                  = 1.0f,
                                                                                                                                 const bool                             depthTestEnable                                 = true,
                                                                                                                                 const bool                             stencilTestEnable                               = false,
-                                                                                                                                const bool                             colorAttachmentEnable                   = true);
+                                                                                                                                const bool                             colorAttachmentEnable                   = true,
+                                                                                                                                const bool                             depthClipControl                                = false);
        virtual                                                         ~DepthTest                              (void);
        virtual void                                            initPrograms                    (SourceCollections& programCollection) const;
        virtual void                                            checkSupport                    (Context& context) const;
@@ -140,6 +142,7 @@ private:
        const bool                                                      m_depthTestEnable;
        const bool                                                      m_stencilTestEnable;
        const bool                                                      m_colorAttachmentEnable;
+       const bool                                                      m_depthClipControl;
        VkCompareOp                                                     m_depthCompareOps[QUAD_COUNT];
 };
 
@@ -155,7 +158,8 @@ public:
                                                                                                                                 const float            depthBoundsMax,
                                                                                                                                 const bool                     depthTestEnable,
                                                                                                                                 const bool                     stencilTestEnable,
-                                                                                                                                const bool                     colorAttachmentEnable);
+                                                                                                                                const bool                     colorAttachmentEnable,
+                                                                                                                                const bool                     depthClipControl);
        virtual                                                         ~DepthTestInstance              (void);
        virtual tcu::TestStatus                         iterate                                 (void);
 
@@ -174,6 +178,7 @@ private:
        const bool                                                      m_depthTestEnable;
        const bool                                                      m_stencilTestEnable;
        const bool                                                      m_colorAttachmentEnable;
+       const bool                                                      m_depthClipControl;
        VkImageSubresourceRange                         m_depthImageSubresourceRange;
 
        Move<VkImage>                                           m_colorImage;
@@ -207,6 +212,15 @@ const float DepthTest::quadDepths[QUAD_COUNT] =
        0.2f
 };
 
+// Depth values suitable for the depth range of -1..1.
+const float DepthTest::quadDepthsMinusOneToOne[QUAD_COUNT] =
+{
+       -0.8f,
+       -1.0f,
+        0.6f,
+        0.2f
+};
+
 DepthTest::DepthTest (tcu::TestContext&                testContext,
                                          const std::string&    name,
                                          const std::string&    description,
@@ -218,7 +232,8 @@ DepthTest::DepthTest (tcu::TestContext&             testContext,
                                          const float                   depthBoundsMax,
                                          const bool                    depthTestEnable,
                                          const bool                    stencilTestEnable,
-                                         const bool                    colorAttachmentEnable)
+                                         const bool                    colorAttachmentEnable,
+                                         const bool                    depthClipControl)
        : vkt::TestCase (testContext, name, description)
        , m_depthFormat                                 (depthFormat)
        , m_separateDepthStencilLayouts (separateDepthStencilLayouts)
@@ -228,6 +243,7 @@ DepthTest::DepthTest (tcu::TestContext&             testContext,
        , m_depthTestEnable                             (depthTestEnable)
        , m_stencilTestEnable                   (stencilTestEnable)
        , m_colorAttachmentEnable               (colorAttachmentEnable)
+       , m_depthClipControl                    (depthClipControl)
 {
        deMemcpy(m_depthCompareOps, depthCompareOps, sizeof(VkCompareOp) * QUAD_COUNT);
 }
@@ -246,11 +262,14 @@ void DepthTest::checkSupport (Context& context) const
 
        if (m_separateDepthStencilLayouts && !context.isDeviceFunctionalitySupported("VK_KHR_separate_depth_stencil_layouts"))
                TCU_THROW(NotSupportedError, "VK_KHR_separate_depth_stencil_layouts is not supported");
+
+       if (m_depthClipControl && !context.isDeviceFunctionalitySupported("VK_EXT_depth_clip_control"))
+               TCU_THROW(NotSupportedError, "VK_EXT_depth_clip_control is not supported");
 }
 
 TestInstance* DepthTest::createInstance (Context& context) const
 {
-       return new DepthTestInstance(context, m_depthFormat, m_depthCompareOps, m_separateDepthStencilLayouts, m_depthBoundsTestEnable, m_depthBoundsMin, m_depthBoundsMax, m_depthTestEnable, m_stencilTestEnable, m_colorAttachmentEnable);
+       return new DepthTestInstance(context, m_depthFormat, m_depthCompareOps, m_separateDepthStencilLayouts, m_depthBoundsTestEnable, m_depthBoundsMin, m_depthBoundsMax, m_depthTestEnable, m_stencilTestEnable, m_colorAttachmentEnable, m_depthClipControl);
 }
 
 void DepthTest::initPrograms (SourceCollections& programCollection) const
@@ -288,7 +307,6 @@ void DepthTest::initPrograms (SourceCollections& programCollection) const
                        "       gl_Position = position;\n"
                        "}\n");
        }
-
 }
 
 DepthTestInstance::DepthTestInstance (Context&                         context,
@@ -300,7 +318,8 @@ DepthTestInstance::DepthTestInstance (Context&                              context,
                                                                          const float                   depthBoundsMax,
                                                                          const bool                    depthTestEnable,
                                                                          const bool                    stencilTestEnable,
-                                                                         const bool                    colorAttachmentEnable)
+                                                                         const bool                    colorAttachmentEnable,
+                                                                         const bool                    depthClipControl)
        : vkt::TestInstance                             (context)
        , m_renderSize                                  (32, 32)
        , m_colorFormat                                 (colorAttachmentEnable ? VK_FORMAT_R8G8B8A8_UNORM : VK_FORMAT_UNDEFINED)
@@ -312,6 +331,7 @@ DepthTestInstance::DepthTestInstance (Context&                              context,
        , m_depthTestEnable                             (depthTestEnable)
        , m_stencilTestEnable                   (stencilTestEnable)
        , m_colorAttachmentEnable               (colorAttachmentEnable)
+       , m_depthClipControl                    (depthClipControl)
 {
        const DeviceInterface&          vk                                              = context.getDeviceInterface();
        const VkDevice                          vkDevice                                = context.getDevice();
@@ -470,17 +490,14 @@ DepthTestInstance::DepthTestInstance (Context&                            context,
 
        // Create pipeline
        {
-               const std::vector<VkViewport>                           viewports                                                       (1, makeViewport(m_renderSize));
-               const std::vector<VkRect2D>                                     scissors                                                        (1, makeRect2D(m_renderSize));
-
-               const VkVertexInputBindingDescription           vertexInputBindingDescription           =
+               const VkVertexInputBindingDescription                           vertexInputBindingDescription           =
                {
                        0u,                                                     // deUint32                                     binding;
                        sizeof(Vertex4RGBA),            // deUint32                                     strideInBytes;
                        VK_VERTEX_INPUT_RATE_VERTEX     // VkVertexInputStepRate        inputRate;
                };
 
-               const VkVertexInputAttributeDescription         vertexInputAttributeDescriptions[2]     =
+               const VkVertexInputAttributeDescription                         vertexInputAttributeDescriptions[2]     =
                {
                        {
                                0u,                                                                     // deUint32     location;
@@ -496,7 +513,7 @@ DepthTestInstance::DepthTestInstance (Context&                              context,
                        }
                };
 
-               const VkPipelineVertexInputStateCreateInfo      vertexInputStateParams                          =
+               const VkPipelineVertexInputStateCreateInfo                      vertexInputStateParams                          =
                {
                        VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,              // VkStructureType                                                      sType;
                        DE_NULL,                                                                                                                // const void*                                                          pNext;
@@ -507,7 +524,7 @@ DepthTestInstance::DepthTestInstance (Context&                              context,
                        vertexInputAttributeDescriptions                                                                // const VkVertexInputAttributeDescription*     pVertexAttributeDescriptions;
                };
 
-               VkPipelineDepthStencilStateCreateInfo           depthStencilStateParams                         =
+               VkPipelineDepthStencilStateCreateInfo                           depthStencilStateParams                         =
                {
                        VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO,     // VkStructureType                                                      sType;
                        DE_NULL,                                                                                                        // const void*                                                          pNext;
@@ -537,12 +554,12 @@ DepthTestInstance::DepthTestInstance (Context&                            context,
                                0u,                                             // deUint32             writeMask;
                                0u,                                             // deUint32             reference;
                        },
-                       m_depthBoundsMin,                       // float                        minDepthBounds;
-                       m_depthBoundsMax,                       // float                        maxDepthBounds;
+                       m_depthBoundsMin,                                                                                       // float                                                                        minDepthBounds;
+                       m_depthBoundsMax,                                                                                       // float                                                                        maxDepthBounds;
                };
 
                // Make sure rasterization is not disabled when the fragment shader is missing.
-               const vk::VkPipelineRasterizationStateCreateInfo rasterizationStateParams =
+               const vk::VkPipelineRasterizationStateCreateInfo                rasterizationStateParams                =
                {
                        vk::VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, //      VkStructureType                                                 sType;
                        nullptr,                                                                                                                //      const void*                                                             pNext;
@@ -559,27 +576,48 @@ DepthTestInstance::DepthTestInstance (Context&                            context,
                        1.0f,                                                                                                                   //      float                                                                   lineWidth;
                };
 
+               const VkViewport                                                                                viewport                                                = makeViewport(m_renderSize);
+               const VkRect2D                                                                                  scissor                                                 = makeRect2D(m_renderSize);
+
+               const VkPipelineViewportDepthClipControlCreateInfoEXT   depthClipControlCreateInfo              =
+               {
+                       VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT, // VkStructureType      sType;
+                       DE_NULL,                                                                                                                                // const void*          pNext;
+                       VK_TRUE,                                                                                                                                // VkBool32             negativeOneToOne;
+               };
+
+               const VkPipelineViewportStateCreateInfo                                 viewportStateCreateInfo                 =
+               {
+                       VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,          // VkStructureType                                              sType;
+                       m_depthClipControl ? &depthClipControlCreateInfo : DE_NULL,     // const void*                                                  pNext;
+                       (VkPipelineViewportStateCreateFlags)0,                                          // VkPipelineViewportStateCreateFlags   flags;
+                       1u,                                                                                                                     // deUint32                                                             viewportCount;
+                       &viewport,                                                                                                      // const VkViewport*                                    pViewports;
+                       1u,                                                                                                                     // deUint32                                                             scissorCount;
+                       &scissor                                                                                                        // const VkRect2D*                                              pScissors;
+               };
+
                for (int quadNdx = 0; quadNdx < DepthTest::QUAD_COUNT; quadNdx++)
                {
                        depthStencilStateParams.depthCompareOp  = depthCompareOps[quadNdx];
-                       m_graphicsPipelines[quadNdx]                    = makeGraphicsPipeline(vk,                                                                      // const DeviceInterface&                        vk
-                                                                                                                                                  vkDevice,                                                    // const VkDevice                                device
-                                                                                                                                                  *m_pipelineLayout,                                   // const VkPipelineLayout                        pipelineLayout
-                                                                                                                                                  *m_vertexShaderModule,                               // const VkShaderModule                          vertexShaderModule
-                                                                                                                                                  DE_NULL,                                                             // const VkShaderModule                          tessellationControlModule
-                                                                                                                                                  DE_NULL,                                                             // const VkShaderModule                          tessellationEvalModule
-                                                                                                                                                  DE_NULL,                                                             // const VkShaderModule                          geometryShaderModule
-                                                                                                                                                  *m_fragmentShaderModule,                             // const VkShaderModule                          fragmentShaderModule
-                                                                                                                                                  *m_renderPass,                                               // const VkRenderPass                            renderPass
-                                                                                                                                                  viewports,                                                   // const std::vector<VkViewport>&                viewports
-                                                                                                                                                  scissors,                                                    // const std::vector<VkRect2D>&                  scissors
-                                                                                                                                                  VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, // const VkPrimitiveTopology                     topology
-                                                                                                                                                  0u,                                                                  // const deUint32                                subpass
-                                                                                                                                                  0u,                                                                  // const deUint32                                patchControlPoints
-                                                                                                                                                  &vertexInputStateParams,                             // const VkPipelineVertexInputStateCreateInfo*   vertexInputStateCreateInfo
-                                                                                                                                                  &rasterizationStateParams,                   // const VkPipelineRasterizationStateCreateInfo* rasterizationStateCreateInfo
-                                                                                                                                                  DE_NULL,                                                             // const VkPipelineMultisampleStateCreateInfo*   multisampleStateCreateInfo
-                                                                                                                                                  &depthStencilStateParams);                   // const VkPipelineDepthStencilStateCreateInfo*  depthStencilStateCreateInfo
+
+                       m_graphicsPipelines[quadNdx]                    = makeGraphicsPipeline(vk,                                                                      // const DeviceInterface&                                                       vk;
+                                                                                                                                                  vkDevice,                                                    // const VkDevice                                                                       device;
+                                                                                                                                                  *m_pipelineLayout,                                   // const VkPipelineLayout                                                       pipelineLayout;
+                                                                                                                                                  *m_vertexShaderModule,                               // const VkShaderModule                                                         vertexShaderModule;
+                                                                                                                                                  DE_NULL,                                                             // const VkShaderModule                                                         tessellationControlModule;
+                                                                                                                                                  DE_NULL,                                                             // const VkShaderModule                                                         tessellationEvalModule;
+                                                                                                                                                  DE_NULL,                                                             // const VkShaderModule                                                         geometryShaderModule;
+                                                                                                                                                  *m_fragmentShaderModule,                             // const VkShaderModule                                                         fragmentShaderModule;
+                                                                                                                                                  *m_renderPass,                                               // const VkRenderPass                                                           renderPass;
+                                                                                                                                                  0u,                                                                  // const deUint32                                                                       subpass;
+                                                                                                                                                  &vertexInputStateParams,                             // const VkPipelineVertexInputStateCreateInfo*          vertexInputStateCreateInfo;
+                                                                                                                                                  DE_NULL,                                                             // const VkPipelineInputAssemblyStateCreateInfo*        inputAssemblyStateCreateInfo;
+                                                                                                                                                  DE_NULL,                                                             // const VkPipelineTessellationStateCreateInfo*         tessStateCreateInfo;
+                                                                                                                                                  &viewportStateCreateInfo,                    // const VkPipelineViewportStateCreateInfo*                     viewportStateCreateInfo;
+                                                                                                                                                  &rasterizationStateParams,                   // const VkPipelineRasterizationStateCreateInfo*        rasterizationStateCreateInfo;
+                                                                                                                                                  DE_NULL,                                                             // const VkPipelineMultisampleStateCreateInfo*          multisampleStateCreateInfo;
+                                                                                                                                                  &depthStencilStateParams);                   // const VkPipelineDepthStencilStateCreateInfo*         depthStencilStateCreateInfo;
                }
        }
 
@@ -606,7 +644,9 @@ DepthTestInstance::DepthTestInstance (Context&                              context,
                // Adjust depths
                for (int quadNdx = 0; quadNdx < DepthTest::QUAD_COUNT; quadNdx++)
                        for (int vertexNdx = 0; vertexNdx < 6; vertexNdx++)
-                               m_vertices[quadNdx * 6 + vertexNdx].position.z() = DepthTest::quadDepths[quadNdx];
+                       {
+                               m_vertices[quadNdx * 6 + vertexNdx].position.z() = m_depthClipControl ? DepthTest::quadDepthsMinusOneToOne[quadNdx] : DepthTest::quadDepths[quadNdx];
+                       }
 
                // Load vertices into vertex buffer
                deMemcpy(m_vertexBufferAlloc->getHostPtr(), m_vertices.data(), m_vertices.size() * sizeof(Vertex4RGBA));
@@ -714,7 +754,7 @@ tcu::TestStatus DepthTestInstance::verifyImage (void)
        const tcu::TextureFormat        tcuColorFormat  = mapVkFormat(VK_FORMAT_R8G8B8A8_UNORM);
        const tcu::TextureFormat        tcuDepthFormat  = mapVkFormat(m_depthFormat);
        const ColorVertexShader         vertexShader;
-       const ColorFragmentShader       fragmentShader  (tcuColorFormat, tcuDepthFormat);
+       const ColorFragmentShader       fragmentShader  (tcuColorFormat, tcuDepthFormat, m_depthClipControl);
        const rr::Program                       program                 (&vertexShader, &fragmentShader);
        ReferenceRenderer                       refRenderer             (m_renderSize.x(), m_renderSize.y(), 1, tcuColorFormat, tcuDepthFormat, &program);
        bool                                            colorCompareOk  = false;
@@ -808,7 +848,6 @@ tcu::TestStatus DepthTestInstance::verifyImage (void)
                        }
                        else if (tcu::getTextureChannelClass(result->getFormat().type) == tcu::TEXTURECHANNELCLASS_FLOATING_POINT)
                        {
-
                                depthThreshold = 0.0000001f;
                        }
                        else
@@ -1096,6 +1135,22 @@ tcu::TestCaseGroup* createDepthTests (tcu::TestContext& testCtx)
        }
        depthTests->addChild(noColorAttachmentTests.release());
 
+       de::MovePtr<tcu::TestCaseGroup> depthClipControlTests           (new tcu::TestCaseGroup(testCtx, "depth_clip_control", "Depth tests with depth clip control enabled"));
+       {
+               const VkCompareOp compareOps[] = { VK_COMPARE_OP_ALWAYS, VK_COMPARE_OP_LESS };
+
+               for (const auto& format : depthFormats)
+                       for (const auto& compareOp : compareOps)
+                       {
+                               std::string testName = getFormatCaseName(format) + "_" + de::toLower(std::string(getCompareOpName(compareOp)).substr(14));
+
+                               const VkCompareOp ops[DepthTest::QUAD_COUNT] = { compareOp, compareOp, compareOp, compareOp };
+                               depthClipControlTests->addChild(new DepthTest(testCtx, testName, "", format, ops, false, false,
+                                                                                               0.0f, 1.0f, true, false, true, true));
+                       }
+       }
+       depthTests->addChild(depthClipControlTests.release());
+
        return depthTests.release();
 }
 
index 431dbd6..86b1214 100644 (file)
@@ -157,13 +157,16 @@ class ColorFragmentShader : public rr::FragmentShader
 private:
        const tcu::TextureFormat                m_colorFormat;
        const tcu::TextureFormat                m_depthStencilFormat;
+       const bool                                              m_disableVulkanDepthRange;
 
 public:
-       ColorFragmentShader (const tcu::TextureFormat& colorFormat,
-                                                const tcu::TextureFormat& depthStencilFormat)
-               : rr::FragmentShader    (2, 1)
-               , m_colorFormat                 (colorFormat)
-               , m_depthStencilFormat  (depthStencilFormat)
+       ColorFragmentShader (const tcu::TextureFormat&  colorFormat,
+                                                const tcu::TextureFormat&      depthStencilFormat,
+                                                const bool                                     disableVulkanDepthRange = false)
+               : rr::FragmentShader            (2, 1)
+               , m_colorFormat                         (colorFormat)
+               , m_depthStencilFormat          (depthStencilFormat)
+               , m_disableVulkanDepthRange     (disableVulkanDepthRange)
        {
                const tcu::TextureChannelClass channelClass = tcu::getTextureChannelClass(m_colorFormat.type);
 
@@ -184,7 +187,11 @@ public:
                {
                        const rr::FragmentPacket& packet = packets[packetNdx];
 
-                       if (m_depthStencilFormat.order == tcu::TextureFormat::D || m_depthStencilFormat.order == tcu::TextureFormat::DS)
+                       // Reference renderer uses OpenGL depth range of -1..1, and does the viewport depth transform using
+                       // formula (position.z+1)/2. For Vulkan the depth range is 0..1 and the vertex depth is mapped as is, so
+                       // the values gets overridden here, unless depth clip control extension changes the depth clipping to use
+                       // the OpenGL depth range.
+                       if (!m_disableVulkanDepthRange && (m_depthStencilFormat.order == tcu::TextureFormat::D || m_depthStencilFormat.order == tcu::TextureFormat::DS))
                        {
                                for (int fragNdx = 0; fragNdx < 4; fragNdx++)
                                {
index ae01661..e9942e5 100644 (file)
@@ -81,6 +81,9 @@ enum TestType
        TEST_TYPE_QUERY_COPY,
        TEST_TYPE_QUERY_RESET,
        TEST_TYPE_MULTIQUERY,
+       TEST_TYPE_DEPTH_CLIP_CONTROL_VERTEX,
+       TEST_TYPE_DEPTH_CLIP_CONTROL_GEOMETRY,
+       TEST_TYPE_DEPTH_CLIP_CONTROL_TESE,
        TEST_TYPE_LAST
 };
 
@@ -173,15 +176,44 @@ Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&             vk,
                                                                           const VkShaderModule                 tessellationControlModule,
                                                                           const VkShaderModule                 tessellationEvalModule,
                                                                           const VkShaderModule                 geometryModule,
-                                                                          const VkShaderModule                 fragmendModule,
+                                                                          const VkShaderModule                 fragmentModule,
                                                                           const VkExtent2D                             renderSize,
                                                                           const deUint32                               subpass,
                                                                           const deUint32*                              rasterizationStreamPtr  = DE_NULL,
                                                                           const VkPrimitiveTopology    topology                                = VK_PRIMITIVE_TOPOLOGY_POINT_LIST,
-                                                                          const bool                                   inputVertices                   = false)
+                                                                          const bool                                   inputVertices                   = false,
+                                                                          const bool                                   depthClipControl                = false)
 {
-       const std::vector<VkViewport>                                                   viewports                                                               (1, makeViewport(renderSize));
-       const std::vector<VkRect2D>                                                             scissors                                                                (1, makeRect2D(renderSize));
+       VkViewport                                                                                              viewport                                                        = makeViewport(renderSize);
+       VkRect2D                                                                                                scissor                                                         = makeRect2D(renderSize);
+
+       const VkPipelineViewportDepthClipControlCreateInfoEXT   depthClipControlCreateInfo                      =
+       {
+               VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT, // VkStructureType      sType;
+               DE_NULL,                                                                                                                                // const void*          pNext;
+               VK_TRUE,                                                                                                                                // VkBool32             negativeOneToOne;
+       };
+
+       const VkPipelineViewportStateCreateInfo                                 viewportStateCreateInfo                         =
+       {
+               VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,          // VkStructureType                             sType
+               depthClipControl ? &depthClipControlCreateInfo : DE_NULL,       // const void*                                 pNext
+               (VkPipelineViewportStateCreateFlags)0,                                          // VkPipelineViewportStateCreateFlags          flags
+               1u,                                                                                                                     // deUint32                                    viewportCount
+               &viewport,                                                                                                      // const VkViewport*                           pViewports
+               1u,                                                                                                                     // deUint32                                    scissorCount
+               &scissor                                                                                                        // const VkRect2D*                             pScissors
+       };
+
+       const VkPipelineInputAssemblyStateCreateInfo                    inputAssemblyStateCreateInfo            =
+       {
+               VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,    // VkStructureType                            sType
+               DE_NULL,                                                                                                                // const void*                                pNext
+               0u,                                                                                                                             // VkPipelineInputAssemblyStateCreateFlags    flags
+               topology,                                                                                                               // VkPrimitiveTopology                        topology
+               VK_FALSE                                                                                                                // VkBool32                                   primitiveRestartEnable
+       };
+
        const VkPipelineVertexInputStateCreateInfo                              vertexInputStateCreateInfo                      =
        {
                VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,                                                                      //  VkStructureType                                                                     sType
@@ -192,9 +224,11 @@ Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&              vk,
                0u,                                                                                                                                                                                     //  deUint32                                                                            vertexAttributeDescriptionCount
                DE_NULL,                                                                                                                                                                        //  const VkVertexInputAttributeDescription*            pVertexAttributeDescriptions
        };
+
        const VkPipelineVertexInputStateCreateInfo*                             vertexInputStateCreateInfoPtr           = (inputVertices) ? DE_NULL : &vertexInputStateCreateInfo;
-       const VkBool32                                                                                  disableRasterization                            = (fragmendModule == DE_NULL);
+       const VkBool32                                                                                  disableRasterization                            = (fragmentModule == DE_NULL);
        const deUint32                                                                                  rasterizationStream                                     = (rasterizationStreamPtr == DE_NULL) ? 0 : *rasterizationStreamPtr;
+
        const VkPipelineRasterizationStateStreamCreateInfoEXT   rasterizationStateStreamCreateInfo      =
        {
                VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT,                                          //  VkStructureType                                                                             sType;
@@ -202,40 +236,49 @@ Move<VkPipeline> makeGraphicsPipeline (const DeviceInterface&             vk,
                0,                                                                                                                                                                                      //  VkPipelineRasterizationStateStreamCreateFlagsEXT    flags;
                rasterizationStream                                                                                                                                                     //  deUint32                                                                                    rasterizationStream;
        };
+
        const VkPipelineRasterizationStateCreateInfo                    rasterizationStateCreateInfo            =
        {
-               VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,                                                                     //  VkStructureType                                                     sType;
-               &rasterizationStateStreamCreateInfo,                                                                                                            //  const void*                                                         pNext;
-               0u,                                                                                                                                                                                     //  VkPipelineRasterizationStateCreateFlags     flags;
-               VK_FALSE,                                                                                                                                                                       //  VkBool32                                                            depthClampEnable;
-               disableRasterization,                                                                                                                                           //  VkBool32                                                            rasterizerDiscardEnable;
-               VK_POLYGON_MODE_FILL,                                                                                                                                           //  VkPolygonMode                                                       polygonMode;
-               VK_CULL_MODE_NONE,                                                                                                                                                      //  VkCullModeFlags                                                     cullMode;
-               VK_FRONT_FACE_COUNTER_CLOCKWISE,                                                                                                                        //  VkFrontFace                                                         frontFace;
-               VK_FALSE,                                                                                                                                                                       //  VkBool32                                                            depthBiasEnable;
-               0.0f,                                                                                                                                                                           //  float                                                                       depthBiasConstantFactor;
-               0.0f,                                                                                                                                                                           //  float                                                                       depthBiasClamp;
-               0.0f,                                                                                                                                                                           //  float                                                                       depthBiasSlopeFactor;
-               1.0f                                                                                                                                                                            //  float                                                                       lineWidth;
+               VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,     //  VkStructureType                                                     sType
+               &rasterizationStateStreamCreateInfo,                                            //  const void*                                                         pNext
+               0u,                                                                                                                     //  VkPipelineRasterizationStateCreateFlags     flags
+               VK_FALSE,                                                                                                       //  VkBool32                                                            depthClampEnable
+               disableRasterization,                                                                           //  VkBool32                                                            rasterizerDiscardEnable
+               VK_POLYGON_MODE_FILL,                                                                           //  VkPolygonMode                                                       polygonMode
+               VK_CULL_MODE_NONE,                                                                                      //  VkCullModeFlags                                                     cullMode
+               VK_FRONT_FACE_COUNTER_CLOCKWISE,                                                        //  VkFrontFace                                                         frontFace
+               VK_FALSE,                                                                                                       //  VkBool32                                                            depthBiasEnable
+               0.0f,                                                                                                           //  float                                                                       depthBiasConstantFactor
+               0.0f,                                                                                                           //  float                                                                       depthBiasClamp
+               0.0f,                                                                                                           //  float                                                                       depthBiasSlopeFactor
+               1.0f                                                                                                            //  float                                                                       lineWidth
        };
+
        const VkPipelineRasterizationStateCreateInfo*                   rasterizationStateCreateInfoPtr         = (rasterizationStreamPtr == DE_NULL) ? DE_NULL : &rasterizationStateCreateInfo;
 
-       return makeGraphicsPipeline(vk,                                                                                 // const DeviceInterface&                                                       vk
-                                                               device,                                                                         // const VkDevice                                                                       device
-                                                               pipelineLayout,                                                         // const VkPipelineLayout                                                       pipelineLayout
-                                                               vertexModule,                                                           // const VkShaderModule                                                         vertexShaderModule
-                                                               tessellationControlModule,                                      // const VkShaderModule                                                         tessellationControlModule
-                                                               tessellationEvalModule,                                         // const VkShaderModule                                                         tessellationEvalModule
-                                                               geometryModule,                                                         // const VkShaderModule                                                         geometryShaderModule
-                                                               fragmendModule,                                                         // const VkShaderModule                                                         fragmentShaderModule
-                                                               renderPass,                                                                     // const VkRenderPass                                                           renderPass
-                                                               viewports,                                                                      // const std::vector<VkViewport>&                                       viewports
-                                                               scissors,                                                                       // const std::vector<VkRect2D>&                                         scissors
-                                                               topology,                                                                       // const VkPrimitiveTopology                                            topology
-                                                               subpass,                                                                        // const deUint32                                                                       subpass
-                                                               (tessellationEvalModule != DE_NULL) * 3u,       // const deUint32                                                                       patchControlPoints
-                                                               vertexInputStateCreateInfoPtr,                          // const VkPipelineVertexInputStateCreateInfo*          vertexInputStateCreateInfo
-                                                               rasterizationStateCreateInfoPtr);                       // const VkPipelineRasterizationStateCreateInfo*        rasterizationStateCreateInfo
+       const VkPipelineTessellationStateCreateInfo                             tessStateCreateInfo                                     =
+       {
+               VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO,      // VkStructureType                           sType
+               DE_NULL,                                                                                                        // const void*                               pNext
+               0u,                                                                                                                     // VkPipelineTessellationStateCreateFlags    flags
+               3u                                                                                                                      // deUint32                                  patchControlPoints
+       };
+
+       return makeGraphicsPipeline(vk,                                                                 // const DeviceInterface&                                                       vk
+                                                               device,                                                         // const VkDevice                                                                       device
+                                                               pipelineLayout,                                         // const VkPipelineLayout                                                       pipelineLayout
+                                                               vertexModule,                                           // const VkShaderModule                                                         vertexShaderModule
+                                                               tessellationControlModule,                      // const VkShaderModule                                                         tessellationControlModule
+                                                               tessellationEvalModule,                         // const VkShaderModule                                                         tessellationEvalModule
+                                                               geometryModule,                                         // const VkShaderModule                                                         geometryShaderModule
+                                                               fragmentModule,                                         // const VkShaderModule                                                         fragmentShaderModule
+                                                               renderPass,                                                     // const VkRenderPass                                                           renderPass
+                                                               subpass,                                                        // const deUint32                                                                       subpass
+                                                               vertexInputStateCreateInfoPtr,          // const VkPipelineVertexInputStateCreateInfo*          vertexInputStateCreateInfo
+                                                               &inputAssemblyStateCreateInfo,          // const VkPipelineInputAssemblyStateCreateInfo*        inputAssemblyStateCreateInfo
+                                                               &tessStateCreateInfo,                           // const VkPipelineTessellationStateCreateInfo*         tessStateCreateInfo
+                                                               &viewportStateCreateInfo,                       // const VkPipelineViewportStateCreateInfo*                     viewportStateCreateInfo
+                                                               rasterizationStateCreateInfoPtr);       // const VkPipelineRasterizationStateCreateInfo*        rasterizationStateCreateInfo
 }
 
 VkImageCreateInfo makeImageCreateInfo (const VkImageCreateFlags flags, const VkImageType type, const VkFormat format, const VkExtent2D size, const deUint32 numLayers, const VkImageUsageFlags usage)
@@ -1107,6 +1150,143 @@ tcu::TestStatus TransformFeedbackBuiltinTestInstance::iterate (void)
        return tcu::TestStatus::pass("Pass");
 }
 
+class TransformFeedbackDepthClipControlTestInstance : public TransformFeedbackTestInstance
+{
+public:
+       TransformFeedbackDepthClipControlTestInstance           (Context& context, const TestParameters& parameters);
+
+protected:
+       tcu::TestStatus         iterate                                                 (void);
+       void                            verifyTransformFeedbackBuffer   (const MovePtr<Allocation>& bufAlloc, const VkDeviceSize offset, const deUint32 bufBytes);
+};
+
+TransformFeedbackDepthClipControlTestInstance::TransformFeedbackDepthClipControlTestInstance (Context& context, const TestParameters& parameters)
+               : TransformFeedbackTestInstance (context, parameters)
+{
+       const InstanceInterface&                vki                     = m_context.getInstanceInterface();
+       const VkPhysicalDevice                  physDevice      = m_context.getPhysicalDevice();
+       const VkPhysicalDeviceFeatures  features        = getPhysicalDeviceFeatures(vki, physDevice);
+
+       const deUint32 tfBuffersSupported       = m_transformFeedbackProperties.maxTransformFeedbackBuffers;
+       const deUint32 tfBuffersRequired        = m_parameters.partCount;
+
+       if (!context.isDeviceFunctionalitySupported("VK_EXT_depth_clip_control"))
+               TCU_THROW(NotSupportedError, "VK_EXT_depth_clip_control is not supported");
+
+       if (parameters.testType == TEST_TYPE_DEPTH_CLIP_CONTROL_GEOMETRY && !features.geometryShader)
+               TCU_THROW(NotSupportedError, "Geometry shader not supported");
+
+       if (parameters.testType == TEST_TYPE_DEPTH_CLIP_CONTROL_TESE && !features.tessellationShader)
+               TCU_THROW(NotSupportedError, "Tessellation shader not supported");
+
+       if (tfBuffersSupported < tfBuffersRequired)
+               TCU_THROW(NotSupportedError, std::string("maxTransformFeedbackBuffers=" + de::toString(tfBuffersSupported) + ", while test requires " + de::toString(tfBuffersRequired)).c_str());
+}
+
+void TransformFeedbackDepthClipControlTestInstance::verifyTransformFeedbackBuffer (const MovePtr<Allocation>& bufAlloc, const VkDeviceSize offset, const deUint32 bufBytes)
+{
+       const DeviceInterface&  vk                      = m_context.getDeviceInterface();
+       const VkDevice                  device          = m_context.getDevice();
+
+       invalidateAlloc(vk, device, *bufAlloc);
+
+       const deUint32                  numVertices     = bufBytes / static_cast<deUint32>(sizeof(float) * 4);
+       const deUint8*                  tfDataBytes     = (deUint8*)bufAlloc->getHostPtr();
+       const float*                    tfData          = (float*)&tfDataBytes[offset];
+       std::vector<float>              result;
+
+       // We only care about the depth (z) value.
+       for (deUint32 i = 0; i < numVertices; i++)
+               result.push_back(tfData[i * 4 + 2]);
+
+       // Tessellation generates triangles whose vertex data might be written into
+       // transform feedback buffer in a different order than generated by the vertex
+       // shader. Sort the values here to allow comparison.
+       if (m_parameters.testType == TEST_TYPE_DEPTH_CLIP_CONTROL_TESE)
+       {
+               std::sort(result.begin(), result.end());
+       }
+
+       // Verify the vertex depth values match with the ones written by the shader.
+       for (deUint32 i = 0; i < numVertices; i++)
+       {
+               const float     expected        = (float)i / 3.0f - 1.0f;
+               const float     epsilon         = 0.0001f;
+
+               if (deAbs(result[i] - expected) > epsilon)
+                       TCU_FAIL(std::string("Failed at vertex ") + de::toString(i) + " depth. Received:" + de::toString(result[i]) + " expected:" + de::toString(expected));
+       }
+}
+
+tcu::TestStatus TransformFeedbackDepthClipControlTestInstance::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 Unique<VkShaderModule>            vertexModule                    (createShaderModule(vk, device, m_context.getBinaryCollection().get("vert"), 0u));
+       Move<VkShaderModule>                            geomModule;
+       Move<VkShaderModule>                            tescModule;
+       Move<VkShaderModule>                            teseModule;
+       const bool                                                      hasGeomShader                   = m_parameters.testType == TEST_TYPE_DEPTH_CLIP_CONTROL_GEOMETRY;
+       const bool                                                      hasTessellation                 = m_parameters.testType == TEST_TYPE_DEPTH_CLIP_CONTROL_TESE;
+
+       if (hasGeomShader)
+               geomModule = createShaderModule(vk, device, m_context.getBinaryCollection().get("geom"), 0u);
+
+       if (hasTessellation)
+       {
+               tescModule = createShaderModule(vk, device, m_context.getBinaryCollection().get("tesc"), 0u);
+               teseModule = createShaderModule(vk, device, m_context.getBinaryCollection().get("tese"), 0u);
+       }
+
+       const Unique<VkRenderPass>                      renderPass                              (makeRenderPass(vk, device, VK_FORMAT_UNDEFINED));
+       const Unique<VkFramebuffer>                     framebuffer                             (makeFramebuffer(vk, device, *renderPass, 0u, DE_NULL, m_imageExtent2D.width, m_imageExtent2D.height));
+       const Unique<VkPipelineLayout>          pipelineLayout                  (TransformFeedback::makePipelineLayout  (vk, device));
+       const Unique<VkPipeline>                        pipeline                                (makeGraphicsPipeline(vk, device, *pipelineLayout, *renderPass, *vertexModule, hasTessellation ? *tescModule : DE_NULL, hasTessellation ? *teseModule : DE_NULL, hasGeomShader ? *geomModule : DE_NULL, DE_NULL, m_imageExtent2D, 0u, &m_parameters.streamId, m_parameters.primTopology, false, true));
+       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 VkDeviceSize                                      tfBufSize                               = m_parameters.bufferSize * m_parameters.partCount;
+       const VkBufferCreateInfo                        tfBufCreateInfo                 = makeBufferCreateInfo(tfBufSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT);
+       const Move<VkBuffer>                            tfBuf                                   = createBuffer(vk, device, &tfBufCreateInfo);
+       const std::vector<VkBuffer>                     tfBufArray                              = std::vector<VkBuffer>(m_parameters.partCount, *tfBuf);
+       const MovePtr<Allocation>                       tfBufAllocation                 = allocator.allocate(getBufferMemoryRequirements(vk, device, *tfBuf), MemoryRequirement::HostVisible);
+       const VkMemoryBarrier                           tfMemoryBarrier                 = makeMemoryBarrier(VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT, VK_ACCESS_HOST_READ_BIT);
+       const std::vector<VkDeviceSize>         tfBufBindingSizes               = std::vector<VkDeviceSize>(m_parameters.partCount, m_parameters.bufferSize);
+       const std::vector<VkDeviceSize>         tfBufBindingOffsets             = generateOffsetsList(tfBufBindingSizes);
+       const deUint32                                          perVertexDataSize               = static_cast<deUint32>(4u * sizeof(float));
+       const deUint32                                          numVertices                             = m_parameters.bufferSize / perVertexDataSize;
+
+       VK_CHECK(vk.bindBufferMemory(device, *tfBuf, tfBufAllocation->getMemory(), tfBufAllocation->getOffset()));
+
+       beginCommandBuffer(vk, *cmdBuffer);
+       {
+               beginRenderPass(vk, *cmdBuffer, *renderPass, *framebuffer, makeRect2D(m_imageExtent2D));
+               {
+                       vk.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *pipeline);
+
+                       vk.cmdBindTransformFeedbackBuffersEXT(*cmdBuffer, 0, m_parameters.partCount, &tfBufArray[0], &tfBufBindingOffsets[0], &tfBufBindingSizes[0]);
+
+                       vk.cmdBeginTransformFeedbackEXT(*cmdBuffer, 0, 0, DE_NULL, DE_NULL);
+                       {
+                               vk.cmdDraw(*cmdBuffer, numVertices, 1u, 0u, 0u);
+                       }
+                       vk.cmdEndTransformFeedbackEXT(*cmdBuffer, 0, 0, DE_NULL, DE_NULL);
+               }
+               endRenderPass(vk, *cmdBuffer);
+
+               vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT, VK_PIPELINE_STAGE_HOST_BIT, 0u, 1u, &tfMemoryBarrier, 0u, DE_NULL, 0u, DE_NULL);
+       }
+       endCommandBuffer(vk, *cmdBuffer);
+       submitCommandsAndWait(vk, device, queue, *cmdBuffer);
+
+       verifyTransformFeedbackBuffer(tfBufAllocation, tfBufBindingOffsets[m_parameters.partCount - 1], m_parameters.bufferSize);
+
+       return tcu::TestStatus::pass("Pass");
+}
+
 class TransformFeedbackMultistreamTestInstance : public TransformFeedbackTestInstance
 {
 public:
@@ -2191,6 +2371,11 @@ vkt::TestInstance*       TransformFeedbackTestCase::createInstance (vkt::Context& cont
        if (m_parameters.testType == TEST_TYPE_MULTIQUERY)
                return new TransformFeedbackMultiQueryTestInstance(context, m_parameters);
 
+       if (m_parameters.testType == TEST_TYPE_DEPTH_CLIP_CONTROL_VERTEX        ||
+               m_parameters.testType == TEST_TYPE_DEPTH_CLIP_CONTROL_GEOMETRY  ||
+               m_parameters.testType == TEST_TYPE_DEPTH_CLIP_CONTROL_TESE)
+               return new TransformFeedbackDepthClipControlTestInstance(context, m_parameters);
+
        TCU_THROW(InternalError, "Specified test type not found");
 }
 
@@ -2210,6 +2395,123 @@ void TransformFeedbackTestCase::initPrograms (SourceCollections& programCollecti
                                                                        || m_parameters.testType == TEST_TYPE_XFB_CULLDISTANCE
                                                                        || m_parameters.testType == TEST_TYPE_XFB_CLIP_AND_CULL;
 
+       if (m_parameters.testType == TEST_TYPE_DEPTH_CLIP_CONTROL_VERTEX)
+       {
+               // Vertex shader
+               {
+                       std::ostringstream src;
+                       src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
+                               << "\n"
+                               << "layout(xfb_buffer = 0, xfb_offset = 0) out gl_PerVertex\n"
+                               << "{\n"
+                               << "    vec4 gl_Position;\n"
+                               << "};\n"
+                               << "\n"
+                               << "void main(void)\n"
+                               << "{\n"
+                               << "    gl_Position = vec4(1.0, 1.0, float(gl_VertexIndex) / 3.0 - 1.0, 1.0);\n"
+                               << "}\n";
+
+                       programCollection.glslSources.add("vert") << glu::VertexSource(src.str());
+               }
+
+               return;
+       }
+
+       if (m_parameters.testType == TEST_TYPE_DEPTH_CLIP_CONTROL_GEOMETRY)
+       {
+               // Vertex shader
+               {
+                       std::ostringstream src;
+                       src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
+                               << "\n"
+                               << "void main(void)\n"
+                               << "{\n"
+                               << "    gl_Position = vec4(1.0, 1.0, float(gl_VertexIndex) / 3.0 - 1.0, 1.0);\n"
+                               << "}\n";
+
+                       programCollection.glslSources.add("vert") << glu::VertexSource(src.str());
+               }
+
+               // Geometry shader
+               {
+                       std::ostringstream src;
+                       src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
+                               << "\n"
+                               << "layout(points) in;\n"
+                               << "layout(points, max_vertices = 1) out;\n"
+                               << "layout(xfb_buffer = 0, xfb_offset = 0) out gl_PerVertex\n"
+                               << "{\n"
+                               << "    vec4 gl_Position;\n"
+                               << "};\n"
+                               << "\n"
+                               << "void main(void)\n"
+                               << "{\n"
+                               << "    gl_Position = gl_in[0].gl_Position;\n"
+                               << "    EmitVertex();\n"
+                               << "    EndPrimitive();\n"
+                               << "}\n";
+
+                       programCollection.glslSources.add("geom") << glu::GeometrySource(src.str());
+               }
+
+               return;
+       }
+
+       if (m_parameters.testType == TEST_TYPE_DEPTH_CLIP_CONTROL_TESE)
+       {
+               // Vertex shader
+               {
+                       std::ostringstream src;
+                       src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
+                               << "\n"
+                               << "void main(void)\n"
+                               << "{\n"
+                               << "    gl_Position = vec4(1.0, 1.0, float(gl_VertexIndex) / 3.0 - 1.0, 1.0);\n"
+                               << "}\n";
+
+                       programCollection.glslSources.add("vert") << glu::VertexSource(src.str());
+               }
+
+               // Tesselation control shader
+               {
+                       std::ostringstream src;
+                       src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
+                               << "layout(vertices = 3) out;\n"
+                               << "void main (void)\n"
+                               << "{\n"
+                               << "    gl_TessLevelInner[0] = 0.0;\n"
+                               << "    gl_TessLevelOuter[0] = 1.0;\n"
+                               << "    gl_TessLevelOuter[1] = 1.0;\n"
+                               << "    gl_TessLevelOuter[2] = 1.0;\n"
+                               << "    gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n"
+                               << "}\n";
+                       programCollection.glslSources.add("tesc") << glu::TessellationControlSource(src.str());
+               }
+
+               // Tessellation evaluation shader
+               {
+                       std::ostringstream src;
+                       src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
+                               << "layout(triangles, ccw) in;\n"
+                               << "layout(xfb_buffer = 0, xfb_offset = 0) out gl_PerVertex\n"
+                               << "{\n"
+                               << "    vec4 gl_Position;\n"
+                               << "};\n"
+                               << "\n"
+                               << "void main (void)\n"
+                               << "{\n"
+                               << "    vec4 p0 = gl_TessCoord.x * gl_in[0].gl_Position;\n"
+                               << "    vec4 p1 = gl_TessCoord.y * gl_in[1].gl_Position;\n"
+                               << "    vec4 p2 = gl_TessCoord.z * gl_in[2].gl_Position;\n"
+                               << "    gl_Position = p0 + p1 + p2;\n"
+                               << "}\n";
+                       programCollection.glslSources.add("tese") << glu::TessellationEvaluationSource(src.str());
+               }
+
+               return;
+       }
+
        if (vertexShaderOnly)
        {
                // Vertex shader
@@ -3008,6 +3310,23 @@ void createTransformFeedbackSimpleTests(tcu::TestCaseGroup* group)
                        }
                }
        }
+
+       // Depth clip control tests.
+       {
+               TestParameters  parameters      = { TEST_TYPE_DEPTH_CLIP_CONTROL_VERTEX, 96, 1u, 0u, 0u, 0u, STREAM_ID_0_NORMAL, false, false, VK_PRIMITIVE_TOPOLOGY_POINT_LIST };
+
+               group->addChild(new TransformFeedbackTestCase(group->getTestContext(), "depth_clip_control_vertex", "", parameters));
+       }
+       {
+               TestParameters  parameters      = { TEST_TYPE_DEPTH_CLIP_CONTROL_GEOMETRY, 96, 1u, 0u, 0u, 0u, STREAM_ID_0_NORMAL, false, false, VK_PRIMITIVE_TOPOLOGY_POINT_LIST };
+
+               group->addChild(new TransformFeedbackTestCase(group->getTestContext(), "depth_clip_control_geometry", "", parameters));
+       }
+       {
+               TestParameters  parameters      = { TEST_TYPE_DEPTH_CLIP_CONTROL_TESE, 96, 1u, 0u, 0u, 0u, STREAM_ID_0_NORMAL, false, false, VK_PRIMITIVE_TOPOLOGY_PATCH_LIST };
+
+               group->addChild(new TransformFeedbackTestCase(group->getTestContext(), "depth_clip_control_tese", "", parameters));
+       }
 }
 
 void createTransformFeedbackStreamsSimpleTests (tcu::TestCaseGroup* group)
index b774b02..204ee82 100644 (file)
@@ -68169,6 +68169,18 @@ dEQP-VK.pipeline.depth.nocolor.format.d32_sfloat_s8_uint_separate_layouts.compar
 dEQP-VK.pipeline.depth.nocolor.format.d32_sfloat_s8_uint_separate_layouts.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.nocolor.format.d32_sfloat_s8_uint_separate_layouts.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
 dEQP-VK.pipeline.depth.nocolor.format.d32_sfloat_s8_uint_separate_layouts.depth_test_disabled.depth_write_enabled
+dEQP-VK.pipeline.depth.depth_clip_control.d16_unorm_always
+dEQP-VK.pipeline.depth.depth_clip_control.d16_unorm_less
+dEQP-VK.pipeline.depth.depth_clip_control.x8_d24_unorm_pack32_always
+dEQP-VK.pipeline.depth.depth_clip_control.x8_d24_unorm_pack32_less
+dEQP-VK.pipeline.depth.depth_clip_control.d32_sfloat_always
+dEQP-VK.pipeline.depth.depth_clip_control.d32_sfloat_less
+dEQP-VK.pipeline.depth.depth_clip_control.d16_unorm_s8_uint_always
+dEQP-VK.pipeline.depth.depth_clip_control.d16_unorm_s8_uint_less
+dEQP-VK.pipeline.depth.depth_clip_control.d24_unorm_s8_uint_always
+dEQP-VK.pipeline.depth.depth_clip_control.d24_unorm_s8_uint_less
+dEQP-VK.pipeline.depth.depth_clip_control.d32_sfloat_s8_uint_always
+dEQP-VK.pipeline.depth.depth_clip_control.d32_sfloat_s8_uint_less
 dEQP-VK.pipeline.dynamic_offset.graphics.single_set.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_1.numnondynamicbindings_0
 dEQP-VK.pipeline.dynamic_offset.graphics.single_set.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_1.numnondynamicbindings_1
 dEQP-VK.pipeline.dynamic_offset.graphics.single_set.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_2.numnondynamicbindings_0
index 28ddae1..40ec423 100644 (file)
@@ -1973,6 +1973,9 @@ dEQP-VK.transform_feedback.simple.host_query_reset_triangle_strip_with_adjacency
 dEQP-VK.transform_feedback.simple.query_triangle_strip_with_adjacency_14_508_64bits
 dEQP-VK.transform_feedback.simple.query_copy_triangle_strip_with_adjacency_14_508_64bits
 dEQP-VK.transform_feedback.simple.host_query_reset_triangle_strip_with_adjacency_14_508_64bits
+dEQP-VK.transform_feedback.simple.depth_clip_control_vertex
+dEQP-VK.transform_feedback.simple.depth_clip_control_geometry
+dEQP-VK.transform_feedback.simple.depth_clip_control_tese
 dEQP-VK.transform_feedback.simple.streams_1
 dEQP-VK.transform_feedback.simple.streams_3
 dEQP-VK.transform_feedback.simple.streams_6
index 387ad70..e80dab9 100644 (file)
@@ -140,6 +140,7 @@ VkPhysicalDeviceColorWriteEnableFeaturesEXT                                 FEATURES ( colorWriteEnable )
 VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT                       FEATURES ( ycbcr2plane444Formats )                                                              REQUIREMENTS ( VK_EXT_ycbcr_2plane_444_formats )
 VkPhysicalDeviceExtendedDynamicState2FeaturesEXT                       FEATURES ( extendedDynamicState2 )                                                              REQUIREMENTS ( VK_EXT_extended_dynamic_state2 )
 VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE                     FEATURES ( mutableDescriptorType )                                                              REQUIREMENTS ( VK_VALVE_mutable_descriptor_type )
+VkPhysicalDeviceDepthClipControlFeaturesEXT                 FEATURES ( depthClipControl )                                   REQUIREMENTS ( VK_EXT_depth_clip_control )
 VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT                         FEATURES ( globalPriorityQuery )                                                                REQUIREMENTS ( VK_EXT_global_priority_query )
 VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT                      FEATURES ( shaderImageInt64Atomics )                                                    REQUIREMENTS ( VK_EXT_shader_image_atomic_int64 physicalDeviceShaderImageAtomicInt64FeaturesEXT.sparseImageInt64Atomics )
 VkPhysicalDeviceShaderAtomicFloatFeaturesEXT                           FEATURES ( shaderImageFloat32Atomics )                                                  REQUIREMENTS ( VK_EXT_shader_atomic_float physicalDeviceShaderAtomicFloatFeaturesEXT.sparseImageFloat32Atomics )
index 18b302f..fda8555 100644 (file)
@@ -821,6 +821,8 @@ typedef enum VkStructureType {
     VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT = 1000340000,
     VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT = 1000346000,
     VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE = 1000351000,
+    VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT = 1000355000,
+    VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT = 1000355001,
     VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE = 1000351002,
     VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT = 1000352000,
     VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT = 1000352001,
@@ -12445,6 +12447,23 @@ typedef struct VkMutableDescriptorTypeCreateInfoVALVE {
 
 
 
+#define VK_EXT_depth_clip_control 1
+#define VK_EXT_DEPTH_CLIP_CONTROL_SPEC_VERSION 1
+#define VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME "VK_EXT_depth_clip_control"
+typedef struct VkPhysicalDeviceDepthClipControlFeaturesEXT {
+        VkStructureType    sType;
+            void*              pNext;
+                VkBool32           depthClipControl;
+} VkPhysicalDeviceDepthClipControlFeaturesEXT;
+
+typedef struct VkPipelineViewportDepthClipControlCreateInfoEXT {
+        VkStructureType    sType;
+            const void*        pNext;
+                VkBool32           negativeOneToOne;
+} VkPipelineViewportDepthClipControlCreateInfoEXT;
+
+
+
 #define VK_EXT_vertex_input_dynamic_state 1
 #define VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION 2
 #define VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME "VK_EXT_vertex_input_dynamic_state"