-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for VK_EXT_image_drm_format_modifier #1194
Comments
Generally for extensions KHR are highly likely to be supported at some point, and EXT extensions are generally planned but priority may vary. Knowing which extensions are actually used and desired helps though. VK_KHR_sampler_ycbcr_conversion is already supported as it's part of core 1.1 Vulkan - I assume you meant specifically that you want the physical device feature to be enabled? For these extensions in particular it would greatly help to have a simple test case that exercises them in a non-trivial way, as implementing extensions 'blind' can easily lead to inadvertent bugs. |
Background: Inspecting some issue where application is using both these extensions. in renderdoc/driver/vulkan/vk_core.cpp
And compiled renderdoc locally. This way I could capture frame the renderdoc. (Otherwise application would exit because of renderdoc not exposing the extension. I do think we need to do changes at more place to serialize and save the specifics, After successful capture, On replaying I am getting crash with vkCreateImage() being passed invalid sizes. I am not sure if it is because of my renderdoc change , unsupported extensions by rdoc / application issue. I may try to add support in my local copy if you can guide me. |
Yes the reason for the To support an extension RenderDoc needs to handle all function calls, structures etc that are part of that extension, both on capture and replay. What is needed to support an extension varies depending on what the extension actually provides. |
I will check codes how to implement it then. By the way, does that mean i cannot use YCbCr samplers ?
Is VK_KHR_sampler_ycbcr_conversion atleast supported then ? |
Yes the extension is supported as it's part of Vulkan 1.1 core, but the physical device feature is marked as not available meaning you can't use ycbcr samplers. This is the same as it would look if a device driver reported the extension but didn't report ycbcr sampler support. |
What would be the behaviour if application still use it when running in renderdoc context (ignore the physical device feature) So the renderdoc will not pass through the information to underlying actual device driver ? Thanks for your reply. |
I don't know, the application is then breaking the vulkan spec by using features that are reported as unavailable and haven't been enabled. As I mentioned above this may crash during capture, during replay, it may replay incorrectly, or it might work fine for 99% of cases and break in 1%. A correct vulkan application should make sure it enumerates the available extensions and features. Your code must not use features that aren't reported, and then it will work correctly with RenderDoc. |
I understand. Thanks for the explanation |
I've pushed support for ycbcr conversion samplers and displaying YUV textures (in D3D as well as Vulkan), which addresses part of what you were asking for. I don't know when I'll get to |
Thank you for your prompt reply. Is there any similar code in the tree which i can refer to start basic implementation to make it work. Thanks. |
External memory itself is already supported, but on replay it just creates an equivalent image without external memory properties so for the most part the only support needed is to handle processing & serialising the external memory structs, which are then discarded on replay. You can look for e.g. I haven't looked at the |
Hello I was able to add partial support for It is able to capture the rdc file, however while replay on the same device I get error
I guess, it maybe because the external image sent to Kindly help. |
As I mentioned before I haven't looked at the extension so I don't know what's involved with supporting it, if there's special handling needed in |
Hello,
I commented the debug check and it replay it well. I have one further question, For external memory which is to be used as a sampler and has texture, Also during application running in capture context do have one issue, when i capture YUV application, drawing Red,Blue,Green,White boxes, the output is not correct, it looks the sampler / memory is not correct. ( I see 8 boxes, instead of 4)
Regards, |
Yes external memory images should get their contents saved as normal at the start of the frame. Any changes to the image within the frame won't be reflected as there's not a good way to know when the image has been modified outside of the application. If you have a repro where this isn't happening and doesn't use The messages are normal, some implementations have stricter memory requirements for non-external images, so I take the worse of the two and return those as the requirements during capture to ensure memory allocated will work on replay. |
Hello, Thanks for your reply. However its just Renderoc 2D Image viewer window doesn't show any contents. |
As I said if you have a repro where the YUV texture isn't displayed and it's not using |
Sorry, it is not easy for me to share code sample due to my employers restrictions / NDA. Appreciate your help. Renderdoc help me understand lot of issues 👍 I checked your test-program in In
For NV12 format, 2plane, non-packed (2 buffer objects for each plane). However on replay, it tries to bind 2 VkDeviceMemory to vkImage, it fail
Above 3110400 is size of 1920x1080 YUV NV12 image, each buffer object individually sized ( plane[0] : 2073600 bytes - plane[1] 1036800 bytes) I am checking how to add support because maybe some information pNext is not serialzed. I hope it is feasible, I am not sure yet. Thanks. |
In my test program yes I create separate image views for planar formats to texelFetch directly, though I do create a couple of samplers with ycbcr conversion enabled to test single-view conversions of planar/packed images. I think the image views is unrelated to what you're talking about as that's separate from memory binding, the problem seems to be:
RenderDoc removes the |
I was not clear about case when 2 plane , 2 buffer object are present. In this case
However, when replay, we only use non-external memory ( right ? ). I guess it is removed from below codes
So created handle would not know about how memory is being bound in this case. When The check inside BindImageMemory2() fail with below error. (Trying to bind buffer 1 and buffer 2 to same image. with offset, size info from
The replay would have succeded if created VkImage had plane information somehow! The only way i think to be albe to replay, without using external memory, is to hijack replay to call vkCreateImage with Application never create VkImage with Please let me know your view. |
I double-checked for clarification, nothing about the With the extension it's the same as without the extension and with plain base ycbcr support: if you want to bind With RenderDoc active, the disjoint feature will be disabled even if the driver supports it, so the application must do a single memory bind. |
I think you misunderstood. However my query is: No mention of This all work fine, The capture is done, with application running with RenderDoc_Capture layer enabled. When I replay context is the issue, now the application is renderdoccmd. The replayer would replay
How to make replay success is my query ? |
I don't think I've misunderstood, I see the problem you're running into but I'm saying that it's caused by the application behaving in an invalid way. The spec says that if you are going to bind a single image to multiple memory objects it must be a disjoint image. From the spec Valid Usage on
To create an image with that bit you must verify that the format you're creating supports None of that is implicit or required by the drm modifier extension, it's perfectly OK to use the drm modifier with a non-disjoint image with only one memory binding. |
Oh I see, i disabled validation layer for specifically vkCreateImage function specifically to avoid some crash, Okay, so i understand that Thank you so much for your informative answer. |
Hi
Is there any plan to add support for VK_EXT_image_drm_format_modifier and VK_KHR_sampler_ycbcr_conversion extensions.
Regards,
Harsh
The text was updated successfully, but these errors were encountered: