MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / TEST_F

Function TEST_F

tests/unit/vertex_input.cpp:21–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19class NegativeVertexInput : public VkLayerTest {};
20
21TEST_F(NegativeVertexInput, AttributeFormat) {
22 TEST_DESCRIPTION("Test that pipeline validation catches invalid vertex attribute formats");
23
24 RETURN_IF_SKIP(Init());
25 InitRenderTarget();
26
27 VkVertexInputBindingDescription input_binding = {0, 4, VK_VERTEX_INPUT_RATE_VERTEX};
28
29 VkVertexInputAttributeDescription input_attribs;
30 memset(&input_attribs, 0, sizeof(input_attribs));
31
32 // Pick a really bad format for this purpose and make sure it should fail
33 input_attribs.format = VK_FORMAT_BC2_UNORM_BLOCK;
34 if ((m_device->FormatFeaturesBuffer(VK_FORMAT_BC2_UNORM_BLOCK) & VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT) != 0) {
35 GTEST_SKIP() << "Format unsuitable for test";
36 }
37
38 input_attribs.location = 0;
39
40 auto set_info = [&](CreatePipelineHelper& helper) {
41 helper.vi_ci_.pVertexBindingDescriptions = &input_binding;
42 helper.vi_ci_.vertexBindingDescriptionCount = 1;
43 helper.vi_ci_.pVertexAttributeDescriptions = &input_attribs;
44 helper.vi_ci_.vertexAttributeDescriptionCount = 1;
45 };
46 CreatePipelineHelper::OneshotTest(*this, set_info, kErrorBit, "VUID-VkVertexInputAttributeDescription-format-00623");
47}
48
49TEST_F(NegativeVertexInput, DivisorExtension) {
50 TEST_DESCRIPTION("Test VUIDs added with VK_EXT_vertex_attribute_divisor extension.");

Callers

nothing calls this directly

Calls 15

CmdBindPipelineFunction · 0.85
CmdBindVertexBuffersFunction · 0.85
CmdDrawFunction · 0.85
CmdSetVertexInputEXTFunction · 0.85
CmdBindVertexBuffers2EXTFunction · 0.85
FormatFeaturesBufferMethod · 0.80
SetDesiredErrorMethod · 0.80
EndRenderPassMethod · 0.80
ExpectSuccessMethod · 0.80

Tested by

no test coverage detected