dri2_invalidate_drawable(__DRIdrawable *dPriv)
{
struct dri_drawable *drawable = dri_drawable(dPriv);
- struct dri_context *ctx = drawable->context;
dri2InvalidateDrawable(dPriv);
drawable->dPriv->lastStamp = *drawable->dPriv->pStamp;
- if (ctx)
- ctx->st->notify_invalid_framebuffer(ctx->st, &drawable->base);
+ p_atomic_inc(&drawable->base.stamp);
}
static const __DRI2flushExtension dri2FlushExtension = {
struct dri_screen *screen = dri_screen(sPriv);
struct dri2_buffer *buffer;
struct pipe_resource templ;
- enum st_attachment_type statt;
enum pipe_format pf;
unsigned bind = 0;
struct winsys_handle whandle;
switch (attachment) {
case __DRI_BUFFER_FRONT_LEFT:
case __DRI_BUFFER_FAKE_FRONT_LEFT:
- statt = ST_ATTACHMENT_FRONT_LEFT;
bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
break;
case __DRI_BUFFER_BACK_LEFT:
- statt = ST_ATTACHMENT_BACK_LEFT;
bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
break;
case __DRI_BUFFER_DEPTH:
case __DRI_BUFFER_DEPTH_STENCIL:
case __DRI_BUFFER_STENCIL:
- statt = ST_ATTACHMENT_DEPTH_STENCIL;
bind = PIPE_BIND_DEPTH_STENCIL; /* XXX sampler? */
break;
- default:
- statt = ST_ATTACHMENT_INVALID;
- break;
}
switch (format) {
enum pipe_format pf;
tex_usage = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
+ if (use & __DRI_IMAGE_USE_SCANOUT)
+ tex_usage |= PIPE_BIND_SCANOUT;
+ if (use & __DRI_IMAGE_USE_SHARE)
+ tex_usage |= PIPE_BIND_SHARED;
+ if (use & __DRI_IMAGE_USE_CURSOR) {
+ if (width != 64 || height != 64)
+ return NULL;
+ tex_usage |= PIPE_BIND_CURSOR;
+ }
switch (format) {
case __DRI_IMAGE_FORMAT_RGB565:
}
}
+static __DRIimage *
+dri2_dup_image(__DRIimage *image, void *loaderPrivate)
+{
+ __DRIimage *img;
+
+ img = CALLOC_STRUCT(__DRIimageRec);
+ if (!img)
+ return NULL;
+
+ img->texture = NULL;
+ pipe_resource_reference(&img->texture, image->texture);
+ img->level = image->level;
+ img->layer = image->layer;
+ img->loader_private = loaderPrivate;
+
+ return img;
+}
+
static void
dri2_destroy_image(__DRIimage *img)
{
dri2_destroy_image,
dri2_create_image,
dri2_query_image,
+ dri2_dup_image,
};
/*
return NULL;
}
-static boolean
-dri2_create_context(gl_api api, const struct gl_config * visual,
- __DRIcontext * cPriv, void *sharedContextPrivate)
-{
- struct dri_context *ctx = NULL;
-
- if (!dri_create_context(api, visual, cPriv, sharedContextPrivate))
- return FALSE;
-
- ctx = cPriv->driverPrivate;
-
- return TRUE;
-}
-
static boolean
dri2_create_buffer(__DRIscreen * sPriv,
__DRIdrawable * dPriv,
.InitScreen = NULL,
.InitScreen2 = dri2_init_screen,
.DestroyScreen = dri_destroy_screen,
- .CreateContext = dri2_create_context,
+ .CreateContext = dri_create_context,
.DestroyContext = dri_destroy_context,
.CreateBuffer = dri2_create_buffer,
.DestroyBuffer = dri_destroy_buffer,