phr00t / FocusEngine

Focus Game Engine. This is Stride/Xenko fast-tracked for Phr00t's Software games. Improvements over the original Focus on Vulkan support, PC platforms, VR, performance & ease. Cherry-picks commits from other forks as needed.
MIT License
97 stars 11 forks source link

Vulkan Validation errors with GetWhiteTexture #55

Closed phr00t closed 5 years ago

phr00t commented 5 years ago

When creating a simple white texture for use as a shader resource, Vulkan ends up complaining about quite a bit:

Error: [ VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184 ] Object: 0x1be37261a88 (Type = 6) | vkCmdPipelineBarrier(): pBufferMemBarriers[0].srcAccessMask (0x4000) is not supported by srcStageMask (0x1). The Vulkan spec states: Each element of pMemoryBarriers, pBufferMemoryBarriers and pImageMemoryBarriers must not have any access flag included in its srcAccessMask member if that bit is not supported by any of the pipeline stages in srcStageMask, as specified in the table of supported access types. (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184) ([0] Validation)

Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object: 0x1be37261a88 (Type = 6) | Submitted command buffer expects image 0x39 (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL--instead, image 0x39's current layout is VK_IMAGE_LAYOUT_UNDEFINED. ([0] Validation)

The white texture starts to get made here: https://github.com/phr00t/xenko/blob/master/sources/engine/Xenko.Graphics/GraphicsDeviceExtensions.cs#L92

phr00t commented 5 years ago

Fixed with https://github.com/phr00t/xenko/commit/17fc399e8fd133e4ea9c328795e4cc772c925617