-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Chris Wilson wrote:
One comment for future reference... I usually split up changes to the XML and code regeneration from "real" code changes. Intermixing makes for trying to find a needle in a haystack. There are 10,000+ lines of changes here, but only 300 of them are "real" code changes. The other option is to do the XML and "real" code changes as one commit and the code regeneration as a separate commit. I've been doing that a lot with the assembly parser code. Eric's suggestion of doing 3 commits (XML, regeneration, real code) is probably even better. Substantive comments are below. > Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk> > --- > src/mesa/glapi/APPLE_object_purgeable.xml | 35 + > src/mesa/glapi/Makefile | 1 + > src/mesa/glapi/gl_API.xml | 1 + > src/mesa/glapi/glapidispatch.h | 33 +- > src/mesa/glapi/glapioffsets.h | 18 +- > src/mesa/glapi/glapitable.h | 13 +- > src/mesa/glapi/glapitemp.h | 44 +- > src/mesa/glapi/glprocs.h | 634 ++-- > src/mesa/main/api_exec.c | 6 + > src/mesa/main/bufferobj.c | 151 + > src/mesa/main/bufferobj.h | 11 + > src/mesa/main/dd.h | 10 + > src/mesa/main/enums.c | 6054 > +++++++++++++++-------------- > src/mesa/main/extensions.c | 1 + > src/mesa/main/mfeatures.h | 1 + > src/mesa/main/mtypes.h | 2 + > src/mesa/main/remap_helper.h | 2992 +++++++------- > src/mesa/sparc/glapi_sparc.S | 19 +- > src/mesa/x86-64/glapi_x86-64.S | 181 +- > src/mesa/x86/glapi_x86.S | 23 +- Are there any hooks needed in dlist.c? > 20 files changed, 5334 insertions(+), 4896 deletions(-) > create mode 100644 src/mesa/glapi/APPLE_object_purgeable.xml > > diff --git a/src/mesa/glapi/APPLE_object_purgeable.xml > b/src/mesa/glapi/APPLE_object_purgeable.xml > new file mode 100644 > index 0000000..ba70e87 > --- /dev/null > +++ b/src/mesa/glapi/APPLE_object_purgeable.xml > @@ -0,0 +1,35 @@ > +<?xml version="1.0"?> > +<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd"> > + > +<OpenGLAPI> > +<category name="GL_APPLE_object_purgeable" number="371"> > + <enum name="RELEASED_APPLE" value="0x8A19"/> > + <enum name="VOLATILE_APPLE" value="0x8A1A"/> > + <enum name="RETAINED_APPLE" value="0x8A1B"/> > + <enum name="UNDEFINED_APPLE" value="0x8A1C"/> > + <enum name="PURGEABLE_APPLE" value="0x8A1D"/> > + > + <enum name="BUFFER_OBJECT_APPLE" value="0x85B3"/> Do any of these enums have associated Gets? > + > + <function name="ObjectPurgeableAPPLE" offset="assign"> > + <param name="objectType" type="GLenum"/> > + <param name="name" type="GLuint"/> > + <param name="option" type="GLenum"/> > + <return type="GLenum"/> > + </function> > + > + <function name="ObjectUnpurgeableAPPLE" offset="assign"> > + <param name="objectType" type="GLenum"/> > + <param name="name" type="GLuint"/> > + <param name="option" type="GLenum"/> > + <return type="GLenum"/> > + </function> > + > + <function name="GetObjectParameterivAPPLE" offset="assign"> > + <param name="objectType" type="GLenum"/> > + <param name="name" type="GLuint"/> > + <param name="pname" type="GLenum"/> > + <param name="value" type="GLint *" output="true"/> > + </function> > +</category> > +</OpenGLAPI> > diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c > index 52c4995..3991d76 100644 > --- a/src/mesa/main/bufferobj.c > +++ b/src/mesa/main/bufferobj.c > @@ -1655,3 +1655,154 @@ _mesa_FlushMappedBufferRange(GLenum target, GLintptr > offset, GLsizeiptr length) > if (ctx->Driver.FlushMappedBufferRange) > ctx->Driver.FlushMappedBufferRange(ctx, target, offset, length, > bufObj); > } > + > +#if FEATURE_APPLE_object_purgeable > +GLenum GLAPIENTRY > +_mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) > +{ > + GET_CURRENT_CONTEXT(ctx); > + struct gl_buffer_object *bufObj; > + > + switch (objectType) { > + case GL_TEXTURE: > + case GL_BUFFER_OBJECT_APPLE: > + case GL_RENDERBUFFER_EXT: > + break; > + > + default: > + _mesa_error(ctx, GL_INVALID_ENUM, > + "glObjectPurgeable(name = 0x%x) invalid type: %d", name, > objectType); > + return 0; > + } > + > + if (name == 0) { > + _mesa_error(ctx, GL_INVALID_VALUE, > + "glObjectPurgeable(name = 0x%x)", name); > + return 0; > + } > + > + switch (option) { > + case GL_VOLATILE_APPLE: > + case GL_RELEASED_APPLE: > + break; > + > + default: > + _mesa_error(ctx, GL_INVALID_ENUM, > + "glObjectPurgeable(name = 0x%x) invalid option: %d", name, > option); > + return 0; > + } > + > + bufObj = get_buffer(ctx, name); > + if (!bufObj) { > + _mesa_error(ctx, GL_INVALID_VALUE, > + "glObjectPurgeable(name = 0x%x)", name); > + return 0; > + } > + > + if (bufObj->purgeable) { > + _mesa_error(ctx, GL_INVALID_OPERATION, > + "glObjectPurgeable(name = 0x%x) is already purgeable", > name); > + return bufObj->purgeable; > + } > + > + bufObj->purgeable = option; This is wrong. ObjectPurgableAPPLE always sets the purgeable flag to true. The 'option' parameter gives the GL a hint as to how the application intends to use the object in the future. VOLATILE means the application doesn't know whether it will use the buffer again (i.e., only release it under memory pressure), and RELEASED means that it knows it's done with it (maybe release it now). On the flip side, the option to ObjectUnpurgable is really a hint of what to do when the buffer object has been paged out of VRAM on a discrete graphics card. We don't have to worry about this at all on UMA systems. > + if (ctx->Driver.ObjectPurgeable) > + bufObj->purgeable = ctx->Driver.ObjectPurgeable(ctx, bufObj, option); This is weird. Usually driver functions don't return a value to set in the object's state. The driver function just sets that state. > + > + return bufObj->purgeable; > +} > + > +GLenum GLAPIENTRY > +_mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) > +{ > + GET_CURRENT_CONTEXT(ctx); > + struct gl_buffer_object *bufObj; > + GLenum retval; > + > + switch (objectType) { > + case GL_TEXTURE: > + case GL_BUFFER_OBJECT_APPLE: > + case GL_RENDERBUFFER_EXT: > + break; > + > + default: > + _mesa_error(ctx, GL_INVALID_ENUM, > + "glObjectUnpurgeable(name = 0x%x) invalid type: %d", name, > objectType); > + return 0; > + } > + > + if (name == 0) { > + _mesa_error(ctx, GL_INVALID_VALUE, > + "glObjectUnpurgeable(name = 0x%x)", name); > + return 0; > + } > + > + switch (option) { > + case GL_RETAINED_APPLE: > + case GL_UNDEFINED_APPLE: > + break; > + > + default: > + _mesa_error(ctx, GL_INVALID_ENUM, > + "glObjectUnpurgeable(name = 0x%x) invalid option: %d", > name, option); > + return 0; > + } > + > + bufObj = get_buffer(ctx, name); > + if (!bufObj) { > + _mesa_error(ctx, GL_INVALID_VALUE, > + "glObjectUnpurgeable(name = 0x%x)", name); > + return 0; > + } > + > + if (! bufObj->purgeable) { > + _mesa_error(ctx, GL_INVALID_OPERATION, > + "glObjectUnpurgeable(name = 0x%x) object is already > \"unpurged\"", name); > + return 0; > + } > + > + retval = bufObj->purgeable = 0; > + if (ctx->Driver.ObjectUnpurgeable) > + retval = ctx->Driver.ObjectUnpurgeable(ctx, bufObj, option); > + > + return retval; Similar comment here as in the previous function. The purgeable flag must be false on exit, but this function is supposed to return option. > +} > + > +void GLAPIENTRY > +_mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum > pname, GLint* params) > +{ > + GET_CURRENT_CONTEXT(ctx); > + struct gl_buffer_object *bufObj; > + > + switch (objectType) { > + case GL_TEXTURE: > + case GL_BUFFER_OBJECT_APPLE: > + case GL_RENDERBUFFER_EXT: > + break; > + > + default: > + _mesa_error(ctx, GL_INVALID_ENUM, > + "glGetObjectParameteriv(name = %d) invalid type: %d", > name, objectType); > + return; > + } > + > + if (name == 0) { > + _mesa_error(ctx, GL_INVALID_VALUE, > + "glGetObjectParameteriv(name = %d)", name); > + return; > + } > + > + bufObj = get_buffer(ctx, name); > + if (!bufObj) { > + _mesa_error(ctx, GL_INVALID_VALUE, > + "glGetObjectParameteriv(name = 0x%x) invalid object", > name); > + return; > + } > + > + switch (pname) { > + case GL_PURGEABLE_APPLE: > + *params = !! bufObj->purgeable; > + break; > + } > +} > +#endif > diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h > index 99f2cad..412b857 100644 > --- a/src/mesa/main/dd.h > +++ b/src/mesa/main/dd.h > @@ -808,6 +808,16 @@ struct dd_function_table { > #endif > > /** > + * \name Functions for GL_APPLE_object_purgeable > + */ > +#if FEATURE_APPLE_object_purgeable > + /*...@{*/ > + GLenum (*ObjectPurgeable)( GLcontext *ctx, struct gl_buffer_object *obj, > GLenum option ); > + GLenum (*ObjectUnpurgeable)( GLcontext *ctx, struct gl_buffer_object > *obj, GLenum option ); > + /*...@}*/ > +#endif > + > + /** > * \name Functions for GL_EXT_framebuffer_object > */ > #if FEATURE_EXT_framebuffer_object > diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c > index 54cf37c..ba233dd 100644 > --- a/src/mesa/main/extensions.c > +++ b/src/mesa/main/extensions.c > @@ -147,6 +147,7 @@ static const struct { > { OFF, "GL_APPLE_client_storage", F(APPLE_client_storage) }, > { ON, "GL_APPLE_packed_pixels", F(APPLE_packed_pixels) }, > { OFF, "GL_APPLE_vertex_array_object", F(APPLE_vertex_array_object) > }, > + { OFF, "GL_APPLE_object_purgeable", F(APPLE_object_purgeable) }, ^ Trivial whitespace error. > { OFF, "GL_ATI_blend_equation_separate", > F(EXT_blend_equation_separate) }, > { OFF, "GL_ATI_envmap_bumpmap", F(ATI_envmap_bumpmap) }, > { OFF, "GL_ATI_texture_env_combine3", F(ATI_texture_env_combine3)}, This function should be enabled in the software paths. There's a function in this file that does that. > diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h > index 94d29a7..82d6e30 100644 > --- a/src/mesa/main/mtypes.h > +++ b/src/mesa/main/mtypes.h > @@ -1410,6 +1410,7 @@ struct gl_buffer_object > GLsizeiptr Length; /**< Mapped length */ > /*...@}*/ > GLboolean Written; /**< Ever written to? (for debugging) */ > + GLenum purgeable; /**< Purgeable status of the buffer */ Again, this should be a boolean. The enum is only used by the driver. > }; > > > @@ -2453,6 +2454,7 @@ struct gl_extensions > GLboolean APPLE_client_storage; > GLboolean APPLE_packed_pixels; > GLboolean APPLE_vertex_array_object; > + GLboolean APPLE_object_purgeable; > GLboolean ATI_envmap_bumpmap; > GLboolean ATI_texture_mirror_once; > GLboolean ATI_texture_env_combine3; -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkr7GSkACgkQX1gOwKyEAw/kFACeKFo82x1q6yKv+kJcKiBZUtqm QQ4AoIPv07YLhHTaUdOq4tzO6vBH38mJ =kFuy -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel