Check for depthBounds support in shader builtin frag depth tests

Depth bounds testing was enabled without checking for feature support
in a couple of tests. With this change, tests that don't need this
feature leave it disabled, whereas other tests (currently only
dEQP-VK.glsl.builtin_var.fragdepth.*) now throw NotSupported when
the device doesn't support it.

Affects:

dEQP-VK.clipping.*
dEQP-VK.glsl.builtin_var.*

Components: Vulkan

VK-GL-CTS issue: 685

Change-Id: I44d94142e295ff135ad1a55d0d6e212b65994257
diff --git a/external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderBuiltinVarTests.cpp b/external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderBuiltinVarTests.cpp
index e7d75fa..eaedb30 100644
--- a/external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderBuiltinVarTests.cpp
+++ b/external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderBuiltinVarTests.cpp
@@ -789,6 +789,7 @@
 		drawState.compareOp					= rr::TESTFUNC_ALWAYS;
 		drawState.depthTestEnable			= true;
 		drawState.depthWriteEnable			= true;
+		drawState.depthBoundsTestEnable		= true;
 		drawState.sampleShadingEnable		= true;
 		vulkanProgram.depthImageView		= *depthImageView;
 		vulkanProgram.descriptorSetLayout	= *descriptorSetLayout;
diff --git a/external/vulkancts/modules/vulkan/vktDrawUtil.cpp b/external/vulkancts/modules/vulkan/vktDrawUtil.cpp
index ecf66bd..2325f54 100644
--- a/external/vulkancts/modules/vulkan/vktDrawUtil.cpp
+++ b/external/vulkancts/modules/vulkan/vktDrawUtil.cpp
@@ -312,6 +312,7 @@
 	, depthTestEnable		(false)
 	, depthWriteEnable		(false)
 	, compareOp				(rr::TESTFUNC_LESS)
+	, depthBoundsTestEnable	(false)
 	, blendEnable			(false)
 	, lineWidth				(1.0)
 	, numPatchControlPoints	(0)
@@ -653,6 +654,9 @@
 			0u,						// write mask
 			0u);					// reference
 
+		if (m_drawState.depthBoundsTestEnable && context.getDeviceFeatures().depthBounds)
+			TCU_THROW(NotSupportedError, "depthBounds not supported");
+
 		const VkPipelineDepthStencilStateCreateInfo pipelineDepthStencilStateInfo =
 		{
 			VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO,	// VkStructureType							sType;
@@ -661,7 +665,7 @@
 			m_drawState.depthTestEnable,								// VkBool32									depthTestEnable;
 			m_drawState.depthWriteEnable,								// VkBool32									depthWriteEnable;
 			mapCompareOp(m_drawState.compareOp),						// VkCompareOp								depthCompareOp;
-			VK_TRUE,													// VkBool32									depthBoundsTestEnable;
+			m_drawState.depthBoundsTestEnable,							// VkBool32									depthBoundsTestEnable
 			VK_FALSE,													// VkBool32									stencilTestEnable;
 			stencilOpState,												// VkStencilOpState							front;
 			stencilOpState,												// VkStencilOpState							back;
diff --git a/external/vulkancts/modules/vulkan/vktDrawUtil.hpp b/external/vulkancts/modules/vulkan/vktDrawUtil.hpp
index 8ea74b8..adda78b 100644
--- a/external/vulkancts/modules/vulkan/vktDrawUtil.hpp
+++ b/external/vulkancts/modules/vulkan/vktDrawUtil.hpp
@@ -50,6 +50,7 @@
 	bool							depthTestEnable;
 	bool							depthWriteEnable;
 	rr::TestFunc					compareOp;
+	bool							depthBoundsTestEnable;
 	bool							blendEnable;
 	float							lineWidth;
 	deUint32						numPatchControlPoints;