dri: Fold away some unused indirection in __DriverAPIRec
The context-related API doesn't vary between dri2 and drisw. Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>
This commit is contained in:
parent
23bd889541
commit
9c772de270
|
@ -2537,12 +2537,8 @@ dri2_create_buffer(__DRIscreen * sPriv,
|
|||
const struct __DriverAPIRec galliumdrm_driver_api = {
|
||||
.InitScreen = dri2_init_screen,
|
||||
.DestroyScreen = dri_destroy_screen,
|
||||
.CreateContext = dri_create_context,
|
||||
.DestroyContext = dri_destroy_context,
|
||||
.CreateBuffer = dri2_create_buffer,
|
||||
.DestroyBuffer = dri_destroy_buffer,
|
||||
.MakeCurrent = dri_make_current,
|
||||
.UnbindContext = dri_unbind_context,
|
||||
|
||||
.AllocateBuffer = dri2_allocate_buffer,
|
||||
.ReleaseBuffer = dri2_release_buffer,
|
||||
|
@ -2558,12 +2554,8 @@ const struct __DriverAPIRec galliumdrm_driver_api = {
|
|||
const struct __DriverAPIRec dri_kms_driver_api = {
|
||||
.InitScreen = dri_kms_init_screen,
|
||||
.DestroyScreen = dri_destroy_screen,
|
||||
.CreateContext = dri_create_context,
|
||||
.DestroyContext = dri_destroy_context,
|
||||
.CreateBuffer = dri2_create_buffer,
|
||||
.DestroyBuffer = dri_destroy_buffer,
|
||||
.MakeCurrent = dri_make_current,
|
||||
.UnbindContext = dri_unbind_context,
|
||||
|
||||
.AllocateBuffer = dri2_allocate_buffer,
|
||||
.ReleaseBuffer = dri2_release_buffer,
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
#include "dri_util.h"
|
||||
#include "dri_context.h"
|
||||
#include "utils.h"
|
||||
#include "util/u_endian.h"
|
||||
#include "util/driconf.h"
|
||||
|
@ -484,8 +485,8 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
|
|||
context->driDrawablePriv = NULL;
|
||||
context->driReadablePriv = NULL;
|
||||
|
||||
if (!screen->driver->CreateContext(mesa_api, modes, context,
|
||||
&ctx_config, error, shareCtx)) {
|
||||
if (!dri_create_context(mesa_api, modes, context, &ctx_config, error,
|
||||
shareCtx)) {
|
||||
free(context);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -524,7 +525,7 @@ static void
|
|||
driDestroyContext(__DRIcontext *pcp)
|
||||
{
|
||||
if (pcp) {
|
||||
pcp->driScreenPriv->driver->DestroyContext(pcp);
|
||||
dri_destroy_context(pcp);
|
||||
free(pcp);
|
||||
}
|
||||
}
|
||||
|
@ -577,7 +578,7 @@ static int driBindContext(__DRIcontext *pcp,
|
|||
dri_get_drawable(prp);
|
||||
}
|
||||
|
||||
return pcp->driScreenPriv->driver->MakeCurrent(pcp, pdp, prp);
|
||||
return dri_make_current(pcp, pdp, prp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -610,10 +611,10 @@ static int driUnbindContext(__DRIcontext *pcp)
|
|||
return GL_FALSE;
|
||||
|
||||
/*
|
||||
** Call driUnbindContext before checking for valid drawables
|
||||
** Call dri_unbind_context before checking for valid drawables
|
||||
** to handle surfaceless contexts properly.
|
||||
*/
|
||||
pcp->driScreenPriv->driver->UnbindContext(pcp);
|
||||
dri_unbind_context(pcp);
|
||||
|
||||
pdp = pcp->driDrawablePriv;
|
||||
prp = pcp->driReadablePriv;
|
||||
|
|
|
@ -116,25 +116,12 @@ struct __DriverContextConfig {
|
|||
*
|
||||
* Each DRI driver must have one of these structures with all the pointers set
|
||||
* to appropriate functions within the driver.
|
||||
*
|
||||
* When glXCreateContext() is called, for example, it'll call a helper function
|
||||
* dri_util.c which in turn will jump through the \a CreateContext pointer in
|
||||
* this structure.
|
||||
*/
|
||||
struct __DriverAPIRec {
|
||||
const __DRIconfig **(*InitScreen) (__DRIscreen * priv);
|
||||
|
||||
void (*DestroyScreen)(__DRIscreen *driScrnPriv);
|
||||
|
||||
GLboolean (*CreateContext)(gl_api api,
|
||||
const struct gl_config *glVis,
|
||||
__DRIcontext *driContextPriv,
|
||||
const struct __DriverContextConfig *ctx_config,
|
||||
unsigned *error,
|
||||
void *sharedContextPrivate);
|
||||
|
||||
void (*DestroyContext)(__DRIcontext *driContextPriv);
|
||||
|
||||
GLboolean (*CreateBuffer)(__DRIscreen *driScrnPriv,
|
||||
__DRIdrawable *driDrawPriv,
|
||||
const struct gl_config *glVis,
|
||||
|
@ -144,12 +131,6 @@ struct __DriverAPIRec {
|
|||
|
||||
void (*SwapBuffers)(__DRIdrawable *driDrawPriv);
|
||||
|
||||
GLboolean (*MakeCurrent)(__DRIcontext *driContextPriv,
|
||||
__DRIdrawable *driDrawPriv,
|
||||
__DRIdrawable *driReadPriv);
|
||||
|
||||
GLboolean (*UnbindContext)(__DRIcontext *driContextPriv);
|
||||
|
||||
__DRIbuffer *(*AllocateBuffer) (__DRIscreen *screenPrivate,
|
||||
unsigned int attachment,
|
||||
unsigned int format,
|
||||
|
|
|
@ -603,13 +603,9 @@ drisw_create_buffer(__DRIscreen * sPriv,
|
|||
const struct __DriverAPIRec galliumsw_driver_api = {
|
||||
.InitScreen = drisw_init_screen,
|
||||
.DestroyScreen = dri_destroy_screen,
|
||||
.CreateContext = dri_create_context,
|
||||
.DestroyContext = dri_destroy_context,
|
||||
.CreateBuffer = drisw_create_buffer,
|
||||
.DestroyBuffer = dri_destroy_buffer,
|
||||
.SwapBuffers = drisw_swap_buffers,
|
||||
.MakeCurrent = dri_make_current,
|
||||
.UnbindContext = dri_unbind_context,
|
||||
.CopySubBuffer = drisw_copy_sub_buffer,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue