#if DRAW_STATE_TESTS
+TEST_F(VkLayerTest, CreatePipelineBadVertexAttributeFormat) {
+ TEST_DESCRIPTION("Test that pipeline validation catches invalid vertex attribute formats");
+
+ ASSERT_NO_FATAL_FAILURE(InitState());
+ ASSERT_NO_FATAL_FAILURE(InitRenderTarget());
+
+ VkVertexInputBindingDescription input_binding;
+ memset(&input_binding, 0, sizeof(input_binding));
+
+ VkVertexInputAttributeDescription input_attribs;
+ memset(&input_attribs, 0, sizeof(input_attribs));
+
+ // Pick a really bad format for this purpose and make sure it should fail
+ input_attribs.format = VK_FORMAT_BC2_UNORM_BLOCK;
+ VkFormatProperties format_props = m_device->format_properties(input_attribs.format);
+ if ((format_props.bufferFeatures & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) != 0) {
+ printf("Format unsuitable for test; skipped.\n");
+ return;
+ }
+
+ input_attribs.location = 0;
+ char const *vsSource = "#version 450\n"
+ "\n"
+ "out gl_PerVertex {\n"
+ " vec4 gl_Position;\n"
+ "};\n"
+ "void main(){\n"
+ " gl_Position = vec4(1);\n"
+ "}\n";
+ char const *fsSource = "#version 450\n"
+ "\n"
+ "layout(location=0) out vec4 color;\n"
+ "void main(){\n"
+ " color = vec4(1);\n"
+ "}\n";
+
+ m_errorMonitor->SetDesiredFailureMsg(VK_DEBUG_REPORT_ERROR_BIT_EXT, VALIDATION_ERROR_01413);
+ VkShaderObj vs(m_device, vsSource, VK_SHADER_STAGE_VERTEX_BIT, this);
+ VkShaderObj fs(m_device, fsSource, VK_SHADER_STAGE_FRAGMENT_BIT, this);
+
+ VkPipelineObj pipe(m_device);
+ pipe.AddColorAttachment();
+ pipe.AddShader(&vs);
+ pipe.AddShader(&fs);
+
+ pipe.AddVertexInputBindings(&input_binding, 1);
+ pipe.AddVertexInputAttribs(&input_attribs, 1);
+
+ VkDescriptorSetObj descriptorSet(m_device);
+ descriptorSet.AppendDummy();
+ descriptorSet.CreateVKDescriptorSet(m_commandBuffer);
+
+ pipe.CreateVKPipeline(descriptorSet.GetPipelineLayout(), renderPass());
+
+ m_errorMonitor->VerifyFound();
+}
+
TEST_F(VkLayerTest, ImageSampleCounts) {
TEST_DESCRIPTION("Use bad sample counts in image transfer calls to trigger "
#endif // DEVICE_LIMITS_TESTS
#if IMAGE_TESTS
+
TEST_F(VkLayerTest, AttachmentDescriptionUndefinedFormat) {
TEST_DESCRIPTION("Create a render pass with an attachment description "
"format set to VK_FORMAT_UNDEFINED");