st/dri: Add support for GLX_EXT_texture_from_pixmap with direct rendering.
This commit is contained in:
@@ -204,6 +204,30 @@ dri_get_buffers(__DRIdrawablePrivate * dPriv)
|
||||
st_resize_framebuffer(drawable->stfb, dri_drawable->w, dri_drawable->h);
|
||||
}
|
||||
|
||||
/**
|
||||
* These are used for GLX_EXT_texture_from_pixmap
|
||||
*/
|
||||
void dri2_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
|
||||
GLint format, __DRIdrawable *dPriv)
|
||||
{
|
||||
struct dri_drawable *drawable = dri_drawable(dPriv);
|
||||
struct pipe_surface *ps;
|
||||
|
||||
dri_get_buffers(drawable->dPriv);
|
||||
st_get_framebuffer_surface(drawable->stfb, ST_SURFACE_FRONT_LEFT, &ps);
|
||||
|
||||
st_bind_texture_surface(ps, target == GL_TEXTURE_2D ? ST_TEXTURE_2D :
|
||||
ST_TEXTURE_RECT, 0,
|
||||
format == GLX_TEXTURE_FORMAT_RGBA_EXT ?
|
||||
PIPE_FORMAT_R8G8B8A8_UNORM : PIPE_FORMAT_R8G8B8X8_UNORM);
|
||||
}
|
||||
|
||||
void dri2_set_tex_buffer(__DRIcontext *pDRICtx, GLint target,
|
||||
__DRIdrawable *dPriv)
|
||||
{
|
||||
dri2_set_tex_buffer2(pDRICtx, target, GLX_TEXTURE_FORMAT_RGBA_EXT, dPriv);
|
||||
}
|
||||
|
||||
void
|
||||
dri_flush_frontbuffer(struct pipe_screen *screen,
|
||||
struct pipe_surface *surf, void *context_private)
|
||||
|
||||
@@ -91,6 +91,12 @@ void dri_get_buffers(__DRIdrawablePrivate * dPriv);
|
||||
|
||||
void dri_destroy_buffer(__DRIdrawablePrivate * dPriv);
|
||||
|
||||
void dri2_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
|
||||
GLint glx_texture_format, __DRIdrawable *dPriv);
|
||||
|
||||
void dri2_set_tex_buffer(__DRIcontext *pDRICtx, GLint target,
|
||||
__DRIdrawable *dPriv);
|
||||
|
||||
void
|
||||
dri1_update_drawables(struct dri_context *ctx,
|
||||
struct dri_drawable *draw, struct dri_drawable *read);
|
||||
|
||||
@@ -57,12 +57,19 @@ PUBLIC const char __driConfigOptions[] =
|
||||
|
||||
const uint __driNConfigOptions = 3;
|
||||
|
||||
static const __DRItexBufferExtension dri2TexBufferExtension = {
|
||||
{ __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
|
||||
dri2_set_tex_buffer,
|
||||
dri2_set_tex_buffer2,
|
||||
};
|
||||
|
||||
static const __DRIextension *dri_screen_extensions[] = {
|
||||
&driReadDrawableExtension,
|
||||
&driCopySubBufferExtension.base,
|
||||
&driSwapControlExtension.base,
|
||||
&driFrameTrackingExtension.base,
|
||||
&driMediaStreamCounterExtension.base,
|
||||
&dri2TexBufferExtension.base,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user