diff options
Diffstat (limited to 'mesalib/src/mesa/drivers/dri/common/dri_util.c')
-rwxr-xr-x[-rw-r--r--] | mesalib/src/mesa/drivers/dri/common/dri_util.c | 84 |
1 files changed, 44 insertions, 40 deletions
diff --git a/mesalib/src/mesa/drivers/dri/common/dri_util.c b/mesalib/src/mesa/drivers/dri/common/dri_util.c index d6e875fcf..28923319d 100644..100755 --- a/mesalib/src/mesa/drivers/dri/common/dri_util.c +++ b/mesalib/src/mesa/drivers/dri/common/dri_util.c @@ -116,6 +116,8 @@ driCreateNewScreen2(int scrn, int fd, { static const __DRIextension *emptyExtensionList[] = { NULL }; __DRIscreen *psp; + int gl_version_override; + int i; psp = calloc(1, sizeof(*psp)); if (!psp) @@ -128,7 +130,7 @@ driCreateNewScreen2(int scrn, int fd, * (megadrivers), use that instead. */ if (driver_extensions) { - for (int i = 0; driver_extensions[i]; i++) { + for (i = 0; driver_extensions[i]; i++) { if (strcmp(driver_extensions[i]->name, __DRI_DRIVER_VTABLE) == 0) { psp->driver = ((__DRIDriverVtableExtension *)driver_extensions[i])->vtable; @@ -162,7 +164,7 @@ driCreateNewScreen2(int scrn, int fd, return NULL; } - int gl_version_override = _mesa_get_gl_version_override(); + gl_version_override = _mesa_get_gl_version_override(); if (gl_version_override >= 31) { psp->max_gl_core_version = MAX2(psp->max_gl_core_version, gl_version_override); @@ -310,6 +312,8 @@ driCreateContextAttribs(__DRIscreen *screen, int api, unsigned minor_version = 0; uint32_t flags = 0; bool notify_reset = false; + unsigned i; + struct gl_context *ctx; assert((num_attribs == 0) || (attribs != NULL)); @@ -337,7 +341,7 @@ driCreateContextAttribs(__DRIscreen *screen, int api, return NULL; } - for (unsigned i = 0; i < num_attribs; i++) { + for (i = 0; i < num_attribs; i++) { switch (attribs[i * 2]) { case __DRI_CTX_ATTRIB_MAJOR_VERSION: major_version = attribs[i * 2 + 1]; @@ -734,36 +738,36 @@ driSwapBuffers(__DRIdrawable *pdp) /** Core interface */ const __DRIcoreExtension driCoreExtension = { - .base = { __DRI_CORE, 1 }, - - .createNewScreen = NULL, - .destroyScreen = driDestroyScreen, - .getExtensions = driGetExtensions, - .getConfigAttrib = driGetConfigAttrib, - .indexConfigAttrib = driIndexConfigAttrib, - .createNewDrawable = NULL, - .destroyDrawable = driDestroyDrawable, - .swapBuffers = driSwapBuffers, /* swrast */ - .createNewContext = driCreateNewContext, /* swrast */ - .copyContext = driCopyContext, - .destroyContext = driDestroyContext, - .bindContext = driBindContext, - .unbindContext = driUnbindContext + /*.base =*/ { __DRI_CORE, 1 }, + + /*.createNewScreen =*/ NULL, + /*.destroyScreen =*/ driDestroyScreen, + /*.getExtensions =*/ driGetExtensions, + /*.getConfigAttrib =*/ driGetConfigAttrib, + /*.indexConfigAttrib =*/ driIndexConfigAttrib, + /*.createNewDrawable =*/ NULL, + /*.destroyDrawable =*/ driDestroyDrawable, + /*.swapBuffers =*/ driSwapBuffers, /* swrast */ + /*.createNewContext =*/ driCreateNewContext, /* swrast */ + /*.copyContext =*/ driCopyContext, + /*.destroyContext =*/ driDestroyContext, + /*.bindContext =*/ driBindContext, + /*.unbindContext =*/ driUnbindContext }; /** DRI2 interface */ const __DRIdri2Extension driDRI2Extension = { - .base = { __DRI_DRI2, 4 }, - - .createNewScreen = dri2CreateNewScreen, - .createNewDrawable = driCreateNewDrawable, - .createNewContext = driCreateNewContext, - .getAPIMask = driGetAPIMask, - .createNewContextForAPI = driCreateNewContextForAPI, - .allocateBuffer = dri2AllocateBuffer, - .releaseBuffer = dri2ReleaseBuffer, - .createContextAttribs = driCreateContextAttribs, - .createNewScreen2 = driCreateNewScreen2, + /*.base =*/ { __DRI_DRI2, 4 }, + + /*.createNewScreen =*/ dri2CreateNewScreen, + /*.createNewDrawable =*/ driCreateNewDrawable, + /*.createNewContext =*/ driCreateNewContext, + /*.getAPIMask =*/ driGetAPIMask, + /*.createNewContextForAPI =*/ driCreateNewContextForAPI, + /*.allocateBuffer =*/ dri2AllocateBuffer, + /*.releaseBuffer =*/ dri2ReleaseBuffer, + /*.createContextAttribs =*/ driCreateContextAttribs, + /*.createNewScreen2 =*/ driCreateNewScreen2, }; const __DRIswrastExtension driSWRastExtension = { @@ -777,11 +781,11 @@ const __DRIswrastExtension driSWRastExtension = { }; const __DRI2configQueryExtension dri2ConfigQueryExtension = { - .base = { __DRI2_CONFIG_QUERY, 1 }, + /*.base =*/ { __DRI2_CONFIG_QUERY, 1 }, - .configQueryb = dri2ConfigQueryb, - .configQueryi = dri2ConfigQueryi, - .configQueryf = dri2ConfigQueryf, + /*.configQueryb =*/ dri2ConfigQueryb, + /*.configQueryi =*/ dri2ConfigQueryi, + /*.configQueryf =*/ dri2ConfigQueryf, }; void @@ -873,12 +877,12 @@ driImageFormatToGLFormat(uint32_t image_format) /** Image driver interface */ const __DRIimageDriverExtension driImageDriverExtension = { - .base = { __DRI_IMAGE_DRIVER, 1 }, + /*.base =*/ { __DRI_IMAGE_DRIVER, 1 }, - .createNewScreen2 = driCreateNewScreen2, - .createNewDrawable = driCreateNewDrawable, - .getAPIMask = driGetAPIMask, - .createContextAttribs = driCreateContextAttribs, + /*.createNewScreen2 =*/ driCreateNewScreen2, + /*.createNewDrawable =*/ driCreateNewDrawable, + /*.createContextAttribs =*/ driCreateContextAttribs, + /*.getAPIMask =*/ driGetAPIMask, }; /* swrast copy sub buffer entrypoint. */ @@ -892,7 +896,7 @@ static void driCopySubBuffer(__DRIdrawable *pdp, int x, int y, /* for swrast only */ const __DRIcopySubBufferExtension driCopySubBufferExtension = { - .base = { __DRI_COPY_SUB_BUFFER, 1 }, + /*.base =*/ { __DRI_COPY_SUB_BUFFER, 1 }, - .copySubBuffer = driCopySubBuffer, + /*.copySubBuffer =*/ driCopySubBuffer, }; |