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

Method GetMemoryReqs

tests/framework/binding.cpp:1306–1335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1304}
1305
1306void DataGraphPipelineSession::GetMemoryReqs() {
1307 VkDataGraphPipelineSessionBindPointRequirementsInfoARM bind_info = vku::InitStructHelper();
1308 bind_info.session = handle();
1309 uint32_t count = 0;
1310 vk::GetDataGraphPipelineSessionBindPointRequirementsARM(*device_, &bind_info, &count, nullptr);
1311 bind_point_reqs_.resize(count, vku::InitStructHelper());
1312 vk::GetDataGraphPipelineSessionBindPointRequirementsARM(*device_, &bind_info, &count, bind_point_reqs_.data());
1313
1314 mem_reqs_.resize(count);
1315 for (uint32_t i = 0; i < count; i++) {
1316 if (bind_point_reqs_[i].bindPointType != VK_DATA_GRAPH_PIPELINE_SESSION_BIND_POINT_TYPE_MEMORY_ARM) {
1317 continue;
1318 }
1319 VkDataGraphPipelineSessionMemoryRequirementsInfoARM session_mem_reqs = vku::InitStructHelper();
1320 session_mem_reqs.session = handle();
1321 session_mem_reqs.bindPoint = bind_point_reqs_[i].bindPoint;
1322 mem_reqs_[i] = vku::InitStructHelper();
1323 vk::GetDataGraphPipelineSessionMemoryRequirementsARM(*device_, &session_mem_reqs, &mem_reqs_[i]);
1324 }
1325
1326 const char *incorrect_spirv_msg = "test incorrect. Possible causes: incorrect spirv, or inconsistency between spirv and tensor/constant declarations\n";
1327 if (mem_reqs_.empty()) {
1328 GTEST_FAIL() << "No bind points, " << incorrect_spirv_msg;
1329 }
1330 for (uint32_t i = 0; i < mem_reqs_.size(); i++) {
1331 if (mem_reqs_[i].memoryRequirements.size == 0) {
1332 GTEST_FAIL() << "No memory for binding " << i << ", " << incorrect_spirv_msg;
1333 }
1334 }
1335}
1336
1337void DataGraphPipelineSession::AllocSessionMem(std::vector<vkt::DeviceMemory>& device_mem, bool is_protected, size_t scale_factor,
1338 int32_t size_modifier) {

Callers 4

BindToMemMethod · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80

Calls 6

resizeMethod · 0.45
dataMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected