diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-05-29 10:22:51 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-05-29 10:22:51 +0000 |
commit | c9223eed3c16cd3e98a8f56dda953d8f299de0e3 (patch) | |
tree | 53e2a1c3f13bcf6b4ed201d7bc135e7213c94ebe /lib/mesa/src/gallium/auxiliary/vl/vl_video_buffer.c | |
parent | 6e8f2d062ab9c198239b9283b2b7ed12f4ea17d8 (diff) |
Import Mesa 11.2.2
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/vl/vl_video_buffer.c')
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/vl/vl_video_buffer.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/vl/vl_video_buffer.c b/lib/mesa/src/gallium/auxiliary/vl/vl_video_buffer.c index 5e0ae0ecb..462fdcb08 100644 --- a/lib/mesa/src/gallium/auxiliary/vl/vl_video_buffer.c +++ b/lib/mesa/src/gallium/auxiliary/vl/vl_video_buffer.c @@ -62,6 +62,18 @@ const enum pipe_format const_resource_formats_VUYA[3] = { PIPE_FORMAT_NONE }; +const enum pipe_format const_resource_formats_YUVX[3] = { + PIPE_FORMAT_R8G8B8X8_UNORM, + PIPE_FORMAT_NONE, + PIPE_FORMAT_NONE +}; + +const enum pipe_format const_resource_formats_VUYX[3] = { + PIPE_FORMAT_B8G8R8X8_UNORM, + PIPE_FORMAT_NONE, + PIPE_FORMAT_NONE +}; + const enum pipe_format const_resource_formats_YUYV[3] = { PIPE_FORMAT_R8G8_R8B8_UNORM, PIPE_FORMAT_NONE, @@ -102,6 +114,12 @@ vl_video_buffer_formats(struct pipe_screen *screen, enum pipe_format format) case PIPE_FORMAT_B8G8R8A8_UNORM: return const_resource_formats_VUYA; + case PIPE_FORMAT_R8G8B8X8_UNORM: + return const_resource_formats_YUVX; + + case PIPE_FORMAT_B8G8R8X8_UNORM: + return const_resource_formats_VUYX; + case PIPE_FORMAT_YUYV: return const_resource_formats_YUYV; @@ -235,14 +253,8 @@ vl_video_buffer_template(struct pipe_resource *templ, templ->bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET; templ->usage = usage; - if (plane > 0) { - if (tmpl->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420) { - templ->width0 /= 2; - templ->height0 /= 2; - } else if (tmpl->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_422) { - templ->width0 /= 2; - } - } + vl_video_buffer_adjust_size(&templ->width0, &templ->height0, plane, + tmpl->chroma_format, false); } static void |