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

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Hotshot5000
OGRE Contributor
OGRE Contributor
Posts: 256
Joined: Thu Oct 14, 2010 12:30 pm
x 64

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

Post 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)

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5496
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1365

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

Post 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!

Hotshot5000
OGRE Contributor
OGRE Contributor
Posts: 256
Joined: Thu Oct 14, 2010 12:30 pm
x 64

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

Post by Hotshot5000 »

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