Conversation
fba9eda to
abd053c
Compare
abd053c to
0af559d
Compare
| VKAPI_ATTR VkResult VKAPI_CALL layer_vkCreateSwapchainKHR<user_tag>(VkDevice device, | ||
| const VkSwapchainCreateInfoKHR* pCreateInfo, | ||
| const VkAllocationCallbacks* pAllocator, | ||
| VkSwapchainKHR* pSwapchain |
There was a problem hiding this comment.
Closing brace on same line as last parameter to keep clang=tidy happy. Ditto below.
There was a problem hiding this comment.
Reformatted everywhere, I hope. Do we have something to check that all the formatting is compliant?
layer_gpu_support/source/layer_device_functions_allocate_memory.cpp
Outdated
Show resolved
Hide resolved
| if (ci->arrayLayers != 1) return false; // Might introduce false negative, stereo images are excluded | ||
|
|
||
| // Prefer common present-ish color formats. | ||
| switch (ci->format) { |
There was a problem hiding this comment.
Brace on new line for coding style. (Ditto in all the files, not tracking per instance).
| // -------------------------------------------- | ||
| // Heuristic + external export intent detection | ||
| // -------------------------------------------- | ||
| const bool present_like = heuristic_is_present_like_image(pCreateInfo); |
There was a problem hiding this comment.
Don't we know which images came from the swapchain via vkGetSwapchainImagesKHR()? Can't we just track those, and avoid the heuristic based on format alone?
There was a problem hiding this comment.
The need for this heuristic arose from a Vulkan application (specifically, gfxreconstruct) that was replaying a trace originally captured on an Android device using an AHB for presentation. When replayed on a Linux platform, no swapchain was created, and the AHB was ignored, resulting in no presentation at all.
We’ve since developed a patch in gfxreconstruct to address this issue: a valid swapchain is now created when this situation occurs. However, this change has not yet been merged into either the downstream or upstream official releases.
I suspect there may be other scenarios where such a heuristic could also prove useful. Please share your thoughts on whether we should keep it or remove it.
| VkImageCompressionControlEXT* compressionControl = &newCompressionControl; | ||
| auto append = [&](VkBaseOutStructure* n){ | ||
| n->pNext = nullptr; | ||
| if (!rebuilt_head) rebuilt_head = rebuilt_tail = n; |
There was a problem hiding this comment.
Coding style follows MISRA for bracing (if/else should always use braces, and body should be on different line to the condition). It's a lot more readable than long one-liners.
layer_gpu_support/source/layer_instance_functions_get_physical_properties.cpp
Outdated
Show resolved
Hide resolved
520cf16 to
cdcf94c
Compare
cdcf94c to
93221b9
Compare
This PR allows to disable only external compression, while leaving internal compression untouched, it also include an heuristic in case there is no swapchain creation / presentation that acts on vkCreateImage. Presentations case handled: WSI Swapchain, DMA-buf import/export, AHB import/export. For DMA-buf and AHB import, an error is returned as it is not possible to control external compression with a Vulkan layer.