KyleMayes / vulkanalia

Vulkan bindings for Rust.
Apache License 2.0
267 stars 30 forks source link

Validation Warnings on Device Creation #281

Closed CyclotomicDev closed 2 months ago

CyclotomicDev commented 3 months ago

Recently switched from Windows to Manjaro (Linux), and all my projects using this crate now give the following validation warnings from a call to Instance::create_device:

[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceCalibrateableTimeDomainsEXT which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceCalibrateableTimeDomainsKHR which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceCooperativeMatrixPropertiesNV which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceFragmentShadingRatesKHR which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceMultisamplePropertiesEXT which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceOpticalFlowImageFormatsNV which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDevicePresentRectanglesKHR which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceToolPropertiesEXT which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceVideoCapabilitiesKHR which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR which is an instance level function
[00:00:00.067] (77bf3d51ac00) WARN   (VALIDATION) Validation Warning: [ WARNING-vkGetDeviceProcAddr-device ] | MessageID = 0x22b1fbac | vkGetDeviceProcAddr(): pName is trying to grab vkGetPhysicalDeviceVideoFormatPropertiesKHR which is an instance level function

This is the case for the tutorial code ,"04_logical_device.rs", but not for the corresponding C++ tutorial code.

KyleMayes commented 3 months ago

Well, this is awkward, it breaks my entire method for organizing extensions.

I didn't realize that there are functions like these that are defined in device-level extensions but are expected to be loaded from the instance rather than the device.

I'll need to think about how to handle functions/extensions like these.

KyleMayes commented 2 months ago

I've fixed the immediate issue (loading these commands with the device loader function instead of the instance loader function).

I opened https://github.com/KyleMayes/vulkanalia/issues/286 to look into allowing users to easily call these commands with only an instance (if the commands are available).