mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-04 15:00:36 +01:00
radeonsi: Map X6R10/X6R10X6G10 formats to R16/R16G16
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35177>
This commit is contained in:
parent
ddb42b2fc5
commit
20ad09af25
1 changed files with 18 additions and 1 deletions
|
|
@ -1314,6 +1314,23 @@ error:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static enum pipe_format
|
||||
si_get_plane_format(enum pipe_format format, unsigned plane)
|
||||
{
|
||||
enum pipe_format fmt = util_format_get_plane_format(format, plane);
|
||||
|
||||
switch (fmt) {
|
||||
case PIPE_FORMAT_X6R10_UNORM:
|
||||
case PIPE_FORMAT_X4R12_UNORM:
|
||||
return PIPE_FORMAT_R16_UNORM;
|
||||
case PIPE_FORMAT_X6R10X6G10_UNORM:
|
||||
case PIPE_FORMAT_X4R12X4G12_UNORM:
|
||||
return PIPE_FORMAT_R16G16_UNORM;
|
||||
default:
|
||||
return fmt;
|
||||
}
|
||||
}
|
||||
|
||||
static enum radeon_surf_mode si_choose_tiling(struct si_screen *sscreen,
|
||||
const struct pipe_resource *templ,
|
||||
bool tc_compatible_htile)
|
||||
|
|
@ -1422,7 +1439,7 @@ si_texture_create_with_modifier(struct pipe_screen *screen,
|
|||
/* Compute texture or plane layouts and offsets. */
|
||||
for (unsigned i = 0; i < num_planes; i++) {
|
||||
plane_templ[i] = *templ;
|
||||
plane_templ[i].format = util_format_get_plane_format(templ->format, i);
|
||||
plane_templ[i].format = si_get_plane_format(templ->format, i);
|
||||
plane_templ[i].width0 = util_format_get_plane_width(templ->format, i, templ->width0);
|
||||
plane_templ[i].height0 = util_format_get_plane_height(templ->format, i, templ->height0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue