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

Function TEST_F

tests/unit/dynamic_rendering.cpp:25–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23class NegativeDynamicRendering : public DynamicRenderingTest {};
24
25TEST_F(NegativeDynamicRendering, CommandBufferInheritanceRenderingInfo) {
26 TEST_DESCRIPTION("VkCommandBufferInheritanceRenderingInfo Dynamic Rendering Tests.");
27 SetTargetApiVersion(VK_API_VERSION_1_2);
28 AddRequiredExtensions(VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME);
29 AddOptionalExtensions(VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME);
30 AddOptionalExtensions(VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME);
31 AddRequiredFeature(vkt::Feature::dynamicRendering);
32
33 RETURN_IF_SKIP(Init());
34 const bool amd_samples = IsExtensionsEnabled(VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME);
35 const bool nv_samples = IsExtensionsEnabled(VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME);
36 if (!amd_samples && !nv_samples) {
37 GTEST_SKIP() << "Test requires either VK_AMD_mixed_attachment_samples or VK_NV_framebuffer_mixed_samples";
38 }
39
40 VkPhysicalDeviceMultiviewProperties multiview_props = vku::InitStructHelper();
41 GetPhysicalDeviceProperties2(multiview_props);
42
43 VkFormat color_format = VK_FORMAT_D32_SFLOAT;
44
45 VkCommandBufferInheritanceRenderingInfo cmd_buffer_inheritance_rendering_info = vku::InitStructHelper();
46 cmd_buffer_inheritance_rendering_info.colorAttachmentCount = 1;
47 cmd_buffer_inheritance_rendering_info.pColorAttachmentFormats = &color_format;
48 cmd_buffer_inheritance_rendering_info.depthAttachmentFormat = VK_FORMAT_R8G8B8_UNORM;
49 cmd_buffer_inheritance_rendering_info.stencilAttachmentFormat = VK_FORMAT_R8G8B8_SNORM;
50 cmd_buffer_inheritance_rendering_info.viewMask = 1 << multiview_props.maxMultiviewViewCount;
51
52 VkAttachmentSampleCountInfoAMD sample_count_info_amd = vku::InitStructHelper(&cmd_buffer_inheritance_rendering_info);
53 sample_count_info_amd.colorAttachmentCount = 2;
54
55 VkCommandBufferInheritanceInfo cmd_buffer_inheritance_info = vku::InitStructHelper(&sample_count_info_amd);
56
57 VkCommandBufferAllocateInfo cmd_buffer_allocate_info = vku::InitStructHelper();
58 cmd_buffer_allocate_info.commandPool = m_command_pool;
59 cmd_buffer_allocate_info.level = VK_COMMAND_BUFFER_LEVEL_SECONDARY;
60 cmd_buffer_allocate_info.commandBufferCount = 0x1;
61
62 VkCommandBuffer secondary_cmd_buffer;
63 VkResult err = vk::AllocateCommandBuffers(device(), &cmd_buffer_allocate_info, &secondary_cmd_buffer);
64 ASSERT_EQ(VK_SUCCESS, err);
65 m_errorMonitor->SetDesiredError("VUID-VkCommandBufferBeginInfo-flags-06003");
66 m_errorMonitor->SetDesiredError("VUID-VkCommandBufferInheritanceRenderingInfo-colorAttachmentCount-06004");
67 m_errorMonitor->SetDesiredError("VUID-VkCommandBufferInheritanceRenderingInfo-variableMultisampleRate-06005");
68 m_errorMonitor->SetDesiredError("VUID-VkCommandBufferInheritanceRenderingInfo-depthAttachmentFormat-06007");
69 m_errorMonitor->SetDesiredError("VUID-VkCommandBufferInheritanceRenderingInfo-multiview-06008");
70 if (multiview_props.maxMultiviewViewCount != 32) {
71 m_errorMonitor->SetDesiredError("VUID-VkCommandBufferInheritanceRenderingInfo-viewMask-06009");
72 }
73 m_errorMonitor->SetDesiredError("VUID-VkCommandBufferInheritanceRenderingInfo-stencilAttachmentFormat-06199");
74 m_errorMonitor->SetDesiredError("VUID-VkCommandBufferInheritanceRenderingInfo-depthAttachmentFormat-06200");
75
76 m_errorMonitor->SetDesiredError("VUID-VkCommandBufferInheritanceRenderingInfo-pColorAttachmentFormats-06492");
77 m_errorMonitor->SetDesiredError("VUID-VkCommandBufferInheritanceRenderingInfo-depthAttachmentFormat-06540");
78 m_errorMonitor->SetDesiredError("VUID-VkCommandBufferInheritanceRenderingInfo-stencilAttachmentFormat-06541");
79
80 VkCommandBufferBeginInfo cmd_buffer_begin_info = vku::InitStructHelper();
81 cmd_buffer_begin_info.flags = VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT;
82 cmd_buffer_begin_info.pInheritanceInfo = &cmd_buffer_inheritance_info;

Callers

nothing calls this directly

Calls 15

AllocateCommandBuffersFunction · 0.85
CmdBindPipelineFunction · 0.85
CmdDrawFunction · 0.85
CmdSetDepthWriteEnableFunction · 0.85
CmdSetStencilWriteMaskFunction · 0.85
GetImageFormatPropsFunction · 0.85
CmdClearAttachmentsFunction · 0.85
CmdExecuteCommandsFunction · 0.85
CreateFramebufferFunction · 0.85
DestroyFramebufferFunction · 0.85

Tested by

no test coverage detected