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

Function TEST_F

tests/unit/gpu_dump.cpp:66–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66TEST_F(NegativeGpuDump, Descriptors) {
67 RETURN_IF_SKIP(InitDescriptorBuffer());
68
69 VkDescriptorSetLayoutBinding binding = {0, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_ALL, nullptr};
70 vkt::DescriptorSetLayout ds_layout(*m_device, binding, VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT);
71 vkt::PipelineLayout pipeline_layout(*m_device, {&ds_layout});
72
73 VkDeviceSize ds_layout_size = ds_layout.GetDescriptorBufferSize();
74 vkt::Buffer descriptor_buffer(*m_device, ds_layout_size, VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT,
75 vkt::device_address);
76
77 vkt::Buffer buffer_data(*m_device, 16, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, vkt::device_address);
78 vkt::DescriptorGetInfo get_info(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, buffer_data, 16);
79
80 void* mapped_descriptor_data = descriptor_buffer.Memory().Map();
81 vk::GetDescriptorEXT(device(), get_info, descriptor_buffer_props.storageBufferDescriptorSize, mapped_descriptor_data);
82
83 const char* cs_source = R"glsl(
84 #version 450
85 layout (set = 0, binding = 0) buffer SSBO_0 {
86 uint a;
87 };
88 void main() {
89 a = 0;
90 }
91 )glsl";
92
93 CreateComputePipelineHelper pipe(*this);
94 pipe.cs_ = VkShaderObj(*m_device, cs_source, VK_SHADER_STAGE_COMPUTE_BIT, SPV_ENV_VULKAN_1_2);
95 pipe.cp_ci_.flags |= VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT;
96 pipe.cp_ci_.layout = pipeline_layout;
97 pipe.CreateComputePipeline();
98
99 m_command_buffer.Begin();
100 vk::CmdBindPipeline(m_command_buffer, VK_PIPELINE_BIND_POINT_COMPUTE, pipe);
101
102 VkDescriptorBufferBindingInfoEXT descriptor_buffer_binding_info = vku::InitStructHelper();
103 descriptor_buffer_binding_info.address = descriptor_buffer.Address();
104 descriptor_buffer_binding_info.usage = VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT;
105 vk::CmdBindDescriptorBuffersEXT(m_command_buffer, 1, &descriptor_buffer_binding_info);
106
107 uint32_t buffer_index = 0;
108 VkDeviceSize buffer_offset = 0;
109 vk::CmdSetDescriptorBufferOffsetsEXT(m_command_buffer, VK_PIPELINE_BIND_POINT_COMPUTE, pipeline_layout, 0, 1, &buffer_index,
110 &buffer_offset);
111 m_errorMonitor->SetDesiredInfo("GPU-DUMP");
112 vk::CmdDispatch(m_command_buffer, 1, 1, 1);
113 m_errorMonitor->VerifyFound();
114 m_command_buffer.End();
115}
116
117TEST_F(NegativeGpuDump, DescriptorBufferWithoutDescriptor) {
118 TEST_DESCRIPTION("https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/12250");

Callers

nothing calls this directly

Calls 15

GetDescriptorEXTFunction · 0.85
VkShaderObjClass · 0.85
CmdBindPipelineFunction · 0.85
CmdDispatchFunction · 0.85
CmdPushConstantsFunction · 0.85
CmdDrawFunction · 0.85
CmdCopyMemoryIndirectKHRFunction · 0.85
FlushMappedMemoryRangesFunction · 0.85
CmdCopyBufferFunction · 0.85
CmdBindResourceHeapEXTFunction · 0.85
MakeSetAndBindingMappingFunction · 0.85

Tested by

no test coverage detected