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

Question about instance flags validation and debug #327

Open
almarklein opened this issue Dec 1, 2023 · 2 comments
Open

Question about instance flags validation and debug #327

almarklein opened this issue Dec 1, 2023 · 2 comments
Labels
question Further information is requested

Comments

@almarklein
Copy link
Collaborator

Recently the WGPUInstanceExtras struct was added, enabling setting WGPUInstanceFlag_Debug and WGPUInstanceFlag_Validation. These directly map to wgpu-types flags:

wgpu-native/src/conv.rs

Lines 260 to 272 in fcc480b

pub fn map_instance_flags(flags: native::WGPUInstanceFlag) -> wgt::InstanceFlags {
let mut result = wgt::InstanceFlags::empty();
if (flags & native::WGPUInstanceFlag_Debug) != 0 {
result.insert(wgt::InstanceFlags::DEBUG);
}
if (flags & native::WGPUInstanceFlag_Validation) != 0 {
result.insert(wgt::InstanceFlags::VALIDATION);
}
if (flags & native::WGPUInstanceFlag_DiscardHalLabels) != 0 {
result.insert(wgt::InstanceFlags::DISCARD_HAL_LABELS);
}
result
}

Questions:

How are things different when (either of) these flags is enabled?

Is the validation flag related to Vulkan validation layers or is the validation specific to wgpu?

How does the debug flag relate to wgpuSetLogLevel(WGPULogLevel_Debug)?

@almarklein almarklein added the question Further information is requested label Dec 1, 2023
@cwfitzgerald
Copy link
Member

Is the validation flag related to Vulkan validation layers or is the validation specific to wgpu?

vulkan/dx12 validation layers. It probably should be renamed to like "underlying validation".

How does the debug flag relate to wgpuSetLogLevel(WGPULogLevel_Debug)?

It doesn't, this is about debug information in shaders and such.

@almarklein
Copy link
Collaborator Author

Thanks for the answers. Sorry for the many questions. This looks like something that can be a handy debugging tool, but I still don't understand what to expect 😊

It says here "Enable validation, if possible". Under what conditions is it possible, and how do I know that its enabled?

How is this related to enabling the Vulkan validation layers via the Lunar SDK (by opening the Vulkan Configurator)?

If more validation is done, what effect does this have in practice? Will it be more strict and fail if these stricter conditions are not met, or is there more information written to the logger?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants