aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/v3d/v3d_resource.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/v3d/v3d_resource.c')
-rw-r--r--src/gallium/drivers/v3d/v3d_resource.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/v3d/v3d_resource.c b/src/gallium/drivers/v3d/v3d_resource.c
index b9c578b9cf5..45e2edf5ab6 100644
--- a/src/gallium/drivers/v3d/v3d_resource.c
+++ b/src/gallium/drivers/v3d/v3d_resource.c
@@ -811,6 +811,12 @@ v3d_create_surface(struct pipe_context *pctx,
surface->format = v3d_get_rt_format(&screen->devinfo, psurf->format);
+ const struct util_format_description *desc =
+ util_format_description(psurf->format);
+
+ surface->swap_rb = (desc->swizzle[0] == PIPE_SWIZZLE_Z &&
+ psurf->format != PIPE_FORMAT_B5G6R5_UNORM);
+
if (util_format_is_depth_or_stencil(psurf->format)) {
switch (psurf->format) {
case PIPE_FORMAT_Z16_UNORM: