HansKristian-Work / vkd3d-proton

Fork of VKD3D. Development branches for Proton's Direct3D 12 implementation.
GNU Lesser General Public License v2.1
1.75k stars 183 forks source link

Planar formats, part 2: Handle subsampled planes and plane view aspects #2028

Closed doitsujin closed 2 days ago

doitsujin commented 1 week ago

This is a fairly invasive refactor, so I'm doing this as a separate PR.

The goal here is to unify all the different ways in which we compute the size of a subresource to make it a) more consistent and b) correct w.r.t. subsampled planes. Currently it's all over the place and largely broken.

Another change is that we now store the aspect flag that is used to create a view in the view info. This is important in cases where we need to reconstruct the exact subresource of the image that the view covers, since it can be something like PLANE_1_BIT even if the format's aspect mask is COLOR_BIT.