-
Notifications
You must be signed in to change notification settings - Fork 485
Requirement of support for compatible per-plane formats when a multi-plane format is supported #2500
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
Comments
Apologies for the delay; the original intent was that creating an alias of a single-plane view was only supposed to be an option for disjoint multi-planar images, since otherwise the relationship between the planes may be complicated (especially for some layouts). I'm spelunking to check that no deliberate change was made here, but I'll try to get a clarification MR in the spec assuming that this intent hadn't changed. |
I thought multi-planar images were basically multiple (physically or logically) separate images glued together under a single handle (and with some additional features such as auto YCbCr conversion), in which case supporting single-plane views should be straightforward to implement. Our graphics library uses a fully bindless + single VkPipelineLayout design so I can't really integrate YCbCr samplers. |
Only if they're disjoint. There are formats that have interleaved/interlaced planes and implementations that have specific offset requirements between planes (often the ones which don't need multiple samplers...) which mean that you can't treat the planes separately. That distinction is what disjoint was for. |
By "interleaved/interlaced planes", do you mean formats like For the disjoint vs non-disjoint part, this is unfortunate, I really thought all implementations would be able to read planes separately since these planes are contiguous in memory... Anyway, thank you for the explanation. |
Furthermore, shouldn't creating single-planar image view of multi-planar images be forbidden if the multi-planar format does not support |
(Sorry for the delay, btw.)
I've seen implementations that have, for example, a 16x16 tile of Y' stored contiguously with 8x8 Cb and 8x8 Cr, as a repeating tile. If you're doing aligned DCTs as part of video or image decode, that's not an inefficient approach. Obviously it's not "linear", though! Real world situations can be worse (actual interlacing theoretically aligns luma with the associated chroma from the same field, not the same image - and when a video stream switches format, you can end up with some blocks interlaced and some not, which is as horrible as it sounds to try to deal with efficiently; fortunately interlacing is outside Vulkan's remit, at least for the chroma conversion). It's possible that all current Vulkan implementations actually do support disjoint, but this certainly wasn't the case historically.
Yes, it should.
I think the wording got mangled at some point in the past - the idea was that you could pick any format that's compatible with the plane, but accessing the plane in the first place was only supposed to be supported with disjoint. I think all this predated VUs in the spec, so it's possible that a restriction got misinterpreted as being redundant and got removed. Thanks for bringing this up, because it's clearly become broken. I'll try to get some wording together to fix it! |
After thinking a bit more about that, I think something else should be used instead of |
It's been quite a few years since I was involved in the original language, but this sounds like a driver bug. :-) I'll spelunk for a bit and see whether this can get clarified. Thanks for letting us know that either something has changed, or the wording has atrophied. |
To me, being able to bind planes to separate allocations and being able to read planes separately in shaders look like two very distinct capabilities. I can totally imagine an implementation being able to do the latter even if the former is not possible due to e.g. complex interlaced plane layout. |
Oh, sorry, I see what you mean. Yes, you're probably right. Let me remind myself how all this works (we agreed it all in 2017...) and I'll see what we can rationalise. |
From what I read in the specs, when an implementation supports a multi-plane format, it is not required to also support the compatible per-plane formats of this multi-plane format.
This can lead to a situation where it is impossible to create valid single-plane image views from a multi-plane image (see GPUOpen-Drivers/AMD-Gfx-Drivers#46).
Should this requirement be added to the specs?
The text was updated successfully, but these errors were encountered: