Page 1 of 1

Possible AMD GPU driver issue when using VK_FORMAT_UNDEFINED as param for vkCreateImage

Posted: Mon Apr 21, 2025 7:53 pm
by Hotshot5000

While porting an engine from a pre-release v2.1 Ogre version to 3.0 I noticed that if I pass an invalid format such as PFG_RGB8_UNORM to VulkanTextureGpu::createInternalResourcesImpl() then imageInfo.format = VulkanMappings::get( finalPixelFormat ); returns VK_FORMAT_UNDEFINED which gets passed in vkCreateImage() as value in VkImageCreateInfo.

This returns success somehow but presumably with rendering errors later (I don't know for sure since I have more than one rendering issues at this time so I can't say for certain which is coming from this).

When trying the same code with the dedicated nVidia graphics I get a crash. (which in this case it's preferrable).

AMD laptop GPU:
AMD Radeon Vega
Codename Cezanne with CPU 5800H integrated GPU.
AMD Software Driver Version: 24.9.1

Nvidia GPU:
NVIDIA GeForce RTX 3070 Laptop
Driver Version: 32.0.15.7283 (GeForce 572.83)


Re: Possible AMD GPU driver issue when using VK_FORMAT_UNDEFINED as param for vkCreateImage

Posted: Tue Apr 22, 2025 1:56 am
by dark_sylinc

Hi!

Vulkan code should always be tested against Validation Layers before deploying to production, which will find the error.
This is not an AMD GPU driver bug, because the spec says non-compliant code will result in undefined behavior.

Anyway, we should still at least have an assert to check if you hit this condition, thus I added one.

Thanks for the report!


Re: Possible AMD GPU driver issue when using VK_FORMAT_UNDEFINED as param for vkCreateImage

Posted: Tue Apr 22, 2025 1:41 pm
by Hotshot5000

You're welcome! I completely forgot about enabling the validation layers when I moved the setup from macOS to Windows.