diff options
Diffstat (limited to 'src/gallium/state_trackers/vdpau/decode.c')
-rw-r--r-- | src/gallium/state_trackers/vdpau/decode.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c index 8bc54d7fc7d..048cfe819f0 100644 --- a/src/gallium/state_trackers/vdpau/decode.c +++ b/src/gallium/state_trackers/vdpau/decode.c @@ -134,24 +134,15 @@ vlVdpCreateSurfaceTarget(vlVdpDecoder *vldecoder, vlVdpSurface *vlsurf) vctx = vldecoder->vctx->vpipe; + if (!vctx->is_format_supported(vctx, tmplt.format, PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET)) + return VDP_STATUS_RESOURCES; + memset(&tmplt, 0, sizeof(struct pipe_resource)); tmplt.target = PIPE_TEXTURE_2D; tmplt.format = vctx->get_param(vctx,PIPE_CAP_DECODE_TARGET_PREFERRED_FORMAT); tmplt.last_level = 0; - - if (vctx->is_format_supported(vctx, tmplt.format, - PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET, - PIPE_TEXTURE_GEOM_NON_POWER_OF_TWO)) { - tmplt.width0 = vlsurf->width; - tmplt.height0 = vlsurf->height; - } else { - assert(vctx->is_format_supported(vctx, tmplt.format, - PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET, - PIPE_TEXTURE_GEOM_NON_SQUARE)); - tmplt.width0 = util_next_power_of_two(vlsurf->width); - tmplt.height0 = util_next_power_of_two(vlsurf->height); - } - + tmplt.width0 = vlsurf->width; + tmplt.height0 = vlsurf->height; tmplt.depth0 = 1; tmplt.usage = PIPE_USAGE_DEFAULT; tmplt.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET; |