res_tmpl.depth0 = 1;
res_tmpl.array_size = 1;
res_tmpl.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
- res_tmpl.usage = PIPE_USAGE_STATIC;
+ res_tmpl.usage = PIPE_USAGE_DEFAULT;
pipe_mutex_lock(dev->mutex);
+
+ if (!CheckSurfaceParams(pipe->screen, &res_tmpl))
+ goto err_unlock;
+
res = pipe->screen->resource_create(pipe->screen, &res_tmpl);
if (!res)
goto err_unlock;
err_resource:
pipe_sampler_view_reference(&vlsurface->sampler_view, NULL);
pipe_surface_reference(&vlsurface->surface, NULL);
- pipe_surface_reference(&res, NULL);
+ pipe_resource_reference(&res, NULL);
err_unlock:
pipe_mutex_unlock(dev->mutex);
FREE(vlsurface);
pipe_mutex_lock(vlsurface->device->mutex);
vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
+ if (!CheckSurfaceParams(context->screen, &res_tmpl))
+ goto error_resource;
+
res = context->screen->resource_create(context->screen, &res_tmpl);
if (!res)
goto error_resource;