mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
panfrost: Move special Z32_S8X24 case out of panfrost_setup_layout()
We are about to move the panfrost_setup_layout() logic out of the gallium driver, and the Z32_S8X24 split is not mandatory (some GPU support this format natively). Let's move this special case out of panfrost_setup_layout() and patch the format of the first plane instead. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10033>
This commit is contained in:
parent
50f39908aa
commit
f1d4df1cd7
1 changed files with 6 additions and 7 deletions
|
|
@ -350,13 +350,6 @@ panfrost_setup_layout(struct panfrost_device *dev,
|
|||
pres->image.layout.depth = height;
|
||||
pres->image.layout.array_size = res->array_size;
|
||||
|
||||
/* Z32_S8X24 variants are actually stored in 2 planes (one per
|
||||
* component), we have to adjust the bytes_per_pixel value accordingly.
|
||||
*/
|
||||
if (pres->image.layout.format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT ||
|
||||
pres->image.layout.format == PIPE_FORMAT_X32_S8X24_UINT)
|
||||
bytes_per_pixel = 4;
|
||||
|
||||
/* MSAA is implemented as a 3D texture with z corresponding to the
|
||||
* sample #, horrifyingly enough */
|
||||
|
||||
|
|
@ -653,6 +646,12 @@ panfrost_resource_setup(struct panfrost_device *dev, struct panfrost_resource *p
|
|||
pres->modifier_constant = !((pres->image.layout.modifier != DRM_FORMAT_MOD_LINEAR)
|
||||
&& (modifier == DRM_FORMAT_MOD_INVALID));
|
||||
|
||||
/* Z32_S8X24 variants are actually stored in 2 planes (one per
|
||||
* component), we have to adjust the format on the first plane.
|
||||
*/
|
||||
if (pres->image.layout.format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT)
|
||||
pres->image.layout.format = PIPE_FORMAT_Z32_FLOAT;
|
||||
|
||||
panfrost_setup_layout(dev, pres, bo_size);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue