diff options
Diffstat (limited to 'src/mesa/drivers/dri/common')
| -rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 32 | ||||
| -rw-r--r-- | src/mesa/drivers/dri/common/extension_helper.h | 74 | ||||
| -rw-r--r-- | src/mesa/drivers/dri/common/xmlpool.h | 4 | 
3 files changed, 90 insertions, 20 deletions
| diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 576494940f..2b1493a6de 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -37,6 +37,9 @@  typedef GLboolean ( * PFNGLXGETMSCRATEOMLPROC) (__DRIdrawable *drawable, int32_t *numerator, int32_t *denominator);  #endif +static void dri_get_drawable(__DRIdrawable *pdp); +static void dri_put_drawable(__DRIdrawable *pdp); +  /**   * This is just a token extension used to signal that the driver   * supports setting a read drawable. @@ -130,7 +133,7 @@ static int driUnbindContext(__DRIcontext *pcp)  	return GL_FALSE;      } -    pdp->refcount--; +    dri_put_drawable(pdp);      if (prp != pdp) {          if (prp->refcount == 0) { @@ -138,7 +141,7 @@ static int driUnbindContext(__DRIcontext *pcp)  	    return GL_FALSE;  	} -	prp->refcount--; +    	dri_put_drawable(prp);      } @@ -174,10 +177,10 @@ static int driBindContext(__DRIcontext *pcp,  	pcp->driReadablePriv = prp;  	if (pdp) {  	    pdp->driContextPriv = pcp; -	    pdp->refcount++; +    	    dri_get_drawable(pdp);  	}  	if ( prp && pdp != prp ) { -	    prp->refcount++; +    	    dri_get_drawable(prp);  	}      } @@ -434,7 +437,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config,      pdp->loaderPrivate = data;      pdp->hHWDrawable = hwDrawable; -    pdp->refcount = 0; +    pdp->refcount = 1;      pdp->pStamp = NULL;      pdp->lastStamp = 0;      pdp->index = 0; @@ -487,12 +490,19 @@ dri2CreateNewDrawable(__DRIscreen *screen,      return pdraw;  } - -static void -driDestroyDrawable(__DRIdrawable *pdp) +static void dri_get_drawable(__DRIdrawable *pdp) +{ +    pdp->refcount++; +} +	 +static void dri_put_drawable(__DRIdrawable *pdp)  {      __DRIscreenPrivate *psp; +    pdp->refcount--; +    if (pdp->refcount) +	return; +      if (pdp) {  	psp = pdp->driScreenPriv;          (*psp->DriverAPI.DestroyBuffer)(pdp); @@ -508,6 +518,12 @@ driDestroyDrawable(__DRIdrawable *pdp)      }  } +static void +driDestroyDrawable(__DRIdrawable *pdp) +{ +    dri_put_drawable(pdp); +} +  /*@}*/ diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h index 8dcaaee307..8df0e6c44b 100644 --- a/src/mesa/drivers/dri/common/extension_helper.h +++ b/src/mesa/drivers/dri/common/extension_helper.h @@ -1763,6 +1763,13 @@ static const char DeleteFencesNV_names[] =      "";  #endif +#if defined(need_GL_SGIX_polynomial_ffd) +static const char DeformationMap3dSGIX_names[] =  +    "iddiiddiiddiip\0" /* Parameter signature */ +    "glDeformationMap3dSGIX\0" +    ""; +#endif +  #if defined(need_GL_VERSION_2_0)  static const char IsShader_names[] =       "i\0" /* Parameter signature */ @@ -2766,10 +2773,10 @@ static const char Uniform4fARB_names[] =      "";  #endif -#if defined(need_GL_IBM_multimode_draw_arrays) -static const char MultiModeDrawArraysIBM_names[] =  -    "pppii\0" /* Parameter signature */ -    "glMultiModeDrawArraysIBM\0" +#if defined(need_GL_ARB_map_buffer_range) +static const char FlushMappedBufferRange_names[] =  +    "iii\0" /* Parameter signature */ +    "glFlushMappedBufferRange\0"      "";  #endif @@ -3897,6 +3904,13 @@ static const char VertexAttribs4dvNV_names[] =      "";  #endif +#if defined(need_GL_IBM_multimode_draw_arrays) +static const char MultiModeDrawArraysIBM_names[] =  +    "pppii\0" /* Parameter signature */ +    "glMultiModeDrawArraysIBM\0" +    ""; +#endif +  #if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)  static const char VertexAttrib4dARB_names[] =       "idddd\0" /* Parameter signature */ @@ -4048,6 +4062,13 @@ static const char IsVertexArrayAPPLE_names[] =      "";  #endif +#if defined(need_GL_ARB_map_buffer_range) +static const char MapBufferRange_names[] =  +    "iiii\0" /* Parameter signature */ +    "glMapBufferRange\0" +    ""; +#endif +  #if defined(need_GL_NV_vertex_program)  static const char ProgramParameters4dvNV_names[] =       "iiip\0" /* Parameter signature */ @@ -4289,6 +4310,13 @@ static const char SpriteParameterivSGIX_names[] =      "";  #endif +#if defined(need_GL_EXT_provoking_vertex) +static const char ProvokingVertexEXT_names[] =  +    "i\0" /* Parameter signature */ +    "glProvokingVertexEXT\0" +    ""; +#endif +  #if defined(need_GL_VERSION_1_3)  static const char MultiTexCoord1fARB_names[] =       "if\0" /* Parameter signature */ @@ -4396,6 +4424,13 @@ static const char WindowPos3ivMESA_names[] =      "";  #endif +#if defined(need_GL_ARB_copy_buffer) +static const char CopyBufferSubData_names[] =  +    "iiiii\0" /* Parameter signature */ +    "glCopyBufferSubData\0" +    ""; +#endif +  #if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object)  static const char IsBufferARB_names[] =       "i\0" /* Parameter signature */ @@ -4560,13 +4595,6 @@ static const char Minmax_names[] =      "";  #endif -#if defined(need_GL_SGIX_polynomial_ffd) -static const char DeformationMap3dSGIX_names[] =  -    "iddiiddiiddiip\0" /* Parameter signature */ -    "glDeformationMap3dSGIX\0" -    ""; -#endif -  #if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord)  static const char FogCoorddvEXT_names[] =       "p\0" /* Parameter signature */ @@ -4939,6 +4967,13 @@ static const struct dri_extension_function GL_APPLE_vertex_array_object_function  };  #endif +#if defined(need_GL_ARB_copy_buffer) +static const struct dri_extension_function GL_ARB_copy_buffer_functions[] = { +    { CopyBufferSubData_names, CopyBufferSubData_remap_index, -1 }, +    { NULL, 0, 0 } +}; +#endif +  #if defined(need_GL_ARB_draw_buffers)  static const struct dri_extension_function GL_ARB_draw_buffers_functions[] = {      { DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 }, @@ -4972,6 +5007,14 @@ static const struct dri_extension_function GL_ARB_framebuffer_object_functions[]  };  #endif +#if defined(need_GL_ARB_map_buffer_range) +static const struct dri_extension_function GL_ARB_map_buffer_range_functions[] = { +    { FlushMappedBufferRange_names, FlushMappedBufferRange_remap_index, -1 }, +    { MapBufferRange_names, MapBufferRange_remap_index, -1 }, +    { NULL, 0, 0 } +}; +#endif +  #if defined(need_GL_ARB_matrix_palette)  static const struct dri_extension_function GL_ARB_matrix_palette_functions[] = {      { MatrixIndexusvARB_names, MatrixIndexusvARB_remap_index, -1 }, @@ -5527,6 +5570,13 @@ static const struct dri_extension_function GL_EXT_polygon_offset_functions[] = {  };  #endif +#if defined(need_GL_EXT_provoking_vertex) +static const struct dri_extension_function GL_EXT_provoking_vertex_functions[] = { +    { ProvokingVertexEXT_names, ProvokingVertexEXT_remap_index, -1 }, +    { NULL, 0, 0 } +}; +#endif +  #if defined(need_GL_EXT_secondary_color)  static const struct dri_extension_function GL_EXT_secondary_color_functions[] = {      { SecondaryColor3iEXT_names, SecondaryColor3iEXT_remap_index, -1 }, @@ -6055,9 +6105,9 @@ static const struct dri_extension_function GL_SGIX_pixel_texture_functions[] = {  #if defined(need_GL_SGIX_polynomial_ffd)  static const struct dri_extension_function GL_SGIX_polynomial_ffd_functions[] = {      { LoadIdentityDeformationMapSGIX_names, LoadIdentityDeformationMapSGIX_remap_index, -1 }, +    { DeformationMap3dSGIX_names, DeformationMap3dSGIX_remap_index, -1 },      { DeformSGIX_names, DeformSGIX_remap_index, -1 },      { DeformationMap3fSGIX_names, DeformationMap3fSGIX_remap_index, -1 }, -    { DeformationMap3dSGIX_names, DeformationMap3dSGIX_remap_index, -1 },      { NULL, 0, 0 }  };  #endif diff --git a/src/mesa/drivers/dri/common/xmlpool.h b/src/mesa/drivers/dri/common/xmlpool.h index 7fbc6e800d..587517ea10 100644 --- a/src/mesa/drivers/dri/common/xmlpool.h +++ b/src/mesa/drivers/dri/common/xmlpool.h @@ -60,6 +60,10 @@  #define DRI_CONF_OPT_BEGIN(name,type,def) \  "<option name=\""#name"\" type=\""#type"\" default=\""#def"\">\n" +/** \brief Begin an option definition with qouted default value */ +#define DRI_CONF_OPT_BEGIN_Q(name,type,def) \ +"<option name=\""#name"\" type=\""#type"\" default="#def">\n" +  /** \brief Begin an option definition with restrictions on valid values */  #define DRI_CONF_OPT_BEGIN_V(name,type,def,valid) \  "<option name=\""#name"\" type=\""#type"\" default=\""#def"\" valid=\""valid"\">\n" | 
