Skip to content

tests: Test resources with too many mip levels.

Some games (i.e. Zombie Army 4 Dead War) create resources with more mip levels than should be allowed. The D3D12 debug layer emits an error, but the runtime still serves the request. The additional mip levels are just 1x1, like the last regular one; and they are true mip levels, i.e., they do not alias to each other, as the first commit proves.

Creating too many mip levels is illegal in Vulkan too. Nvidia proprietary driver behaves as Windows, though. RADV does mostly the same, but at least with a 32x32 texture and 10 mip levels the last two levels alias to each other (the other levels do not). At any rate, neither of those crashes.

MoltenVK instead crashes: Metal has an explicit assertion about that when image views are created (even when the Metal debug layer is disabled). From a Vulkan viewpoint this is completely legitimate, as far as I can tell.

I don't think there is an easy way to support the de facto D3D12 behavior with valid Vulkan; creating additional 1x1 resources and recompiling shaders so they pick those when needed seems very complicated and also likely inefficient at runtime. Zombie Army 4 Dead War likely doesn't need all of that to work properly, so some lighter change might be enough to avoid crashing on Metal. I'll study that better in the next few days, for the moment here are the tests.

Merge request reports

Loading