Skip to content

Commit

Permalink
Add buffer device address tests to internal testing
Browse files Browse the repository at this point in the history
Also fix validation error when we pass our fake extension
pNext chains from them to the driver.
  • Loading branch information
per-mathisen-arm committed Oct 28, 2024
1 parent b3f66b0 commit 74f8a3a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,10 @@ layer_test(memory_1_1 memory_1_1)
layer_test(thread_1 thread_1)
layer_test(thread_2 thread_2)
layer_test(thread_3 thread_3)
layer_test(compute_bda_sc compute_bda_sc)
layer_test(compute_bda_pushconstant compute_bda_pushconstant)
layer_test(compute_bda_ubo compute_bda_ubo)
layer_test(compute_bda_ubo_ssbo compute_bda_ubo --ssbo)
add_test(NAME layer_test_thread_3_replay_blackhole_stress_1 COMMAND ${CMAKE_CURRENT_BINARY_DIR}/lava-replay -V -B vulkan_thread_3.vk)
set_tests_properties(layer_test_thread_3_replay_blackhole_stress_1 PROPERTIES FIXTURES_REQUIRED thread_3)
add_test(NAME layer_test_thread_3_replay_blackhole_stress_2 COMMAND ${CMAKE_CURRENT_BINARY_DIR}/lava-replay -D -B vulkan_thread_3.vk)
Expand Down
11 changes: 11 additions & 0 deletions src/hardcode_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,8 @@ void replay_pre_vkCmdPushConstants2KHR(lava_file_reader& reader, VkCommandBuffer
assert(pPushConstantsInfo->pValues);
assert(pPushConstantsInfo->size >= remap->count);
translate_addresses(reader, remap->count, remap->pOffsets, const_cast<void*>(pPushConstantsInfo->pValues));
// make sure we don't leak this to the driver, as this would break validation
purge_extension_parent(const_cast<VkPushConstantsInfoKHR*>(pPushConstantsInfo), VK_STRUCTURE_TYPE_ADDRESS_REMAP_TRACETOOLTEST);
}

void replay_pre_vkCreateComputePipelines(lava_file_reader& reader, VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount,
Expand All @@ -1040,6 +1042,9 @@ void replay_pre_vkCreateComputePipelines(lava_file_reader& reader, VkDevice devi
assert(pCreateInfos[i].stage.pSpecializationInfo->dataSize >= remap->count);

translate_addresses(reader, remap->count, remap->pOffsets, const_cast<void*>(pCreateInfos[i].stage.pSpecializationInfo->pData));

// make sure we don't leak this to the driver, as this would break validation
purge_extension_parent(const_cast<VkPipelineShaderStageCreateInfo*>(&pCreateInfos[i].stage), VK_STRUCTURE_TYPE_ADDRESS_REMAP_TRACETOOLTEST);
}
}

Expand All @@ -1058,6 +1063,9 @@ void replay_pre_vkCreateGraphicsPipelines(lava_file_reader& reader, VkDevice dev
assert(pCreateInfos[i].pStages[stage].pSpecializationInfo->dataSize >= remap->count);

translate_addresses(reader, remap->count, remap->pOffsets, const_cast<void*>(pCreateInfos[i].pStages[stage].pSpecializationInfo->pData));

// make sure we don't leak this to the driver, as this would break validation
purge_extension_parent(const_cast<VkPipelineShaderStageCreateInfo*>(&pCreateInfos[i].pStages[stage]), VK_STRUCTURE_TYPE_ADDRESS_REMAP_TRACETOOLTEST);
}
}
}
Expand All @@ -1077,6 +1085,9 @@ void replay_pre_vkCreateRayTracingPipelinesKHR(lava_file_reader& reader, VkDevic
assert(pCreateInfos[i].pStages[stage].pSpecializationInfo->dataSize >= remap->count);

translate_addresses(reader, remap->count, remap->pOffsets, const_cast<void*>(pCreateInfos[i].pStages[stage].pSpecializationInfo->pData));

// make sure we don't leak this to the driver, as this would break validation
purge_extension_parent(const_cast<VkPipelineShaderStageCreateInfo*>(&pCreateInfos[i].pStages[stage]), VK_STRUCTURE_TYPE_ADDRESS_REMAP_TRACETOOLTEST);
}
}
}
Expand Down

0 comments on commit 74f8a3a

Please sign in to comment.