Skip to content

Commit

Permalink
igl | vulkan | tests | Bail out of buffer device address unit tests i…
Browse files Browse the repository at this point in the history
…f the feature isn't supported by the device

Summary: Title

Reviewed By: rokuz

Differential Revision: D62134203

fbshipit-source-id: 005ecd874fb7e1c27d9e50b6d32de5ea003a8910
  • Loading branch information
mmaurer authored and facebook-github-bot committed Sep 3, 2024
1 parent d6571b7 commit 5760d99
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/igl/tests/vulkan/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,6 @@ GTEST_TEST(VulkanContext, BufferDeviceAddress) {

auto ctx = igl::vulkan::HWDevice::createContext(config, nullptr);

igl::vulkan::VulkanFeatures availableFeatures(VK_MAKE_VERSION(1, 1, 0), config);
availableFeatures.populateWithAvailablePhysicalDeviceFeatures(*ctx, ctx->getVkPhysicalDevice());

// If the device doesn't support buffer device address, we can't use it for testing
if (availableFeatures.VkPhysicalDeviceBufferDeviceAddressFeaturesKHR_.bufferDeviceAddress ==
VK_FALSE) {
return;
}

Result ret;

std::vector<HWDeviceDesc> devices =
Expand All @@ -157,14 +148,23 @@ GTEST_TEST(VulkanContext, BufferDeviceAddress) {
ASSERT_TRUE(!devices.empty());

if (ret.isOk()) {
igl::vulkan::VulkanFeatures features(VK_API_VERSION_1_1, config);
features.populateWithAvailablePhysicalDeviceFeatures(*ctx, (VkPhysicalDevice)devices[0].guid);

const VkPhysicalDeviceBufferDeviceAddressFeaturesKHR& bdaFeatures =
features.VkPhysicalDeviceBufferDeviceAddressFeaturesKHR_;
if (!bdaFeatures.bufferDeviceAddress) {
return;
}

const std::vector<const char*> extraDeviceExtensions;
iglDev = igl::vulkan::HWDevice::create(std::move(ctx),
devices[0],
0, // width
0, // height,
0,
nullptr,
&availableFeatures,
&features,
&ret);

if (!ret.isOk()) {
Expand Down

0 comments on commit 5760d99

Please sign in to comment.