Skip to content

Commit

Permalink
Setup extensions from device builder
Browse files Browse the repository at this point in the history
  • Loading branch information
beau-lunarg committed Nov 4, 2024
1 parent 508d8f9 commit 5833c9a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test_apps/common/test_app_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2962,6 +2962,18 @@ void TestAppBase::configure_physical_device_selector(PhysicalDeviceSelector& phy
void TestAppBase::configure_device_builder(DeviceBuilder& device_builder, PhysicalDevice const& physical_device) {}
void TestAppBase::configure_swapchain_builder(SwapchainBuilder& swapchain_builder) {}

bool DeviceBuilder::enable_extension_if_present(const char* extension) {
return physical_device.enable_extension_if_present(extension);
}

bool DeviceBuilder::enable_extensions_if_present(const std::vector<const char*>& extensions) {
return physical_device.enable_extensions_if_present(extensions);
}

bool DeviceBuilder::enable_features_if_present(const VkPhysicalDeviceFeatures& features_to_enable) {
return physical_device.enable_features_if_present(features_to_enable);
}

GFXRECON_END_NAMESPACE(test)

GFXRECON_END_NAMESPACE(gfxrecon)
18 changes: 18 additions & 0 deletions test/test_apps/common/test_app_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,24 @@ class DeviceBuilder
return *this;
}

bool enable_extension_if_present(const char* extension);

// If all the given extensions are present, make all the extensions be enabled on the device.
// Returns true if all the extensions are present.
bool enable_extensions_if_present(const std::vector<const char*>& extensions);

// If the features from VkPhysicalDeviceFeatures are all present, make all of the features be enable on the device.
// Returns true if all the features are present.
bool enable_features_if_present(const VkPhysicalDeviceFeatures& features_to_enable);

// If the features from the provided features struct are all present, make all of the features be enable on the
// device. Returns true if all of the features are present.
template <typename T>
bool enable_extension_features_if_present(T const& features_check)
{
return physical_device.enable_extension_features_if_present(features_check);
}

// Provide custom allocation callbacks.
DeviceBuilder& set_allocation_callbacks(VkAllocationCallbacks* callbacks);

Expand Down

0 comments on commit 5833c9a

Please sign in to comment.