tests: Implement test for VU 2116 check
Add test 'PipelineRenderpassCompatibility' to exercise VU 2116 check.
Bump copyright year.
Update database test name.
Change-Id: I4eb73232e69874f34502d25867d2aa60c17f6a13
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 0bd2da1..98d49a3 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -1,8 +1,8 @@
/*
- * Copyright (c) 2015-2016 The Khronos Group Inc.
- * Copyright (c) 2015-2016 Valve Corporation
- * Copyright (c) 2015-2016 LunarG, Inc.
- * Copyright (c) 2015-2016 Google, Inc.
+ * Copyright (c) 2015-2017 The Khronos Group Inc.
+ * Copyright (c) 2015-2017 Valve Corporation
+ * Copyright (c) 2015-2017 LunarG, Inc.
+ * Copyright (c) 2015-2017 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -3273,6 +3273,40 @@
vkDestroyRenderPass(m_device->device(), renderpass, NULL);
}
+// Is the Pipeline compatible with the expectations of the Renderpass/subpasses?
+TEST_F(VkLayerTest, PipelineRenderpassCompatibility) {
+ TEST_DESCRIPTION(
+ "Create a graphics pipeline that is incompatible with the requirements "
+ "of its contained Renderpass/subpasses.");
+ ASSERT_NO_FATAL_FAILURE(InitState());
+
+ VkDescriptorSetObj ds_obj(m_device);
+ ds_obj.AppendDummy();
+ ds_obj.CreateVKDescriptorSet(m_commandBuffer);
+
+ VkShaderObj vs_obj(m_device, bindStateVertShaderText, VK_SHADER_STAGE_VERTEX_BIT, this);
+
+ VkPipelineColorBlendAttachmentState att_state1 = {};
+ att_state1.dstAlphaBlendFactor = VK_BLEND_FACTOR_CONSTANT_COLOR;
+ att_state1.blendEnable = VK_TRUE;
+
+ VkRenderpassObj rp_obj(m_device);
+
+ {
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_02116);
+ VkPipelineObj pipeline(m_device);
+ pipeline.AddShader(&vs_obj);
+ pipeline.AddColorAttachment(0, &att_state1);
+
+ VkGraphicsPipelineCreateInfo info = {};
+ pipeline.InitGraphicsPipelineCreateInfo(&info);
+ info.pColorBlendState = nullptr;
+
+ pipeline.CreateVKPipeline(ds_obj.GetPipelineLayout(), rp_obj.handle(), &info);
+ m_errorMonitor->VerifyFound();
+ }
+}
+
#if 0
TEST_F(VkLayerTest, RenderPassDepthStencilAttachmentUnused) {
TEST_DESCRIPTION("Specify no depth attachement in renderpass then specify "