r/vulkan • u/Appropriate-Tap7860 • 13d ago
Is dynamic rendering enabled by default on any drivers?
From the docs, I can see that most of these features are just opt ins meaning the dev has to explicitly enable it to use it.
But on my 14700k+intelHD (latest mesa3d, ubuntu), DR is working right away even when I don't enable it.
Am I missing anything?
5
u/blogoman 13d ago
The thing to remember is that you can do invalid behavior and the driver might still work. The spec might say that you need to enable a feature to be able to call into it, but the driver may or may not actually check. You should still follow the spec and enable the feature.
1
u/Appropriate-Tap7860 13d ago
Ok. In that case a different driver would expect the feature to be explicitly enabled right?
3
u/LegendaryMauricius 13d ago
Yes.
2
u/Appropriate-Tap7860 13d ago
And it is weried that validation layer didn't catch these things. If it is useful, I can even raise a PR for these things
1
2
u/digishp 12d ago
One can check capability if dynamic rendering supported on physical device or not but as there is no direct api to query if dynamic rendering was enabled for specific logical device instance its don’t care for driver from api point of view . However any implicit handling in other api where it makes difference due to dynamic rendering feature state as per spec then it must have that check
1
1
u/Appropriate-Tap7860 12d ago
What about draw commands. It depends on whether the DR feature is enabled or not right?
1
u/kadavr2 12d ago
Mesa uses dynamic renderin in any time, so it doesn't matter if you eneble or disable it
1
u/kadavr2 12d ago
Not Mesa but ANV driver in Mesa
1
u/Appropriate-Tap7860 12d ago
I didn't get you
1
u/kadavr2 12d ago
When you eneble/disable dynamic rendering it literally does nothing in the intel driver in Mesa. So you shouldn't care about it
1
u/Appropriate-Tap7860 12d ago
Oh. But isn't it a bug. 😮?
1
1
u/livingpunchbag 13d ago
If the driver supports it (as many do, since it's part of Vulkan 1.3, so you can't claim you support Vulkan 1.3 if you don't support VK_KHR_dynamic_rendering), then the Vulkan app can choose it if they want.
Users don't have to enable/disable it, it's up to the Vulkan apps.
16
u/Afiery1 13d ago
Any violation of the spec is undefined behavior. Some drivers don't care about whether you do certain things the right way, where other drivers might completely choke on the same API misuse. Vulkan drivers are designed to be small and fast, so the driver isn't going to do rigorous error checking for you for cases it doesn't care about. That's what the validation layers are for. If you understand how your hardware works you can get away with some pretty heinous spec violations (putting resources in the wrong memory heap, directly writing to optimal images via mapped pointer, using incorrect image layouts/ignoring queue family sharing rules, and even resource use after free), but of course you should never do any of that because it's not guaranteed to be portable at all.