X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fbufferobj.h;h=9f732ec0c07cfb3b70b2af4bea9d6025a546f5a3;hb=ade1cc992410c8696fdfe0f84fb613fd0dc8099f;hp=3c08f0083cf64fcb08fa96a57e718da958fe1c6a;hpb=2e28c1fda24988241ef7abb91b7d896e38f5df26;p=mesa.git diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index 3c08f0083cf..9f732ec0c07 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.2 + * Version: 7.6 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -35,17 +36,32 @@ * Internal functions */ + +/** Is the given buffer object currently mapped? */ +static INLINE GLboolean +_mesa_bufferobj_mapped(const struct gl_buffer_object *obj) +{ + return obj->Pointer != NULL; +} + +/** + * Is the given buffer object a user-created buffer object? + * Mesa uses default buffer objects in several places. Default buffers + * always have Name==0. User created buffers have Name!=0. + */ +static INLINE GLboolean +_mesa_is_bufferobj(const struct gl_buffer_object *obj) +{ + return obj->Name != 0; +} + + extern void _mesa_init_buffer_objects( GLcontext *ctx ); extern void _mesa_update_default_objects_buffer_objects(GLcontext *ctx); -extern struct gl_buffer_object * -_mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target ); - -extern void -_mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ); extern struct gl_buffer_object * _mesa_lookup_bufferobj(GLcontext *ctx, GLuint buffer); @@ -59,63 +75,50 @@ _mesa_reference_buffer_object(GLcontext *ctx, struct gl_buffer_object **ptr, struct gl_buffer_object *bufObj); -extern void -_mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size, - const GLvoid * data, GLenum usage, - struct gl_buffer_object * bufObj ); - -extern void -_mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, - GLsizeiptrARB size, const GLvoid * data, - struct gl_buffer_object * bufObj ); - -extern void -_mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, - GLsizeiptrARB size, GLvoid * data, - struct gl_buffer_object * bufObj ); - -extern void * -_mesa_buffer_map( GLcontext *ctx, GLenum target, GLenum access, - struct gl_buffer_object * bufObj ); - -extern GLboolean -_mesa_buffer_unmap( GLcontext *ctx, GLenum target, - struct gl_buffer_object * bufObj ); - extern GLboolean _mesa_validate_pbo_access(GLuint dimensions, const struct gl_pixelstore_attrib *pack, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *ptr); -extern const GLubyte * -_mesa_map_bitmap_pbo(GLcontext *ctx, +extern const GLvoid * +_mesa_map_pbo_source(GLcontext *ctx, const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap); - -extern void -_mesa_unmap_bitmap_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack); + const GLvoid *src); extern const GLvoid * -_mesa_map_drawpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels); +_mesa_map_validate_pbo_source(GLcontext *ctx, + GLuint dimensions, + const struct gl_pixelstore_attrib *unpack, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, const GLvoid *ptr, + const char *where); extern void -_mesa_unmap_drawpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack); +_mesa_unmap_pbo_source(GLcontext *ctx, + const struct gl_pixelstore_attrib *unpack); extern void * -_mesa_map_readpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *pack, - GLvoid *dest); +_mesa_map_pbo_dest(GLcontext *ctx, + const struct gl_pixelstore_attrib *pack, + GLvoid *dest); + +extern GLvoid * +_mesa_map_validate_pbo_dest(GLcontext *ctx, + GLuint dimensions, + const struct gl_pixelstore_attrib *unpack, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, GLvoid *ptr, + const char *where); extern void -_mesa_unmap_readpix_pbo(GLcontext *ctx, - const struct gl_pixelstore_attrib *pack); +_mesa_unmap_pbo_dest(GLcontext *ctx, + const struct gl_pixelstore_attrib *pack); +extern void +_mesa_init_buffer_object_functions(struct dd_function_table *driver); + /* * API functions @@ -154,4 +157,16 @@ _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params); extern void GLAPIENTRY _mesa_GetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params); +extern void GLAPIENTRY +_mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, + GLintptr readOffset, GLintptr writeOffset, + GLsizeiptr size); + +extern void * GLAPIENTRY +_mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, + GLbitfield access); + +extern void GLAPIENTRY +_mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length); + #endif