mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-25 16:40:30 +01:00
panfrost: set decode_hdr when needed
When using the HDR-formats, we need to set decode_hdr to actually get HDR values. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35132>
This commit is contained in:
parent
33ad5d447e
commit
d9dbf5cebf
4 changed files with 15 additions and 10 deletions
|
|
@ -1712,14 +1712,18 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
|
|||
util_format_description(format);
|
||||
struct pan_buffer_view bview = {
|
||||
.format = format,
|
||||
.astc.narrow =
|
||||
desc->layout == UTIL_FORMAT_LAYOUT_ASTC &&
|
||||
so->base.astc_decode_format == PIPE_ASTC_DECODE_FORMAT_UNORM8,
|
||||
.width_el =
|
||||
MIN2(so->base.u.buf.size / util_format_get_blocksize(format),
|
||||
PAN_MAX_TEXEL_BUFFER_ELEMENTS),
|
||||
.base = prsrc->image.data.base + so->base.u.buf.offset,
|
||||
};
|
||||
|
||||
if (desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
|
||||
bview.astc.narrow =
|
||||
so->base.astc_decode_format == PIPE_ASTC_DECODE_FORMAT_UNORM8;
|
||||
bview.astc.hdr = util_format_is_astc_hdr(format);
|
||||
}
|
||||
|
||||
#if PAN_ARCH >= 9
|
||||
unsigned payload_size = pan_size(PLANE);
|
||||
#elif PAN_ARCH >= 6
|
||||
|
|
@ -1826,9 +1830,10 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
|
|||
}
|
||||
}
|
||||
|
||||
if (desc->layout == UTIL_FORMAT_LAYOUT_ASTC &&
|
||||
so->base.astc_decode_format == PIPE_ASTC_DECODE_FORMAT_UNORM8) {
|
||||
iview.astc.narrow = true;
|
||||
if (desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
|
||||
iview.astc.narrow =
|
||||
so->base.astc_decode_format == PIPE_ASTC_DECODE_FORMAT_UNORM8;
|
||||
iview.astc.hdr = util_format_is_astc_hdr(format);
|
||||
}
|
||||
|
||||
GENX(pan_sampled_texture_emit)(&iview, tex, &payload);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ struct pan_buffer_view {
|
|||
enum pipe_format format;
|
||||
struct {
|
||||
unsigned narrow;
|
||||
unsigned hdr;
|
||||
} astc;
|
||||
unsigned width_el;
|
||||
uint64_t base;
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ struct pan_image_view {
|
|||
|
||||
struct {
|
||||
unsigned narrow;
|
||||
unsigned hdr;
|
||||
} astc;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -453,8 +453,7 @@ pan_emit_bview_plane(const struct pan_buffer_view *bview, void *payload)
|
|||
|
||||
bool srgb = (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB);
|
||||
|
||||
/* Mesa does not advertise _HDR formats yet */
|
||||
cfg.astc.decode_hdr = false;
|
||||
cfg.astc.decode_hdr = bview->astc.hdr;
|
||||
|
||||
/* sRGB formats decode to RGBA8 sRGB, which is narrow.
|
||||
*
|
||||
|
|
@ -539,8 +538,7 @@ pan_emit_iview_plane(const struct pan_image_view *iview,
|
|||
|
||||
bool srgb = (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB);
|
||||
|
||||
/* Mesa does not advertise _HDR formats yet */
|
||||
cfg.astc.decode_hdr = false;
|
||||
cfg.astc.decode_hdr = iview->astc.hdr;
|
||||
|
||||
/* sRGB formats decode to RGBA8 sRGB, which is narrow.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue