mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
[g3dvl] remove create_surface from video context
This commit is contained in:
parent
2ec350ff1d
commit
06ddbc3b8e
5 changed files with 10 additions and 27 deletions
|
|
@ -45,18 +45,6 @@ vl_context_destroy(struct pipe_video_context *context)
|
|||
FREE(ctx);
|
||||
}
|
||||
|
||||
static struct pipe_surface *
|
||||
vl_context_create_surface(struct pipe_video_context *context,
|
||||
struct pipe_resource *resource,
|
||||
const struct pipe_surface *templ)
|
||||
{
|
||||
struct vl_context *ctx = (struct vl_context*)context;
|
||||
|
||||
assert(ctx);
|
||||
|
||||
return ctx->pipe->create_surface(ctx->pipe, resource, templ);
|
||||
}
|
||||
|
||||
static struct pipe_sampler_view *
|
||||
vl_context_create_sampler_view(struct pipe_video_context *context,
|
||||
struct pipe_resource *resource,
|
||||
|
|
@ -232,7 +220,6 @@ vl_create_context(struct pipe_context *pipe)
|
|||
ctx->base.screen = pipe->screen;
|
||||
|
||||
ctx->base.destroy = vl_context_destroy;
|
||||
ctx->base.create_surface = vl_context_create_surface;
|
||||
ctx->base.create_sampler_view = vl_context_create_sampler_view;
|
||||
ctx->base.clear_sampler = vl_context_clear_sampler;
|
||||
ctx->base.upload_sampler = vl_context_upload_sampler;
|
||||
|
|
|
|||
|
|
@ -55,13 +55,6 @@ struct pipe_video_context
|
|||
*/
|
||||
void (*destroy)(struct pipe_video_context *context);
|
||||
|
||||
/**
|
||||
* create a surface of a texture
|
||||
*/
|
||||
struct pipe_surface *(*create_surface)(struct pipe_video_context *context,
|
||||
struct pipe_resource *resource,
|
||||
const struct pipe_surface *templ);
|
||||
|
||||
/**
|
||||
* sampler view handling, used for subpictures for example
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <util/u_debug.h>
|
||||
#include <util/u_memory.h>
|
||||
#include <util/u_sampler.h>
|
||||
|
||||
#include "vdpau_private.h"
|
||||
|
||||
|
|
@ -39,6 +40,7 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
|
|||
uint32_t width, uint32_t height,
|
||||
VdpOutputSurface *surface)
|
||||
{
|
||||
struct pipe_context *pipe;
|
||||
struct pipe_video_context *context;
|
||||
struct pipe_resource res_tmpl, *res;
|
||||
struct pipe_sampler_view sv_templ;
|
||||
|
|
@ -54,8 +56,9 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
|
|||
if (!dev)
|
||||
return VDP_STATUS_INVALID_HANDLE;
|
||||
|
||||
pipe = dev->context->pipe;
|
||||
context = dev->context->vpipe;
|
||||
if (!context)
|
||||
if (!pipe || !context)
|
||||
return VDP_STATUS_INVALID_HANDLE;
|
||||
|
||||
vlsurface = CALLOC(1, sizeof(vlVdpOutputSurface));
|
||||
|
|
@ -85,7 +88,7 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
|
|||
// as long as we don't have a background picture we don't want an alpha channel
|
||||
sv_templ.swizzle_a = PIPE_SWIZZLE_ONE;
|
||||
|
||||
vlsurface->sampler_view = context->create_sampler_view(context, res, &sv_templ);
|
||||
vlsurface->sampler_view = pipe->create_sampler_view(pipe, res, &sv_templ);
|
||||
if (!vlsurface->sampler_view) {
|
||||
FREE(dev);
|
||||
return VDP_STATUS_ERROR;
|
||||
|
|
@ -94,7 +97,7 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
|
|||
memset(&surf_templ, 0, sizeof(surf_templ));
|
||||
surf_templ.format = res->format;
|
||||
surf_templ.usage = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
|
||||
vlsurface->surface = context->create_surface(context, res, &surf_templ);
|
||||
vlsurface->surface = pipe->create_surface(pipe, res, &surf_templ);
|
||||
if (!vlsurface->surface) {
|
||||
FREE(dev);
|
||||
return VDP_STATUS_ERROR;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ vl_dri2_get_front(struct vl_context *vctx, Drawable drawable)
|
|||
memset(&surf_template, 0, sizeof(surf_template));
|
||||
surf_template.format = front_tex->format;
|
||||
surf_template.usage = PIPE_BIND_RENDER_TARGET;
|
||||
front_surf = vctx->vpipe->create_surface(vctx->vpipe, front_tex, &surf_template);
|
||||
front_surf = vctx->pipe->create_surface(vctx->pipe, front_tex, &surf_template);
|
||||
}
|
||||
pipe_resource_reference(&front_tex, NULL);
|
||||
Xfree(dri2_front);
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ vl_drawable_surface_get(struct vl_context *vctx, Drawable drawable)
|
|||
memset(&surf_template, 0, sizeof(surf_template));
|
||||
surf_template.format = templat.format;
|
||||
surf_template.usage = PIPE_BIND_RENDER_TARGET;
|
||||
xsp_screen->drawable_surface = vctx->vpipe->create_surface(vctx->vpipe, drawable_tex,
|
||||
&surf_template);
|
||||
xsp_screen->drawable_surface = vctx->pipe->create_surface(vctx->pipe, drawable_tex,
|
||||
&surf_template);
|
||||
pipe_resource_reference(&drawable_tex, NULL);
|
||||
|
||||
if (!xsp_screen->drawable_surface)
|
||||
|
|
@ -172,7 +172,7 @@ void vl_screen_destroy(struct vl_screen *vscreen)
|
|||
struct vl_context*
|
||||
vl_video_create(struct vl_screen *vscreen)
|
||||
{
|
||||
struct pipe_video_context *pipe;
|
||||
struct pipe_context *pipe;
|
||||
struct pipe_video_context *vpipe;
|
||||
struct vl_context *vctx;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue