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

Function TEST_F

tests/unit/sparse_image.cpp:21–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19class NegativeSparseImage : public VkLayerTest {};
20
21TEST_F(NegativeSparseImage, BindingImageBufferCreate) {
22 TEST_DESCRIPTION("Create buffer/image with sparse attributes but without the sparse_binding bit set");
23 AddRequiredFeature(vkt::Feature::sparseResidencyAliased);
24 AddRequiredFeature(vkt::Feature::sparseResidencyBuffer);
25 AddRequiredFeature(vkt::Feature::sparseResidencyImage2D);
26 RETURN_IF_SKIP(Init());
27
28 VkBufferCreateInfo buffer_create_info = vku::InitStructHelper();
29 buffer_create_info.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
30 buffer_create_info.size = 2048;
31
32 if (m_device->Physical().Features().sparseResidencyBuffer) {
33 buffer_create_info.flags = VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT;
34 CreateBufferTest(buffer_create_info, "VUID-VkBufferCreateInfo-flags-00918");
35 } else {
36 GTEST_SKIP() << "Test requires unsupported sparseResidencyBuffer feature";
37 }
38
39 if (m_device->Physical().Features().sparseResidencyAliased) {
40 buffer_create_info.flags = VK_BUFFER_CREATE_SPARSE_ALIASED_BIT;
41 CreateBufferTest(buffer_create_info, "VUID-VkBufferCreateInfo-flags-00918");
42 } else {
43 GTEST_SKIP() << "Test requires unsupported sparseResidencyAliased feature";
44 }
45
46 VkImageCreateInfo image_create_info = vku::InitStructHelper();
47 image_create_info.imageType = VK_IMAGE_TYPE_2D;
48 image_create_info.format = VK_FORMAT_R8G8B8A8_UNORM;
49 image_create_info.extent = {512, 64, 1};
50 image_create_info.mipLevels = 1;
51 image_create_info.arrayLayers = 1;
52 image_create_info.samples = VK_SAMPLE_COUNT_1_BIT;
53 image_create_info.tiling = VK_IMAGE_TILING_OPTIMAL;
54 image_create_info.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;
55 image_create_info.usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
56
57 if (m_device->Physical().Features().sparseResidencyImage2D) {
58 image_create_info.flags = VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT;
59 CreateImageTest(image_create_info, "VUID-VkImageCreateInfo-flags-00987");
60 } else {
61 GTEST_SKIP() << "Test requires unsupported sparseResidencyImage2D feature";
62 }
63
64 if (m_device->Physical().Features().sparseResidencyAliased) {
65 image_create_info.flags = VK_IMAGE_CREATE_SPARSE_ALIASED_BIT;
66 CreateImageTest(image_create_info, "VUID-VkImageCreateInfo-flags-00987");
67 } else {
68 GTEST_SKIP() << "Test requires unsupported sparseResidencyAliased feature";
69 }
70}
71
72TEST_F(NegativeSparseImage, ResidencyImageCreateUnsupportedTypes) {
73 TEST_DESCRIPTION("Create images with sparse residency with unsupported types");

Callers

nothing calls this directly

Calls 15

QueueBindSparseFunction · 0.85
IgnoreHandleTypeErrorFunction · 0.85
GetCompatibleHandleTypesFunction · 0.85
GetMemoryWin32HandleKHRFunction · 0.85
GetMemoryFdKHRFunction · 0.85
size32Function · 0.85
FeaturesMethod · 0.80

Tested by

no test coverage detected