Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requesting extension features also enables all available features #938

Open
SaschaWillems opened this issue Feb 23, 2024 · 1 comment · May be fixed by #1013
Open

Requesting extension features also enables all available features #938

SaschaWillems opened this issue Feb 23, 2024 · 1 comment · May be fixed by #1013
Labels
framework This is relevant to the framework

Comments

@SaschaWillems
Copy link
Collaborator

SaschaWillems commented Feb 23, 2024

In a lot of samples we do something like this:

auto &requested_extension_features = gpu.request_extension_features<VkPhysicalDeviceSomeExtensionFeaturesKHR>(VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SOME_EXTENSION_FEATURES_KHR);
requested_extension_features.someFeature = VK_TRUE;

But the call to gpu.request_extension_features already sets all supported features to true by calling vkGetPhysicalDeviceFeatures2KHR, which makes the second line (enabling a feature) superfluous.

This doesn't do any harm, but it might confuse people trying to write or debug samples.

@asuessenbach
Copy link
Contributor

asuessenbach commented Mar 11, 2024

One could introduce a new function vkb::PhysicalDevice::get_extension_features<ExtensionFeatureStruct> that could be used like this:

	if (gpu.get_extension_features<VkPhysicalDeviceHostQueryResetFeaturesEXT>().hostQueryReset)
	{
		gpu.request_extension_features<VkPhysicalDeviceHostQueryResetFeaturesEXT>().hostQueryReset= VK_TRUE;
	}

... and would need to adjust all usages of request_extension_features accordingly!
... and modify request_extension_features such that it returns either an empty features struct, or the one already requested before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework This is relevant to the framework
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants