glx: unify bind_tex_image
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30619>
This commit is contained in:
committed by
Marge Bot
parent
19f38ba000
commit
5ece0a3b66
+1
-15
@@ -635,20 +635,6 @@ dri2InvalidateBuffers(Display *dpy, XID drawable)
|
||||
dri_invalidate_drawable(pdraw->dri_drawable);
|
||||
}
|
||||
|
||||
static void
|
||||
dri2_bind_tex_image(__GLXDRIdrawable *base,
|
||||
int buffer, const int *attrib_list)
|
||||
{
|
||||
struct glx_context *gc = __glXGetCurrentContext();
|
||||
|
||||
if (base != NULL) {
|
||||
dri_set_tex_buffer2(gc->driContext,
|
||||
base->textureTarget,
|
||||
base->textureFormat,
|
||||
base->dri_drawable);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct glx_context_vtable dri2_context_vtable = {
|
||||
.destroy = dri_destroy_context,
|
||||
.bind = dri_bind_context,
|
||||
@@ -756,7 +742,7 @@ dri2CreateScreen(int screen, struct glx_display * priv, bool driver_name_is_infe
|
||||
psp->waitForSBC = NULL;
|
||||
psp->setSwapInterval = NULL;
|
||||
psp->getSwapInterval = NULL;
|
||||
psp->bindTexImage = dri2_bind_tex_image;
|
||||
psp->bindTexImage = dri_bind_tex_image;
|
||||
|
||||
psp->getDrawableMSC = dri2DrawableGetMSC;
|
||||
psp->waitForMSC = dri2WaitForMSC;
|
||||
|
||||
+1
-19
@@ -470,24 +470,6 @@ dri3_get_swap_interval(__GLXDRIdrawable *pdraw)
|
||||
return priv->loader_drawable.swap_interval;
|
||||
}
|
||||
|
||||
static void
|
||||
dri3_bind_tex_image(__GLXDRIdrawable *base,
|
||||
int buffer, const int *attrib_list)
|
||||
{
|
||||
struct glx_context *gc = __glXGetCurrentContext();
|
||||
|
||||
if (base) {
|
||||
dri_invalidate_drawable(base->dri_drawable);
|
||||
|
||||
XSync(gc->currentDpy, false);
|
||||
|
||||
dri_set_tex_buffer2(gc->driContext,
|
||||
base->textureTarget,
|
||||
base->textureFormat,
|
||||
base->dri_drawable);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct glx_context_vtable dri3_context_vtable = {
|
||||
.destroy = dri_destroy_context,
|
||||
.bind = dri_bind_context,
|
||||
@@ -623,7 +605,7 @@ dri3_create_screen(int screen, struct glx_display * priv, bool driver_name_is_in
|
||||
psp->waitForSBC = dri3_wait_for_sbc;
|
||||
psp->setSwapInterval = dri3_set_swap_interval;
|
||||
psp->getSwapInterval = dri3_get_swap_interval;
|
||||
psp->bindTexImage = dri3_bind_tex_image;
|
||||
psp->bindTexImage = dri_bind_tex_image;
|
||||
psp->maxSwapInterval = INT_MAX;
|
||||
|
||||
/* when on a different gpu than the server, the server pixmaps
|
||||
|
||||
@@ -946,4 +946,25 @@ const struct glx_screen_vtable dri_screen_vtable = {
|
||||
.query_renderer_string = glx_dri_query_renderer_string,
|
||||
.get_driver_name = dri_get_driver_name,
|
||||
};
|
||||
|
||||
void
|
||||
dri_bind_tex_image(__GLXDRIdrawable *base, int buffer, const int *attrib_list)
|
||||
{
|
||||
struct glx_context *gc = __glXGetCurrentContext();
|
||||
|
||||
if (!base)
|
||||
return;
|
||||
|
||||
if (base->psc->display->driver == GLX_DRIVER_DRI3) {
|
||||
dri_invalidate_drawable(base->dri_drawable);
|
||||
|
||||
XSync(gc->currentDpy, false);
|
||||
}
|
||||
|
||||
dri_set_tex_buffer2(gc->driContext,
|
||||
base->textureTarget,
|
||||
base->textureFormat,
|
||||
base->dri_drawable);
|
||||
}
|
||||
|
||||
#endif /* GLX_DIRECT_RENDERING */
|
||||
|
||||
@@ -112,6 +112,8 @@ glx_dri_query_renderer_string(struct glx_screen *base, int attribute,
|
||||
const char **value);
|
||||
char *
|
||||
dri_get_driver_name(struct glx_screen *glx_screen);
|
||||
void
|
||||
dri_bind_tex_image(__GLXDRIdrawable *base, int buffer, const int *attrib_list);
|
||||
#endif /* GLX_DIRECT_RENDERING */
|
||||
|
||||
#endif /* _DRI_COMMON_H */
|
||||
|
||||
+1
-15
@@ -432,20 +432,6 @@ drisw_wait_x(struct glx_context *context)
|
||||
XSync(context->currentDpy, False);
|
||||
}
|
||||
|
||||
static void
|
||||
drisw_bind_tex_image(__GLXDRIdrawable *base,
|
||||
int buffer, const int *attrib_list)
|
||||
{
|
||||
struct glx_context *gc = __glXGetCurrentContext();
|
||||
|
||||
if (base != NULL) {
|
||||
dri_set_tex_buffer2(gc->driContext,
|
||||
base->textureTarget,
|
||||
base->textureFormat,
|
||||
base->dri_drawable);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
kopper_get_buffer_age(__GLXDRIdrawable *pdraw);
|
||||
int
|
||||
@@ -712,7 +698,7 @@ driswCreateScreen(int screen, struct glx_display *priv, enum glx_driver glx_driv
|
||||
psp->destroyScreen = driswDestroyScreen;
|
||||
psp->createDrawable = driswCreateDrawable;
|
||||
psp->swapBuffers = driswSwapBuffers;
|
||||
psp->bindTexImage = drisw_bind_tex_image;
|
||||
psp->bindTexImage = dri_bind_tex_image;
|
||||
|
||||
if (!glx_driver)
|
||||
psp->copySubBuffer = drisw_copy_sub_buffer;
|
||||
|
||||
Reference in New Issue
Block a user