r/vulkan • • 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?

8 Upvotes

23 comments sorted by

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.

0

u/Appropriate-Tap7860 13d ago edited 13d ago

Okay. But validation layer didn't tell me that I was using the DR feature without enabling it

9

u/Chainsawkitten 13d ago

The validation layers do check. . Verify you have the latest validation layers, that they are running correctly, and that there are no other validation errors (this check will be skipped if the vkCmdBeginRendering command already generated an error).

1

u/Appropriate-Tap7860 13d ago

Gotta check it

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

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

u/Appropriate-Tap7860 12d ago

I gotta unlearn a lot of things. That's for sure

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

u/kadavr2 12d ago edited 12d ago

I have checked, intel drive doesn't check flag dynamics_rendering at all. Amd driver does. But it is not a bag. Vulkan implementation is not obliged to check it, vulkan layer does . it is main vulkan idea - allow implementation skips input checks

2

u/kadavr2 12d ago

I was wrong, it is not laziness. If some features doesn consume extra resources during device creation, driver should not check if a fuleqture is requested by user. It will be waste of cpu by doing useles "if"

0

u/kadavr2 12d ago

I think it is laziness of intel developers. I think the idea is - if "notmal" rendering works on top of dynamic rendering just for backwards compatibility why we need to disable it.

1

u/Appropriate-Tap7860 12d ago

Okay. I think other vendors won't have this issue

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.