st/mesa: don't lower YUV when driver supports it natively

This fixes YUYV support on etnaviv.

Fixes: 7404833c "gallium: add handling for YUV planar surfaces"

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1896>
This commit is contained in:
Jonathan Marek
2019-09-06 09:26:08 -04:00
committed by Marge Bot
parent 4e3c81517b
commit a554b45d73
6 changed files with 82 additions and 55 deletions

View File

@@ -489,6 +489,10 @@ get_sampler_view_format(struct st_context *st,
if (srgb_skip_decode)
format = util_format_linear(format);
/* if resource format matches then YUV wasn't lowered */
if (format == stObj->pt->format)
return format;
/* Use R8_UNORM for video formats */
switch (format) {
case PIPE_FORMAT_NV12: