mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02: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);
|
util_format_description(format);
|
||||||
struct pan_buffer_view bview = {
|
struct pan_buffer_view bview = {
|
||||||
.format = format,
|
.format = format,
|
||||||
.astc.narrow =
|
|
||||||
desc->layout == UTIL_FORMAT_LAYOUT_ASTC &&
|
|
||||||
so->base.astc_decode_format == PIPE_ASTC_DECODE_FORMAT_UNORM8,
|
|
||||||
.width_el =
|
.width_el =
|
||||||
MIN2(so->base.u.buf.size / util_format_get_blocksize(format),
|
MIN2(so->base.u.buf.size / util_format_get_blocksize(format),
|
||||||
PAN_MAX_TEXEL_BUFFER_ELEMENTS),
|
PAN_MAX_TEXEL_BUFFER_ELEMENTS),
|
||||||
.base = prsrc->image.data.base + so->base.u.buf.offset,
|
.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
|
#if PAN_ARCH >= 9
|
||||||
unsigned payload_size = pan_size(PLANE);
|
unsigned payload_size = pan_size(PLANE);
|
||||||
#elif PAN_ARCH >= 6
|
#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 &&
|
if (desc->layout == UTIL_FORMAT_LAYOUT_ASTC) {
|
||||||
so->base.astc_decode_format == PIPE_ASTC_DECODE_FORMAT_UNORM8) {
|
iview.astc.narrow =
|
||||||
iview.astc.narrow = true;
|
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);
|
GENX(pan_sampled_texture_emit)(&iview, tex, &payload);
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ struct pan_buffer_view {
|
||||||
enum pipe_format format;
|
enum pipe_format format;
|
||||||
struct {
|
struct {
|
||||||
unsigned narrow;
|
unsigned narrow;
|
||||||
|
unsigned hdr;
|
||||||
} astc;
|
} astc;
|
||||||
unsigned width_el;
|
unsigned width_el;
|
||||||
uint64_t base;
|
uint64_t base;
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ struct pan_image_view {
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
unsigned narrow;
|
unsigned narrow;
|
||||||
|
unsigned hdr;
|
||||||
} astc;
|
} 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);
|
bool srgb = (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB);
|
||||||
|
|
||||||
/* Mesa does not advertise _HDR formats yet */
|
cfg.astc.decode_hdr = bview->astc.hdr;
|
||||||
cfg.astc.decode_hdr = false;
|
|
||||||
|
|
||||||
/* sRGB formats decode to RGBA8 sRGB, which is narrow.
|
/* 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);
|
bool srgb = (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB);
|
||||||
|
|
||||||
/* Mesa does not advertise _HDR formats yet */
|
cfg.astc.decode_hdr = iview->astc.hdr;
|
||||||
cfg.astc.decode_hdr = false;
|
|
||||||
|
|
||||||
/* sRGB formats decode to RGBA8 sRGB, which is narrow.
|
/* sRGB formats decode to RGBA8 sRGB, which is narrow.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue