Fixes R11G11B10F rendering, and is required for SRGB format support.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
}
}
+enum a3xx_color_fmt
+fd3_fs_output_format(enum pipe_format format)
+{
+ if (util_format_is_srgb(format))
+ return RB_R16G16B16A16_FLOAT;
+ switch (format) {
+ case PIPE_FORMAT_R11G11B10_FLOAT:
+ return RB_R16G16B16A16_FLOAT;
+ default:
+ return fd3_pipe2color(format);
+ }
+}
+
static inline enum a3xx_tex_swiz
tex_swiz(unsigned swiz)
{
enum a3xx_tex_fetchsize fd3_pipe2fetchsize(enum pipe_format format);
enum a3xx_color_fmt fd3_pipe2color(enum pipe_format format);
enum pipe_format fd3_gmem_restore_format(enum pipe_format format);
+enum a3xx_color_fmt fd3_fs_output_format(enum pipe_format format);
enum a3xx_color_swap fd3_pipe2swap(enum pipe_format format);
uint32_t fd3_tex_swiz(enum pipe_format format, unsigned swizzle_r,
}
OUT_PKT0(ring, REG_A3XX_SP_FS_IMAGE_OUTPUT_REG(i), 1);
- OUT_RING(ring, A3XX_SP_FS_IMAGE_OUTPUT_REG_MRTFORMAT(format));
+ OUT_RING(ring, COND((i < nr_bufs) && bufs[i],
+ A3XX_SP_FS_IMAGE_OUTPUT_REG_MRTFORMAT(
+ fd3_fs_output_format(bufs[i]->format))));
}
}