summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/bufferobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/bufferobj.c')
-rw-r--r--src/mesa/main/bufferobj.c80
1 files changed, 37 insertions, 43 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 4797f29b4dc..0a68008a100 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -62,7 +62,7 @@
* specified context or \c NULL if \c target is invalid.
*/
static INLINE struct gl_buffer_object **
-get_buffer_target(GLcontext *ctx, GLenum target)
+get_buffer_target(struct gl_context *ctx, GLenum target)
{
switch (target) {
case GL_ARRAY_BUFFER_ARB:
@@ -74,15 +74,9 @@ get_buffer_target(GLcontext *ctx, GLenum target)
case GL_PIXEL_UNPACK_BUFFER_EXT:
return &ctx->Unpack.BufferObj;
case GL_COPY_READ_BUFFER:
- if (ctx->Extensions.ARB_copy_buffer) {
- return &ctx->CopyReadBuffer;
- }
- break;
+ return &ctx->CopyReadBuffer;
case GL_COPY_WRITE_BUFFER:
- if (ctx->Extensions.ARB_copy_buffer) {
- return &ctx->CopyWriteBuffer;
- }
- break;
+ return &ctx->CopyWriteBuffer;
#if FEATURE_EXT_transform_feedback
case GL_TRANSFORM_FEEDBACK_BUFFER:
if (ctx->Extensions.EXT_transform_feedback) {
@@ -105,7 +99,7 @@ get_buffer_target(GLcontext *ctx, GLenum target)
* specified context or \c NULL if \c target is invalid.
*/
static INLINE struct gl_buffer_object *
-get_buffer(GLcontext *ctx, GLenum target)
+get_buffer(struct gl_context *ctx, GLenum target)
{
struct gl_buffer_object **bufObj = get_buffer_target(ctx, target);
if (bufObj)
@@ -149,7 +143,7 @@ simplified_access_mode(GLbitfield access)
* \sa glBufferSubDataARB, glGetBufferSubDataARB
*/
static struct gl_buffer_object *
-buffer_object_subdata_range_good( GLcontext * ctx, GLenum target,
+buffer_object_subdata_range_good( struct gl_context * ctx, GLenum target,
GLintptrARB offset, GLsizeiptrARB size,
const char *caller )
{
@@ -195,7 +189,7 @@ buffer_object_subdata_range_good( GLcontext * ctx, GLenum target,
* Default callback for the \c dd_function_table::NewBufferObject() hook.
*/
static struct gl_buffer_object *
-_mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target )
+_mesa_new_buffer_object( struct gl_context *ctx, GLuint name, GLenum target )
{
struct gl_buffer_object *obj;
@@ -213,7 +207,7 @@ _mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target )
* Default callback for the \c dd_function_table::DeleteBuffer() hook.
*/
static void
-_mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj )
+_mesa_delete_buffer_object( struct gl_context *ctx, struct gl_buffer_object *bufObj )
{
(void) ctx;
@@ -234,7 +228,7 @@ _mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj )
* Set ptr to bufObj w/ reference counting.
*/
void
-_mesa_reference_buffer_object(GLcontext *ctx,
+_mesa_reference_buffer_object(struct gl_context *ctx,
struct gl_buffer_object **ptr,
struct gl_buffer_object *bufObj)
{
@@ -334,7 +328,7 @@ _mesa_initialize_buffer_object( struct gl_buffer_object *obj,
* \sa glBufferDataARB, dd_function_table::BufferData.
*/
static GLboolean
-_mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size,
+_mesa_buffer_data( struct gl_context *ctx, GLenum target, GLsizeiptrARB size,
const GLvoid * data, GLenum usage,
struct gl_buffer_object * bufObj )
{
@@ -378,7 +372,7 @@ _mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size,
* \sa glBufferSubDataARB, dd_function_table::BufferSubData.
*/
static void
-_mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
+_mesa_buffer_subdata( struct gl_context *ctx, GLenum target, GLintptrARB offset,
GLsizeiptrARB size, const GLvoid * data,
struct gl_buffer_object * bufObj )
{
@@ -411,7 +405,7 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
* \sa glBufferGetSubDataARB, dd_function_table::GetBufferSubData.
*/
static void
-_mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
+_mesa_buffer_get_subdata( struct gl_context *ctx, GLenum target, GLintptrARB offset,
GLsizeiptrARB size, GLvoid * data,
struct gl_buffer_object * bufObj )
{
@@ -438,7 +432,7 @@ _mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
* \sa glMapBufferARB, dd_function_table::MapBuffer
*/
static void *
-_mesa_buffer_map( GLcontext *ctx, GLenum target, GLenum access,
+_mesa_buffer_map( struct gl_context *ctx, GLenum target, GLenum access,
struct gl_buffer_object *bufObj )
{
(void) ctx;
@@ -461,7 +455,7 @@ _mesa_buffer_map( GLcontext *ctx, GLenum target, GLenum access,
* Called via glMapBufferRange().
*/
static void *
-_mesa_buffer_map_range( GLcontext *ctx, GLenum target, GLintptr offset,
+_mesa_buffer_map_range( struct gl_context *ctx, GLenum target, GLintptr offset,
GLsizeiptr length, GLbitfield access,
struct gl_buffer_object *bufObj )
{
@@ -482,7 +476,7 @@ _mesa_buffer_map_range( GLcontext *ctx, GLenum target, GLintptr offset,
* Called via glFlushMappedBufferRange().
*/
static void
-_mesa_buffer_flush_mapped_range( GLcontext *ctx, GLenum target,
+_mesa_buffer_flush_mapped_range( struct gl_context *ctx, GLenum target,
GLintptr offset, GLsizeiptr length,
struct gl_buffer_object *obj )
{
@@ -503,7 +497,7 @@ _mesa_buffer_flush_mapped_range( GLcontext *ctx, GLenum target,
* \sa glUnmapBufferARB, dd_function_table::UnmapBuffer
*/
static GLboolean
-_mesa_buffer_unmap( GLcontext *ctx, GLenum target,
+_mesa_buffer_unmap( struct gl_context *ctx, GLenum target,
struct gl_buffer_object *bufObj )
{
(void) ctx;
@@ -522,7 +516,7 @@ _mesa_buffer_unmap( GLcontext *ctx, GLenum target,
* Called via glCopyBuffserSubData().
*/
static void
-_mesa_copy_buffer_subdata(GLcontext *ctx,
+_mesa_copy_buffer_subdata(struct gl_context *ctx,
struct gl_buffer_object *src,
struct gl_buffer_object *dst,
GLintptr readOffset, GLintptr writeOffset,
@@ -552,7 +546,7 @@ _mesa_copy_buffer_subdata(GLcontext *ctx,
* Initialize the state associated with buffer objects
*/
void
-_mesa_init_buffer_objects( GLcontext *ctx )
+_mesa_init_buffer_objects( struct gl_context *ctx )
{
_mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj,
ctx->Shared->NullBufferObj);
@@ -567,7 +561,7 @@ _mesa_init_buffer_objects( GLcontext *ctx )
void
-_mesa_free_buffer_objects( GLcontext *ctx )
+_mesa_free_buffer_objects( struct gl_context *ctx )
{
_mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL);
_mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj, NULL);
@@ -582,7 +576,7 @@ _mesa_free_buffer_objects( GLcontext *ctx )
* Called by glBindBuffer() and other functions.
*/
static void
-bind_buffer_object(GLcontext *ctx, GLenum target, GLuint buffer)
+bind_buffer_object(struct gl_context *ctx, GLenum target, GLuint buffer)
{
struct gl_buffer_object *oldBufObj;
struct gl_buffer_object *newBufObj = NULL;
@@ -638,7 +632,7 @@ bind_buffer_object(GLcontext *ctx, GLenum target, GLuint buffer)
* shared state.
*/
void
-_mesa_update_default_objects_buffer_objects(GLcontext *ctx)
+_mesa_update_default_objects_buffer_objects(struct gl_context *ctx)
{
/* Bind the NullBufferObj to remove references to those
* in the shared context hash table.
@@ -722,7 +716,7 @@ _mesa_validate_pbo_access(GLuint dimensions,
* \return NULL if error, else pointer to start of data
*/
const GLvoid *
-_mesa_map_pbo_source(GLcontext *ctx,
+_mesa_map_pbo_source(struct gl_context *ctx,
const struct gl_pixelstore_attrib *unpack,
const GLvoid *src)
{
@@ -756,7 +750,7 @@ _mesa_map_pbo_source(GLcontext *ctx,
* _mesa_unmap_pbo_source().
*/
const GLvoid *
-_mesa_map_validate_pbo_source(GLcontext *ctx,
+_mesa_map_validate_pbo_source(struct gl_context *ctx,
GLuint dimensions,
const struct gl_pixelstore_attrib *unpack,
GLsizei width, GLsizei height, GLsizei depth,
@@ -792,7 +786,7 @@ _mesa_map_validate_pbo_source(GLcontext *ctx,
* Counterpart to _mesa_map_pbo_source()
*/
void
-_mesa_unmap_pbo_source(GLcontext *ctx,
+_mesa_unmap_pbo_source(struct gl_context *ctx,
const struct gl_pixelstore_attrib *unpack)
{
ASSERT(unpack != &ctx->Pack); /* catch pack/unpack mismatch */
@@ -812,7 +806,7 @@ _mesa_unmap_pbo_source(GLcontext *ctx,
* \return NULL if error, else pointer to start of data
*/
void *
-_mesa_map_pbo_dest(GLcontext *ctx,
+_mesa_map_pbo_dest(struct gl_context *ctx,
const struct gl_pixelstore_attrib *pack,
GLvoid *dest)
{
@@ -846,7 +840,7 @@ _mesa_map_pbo_dest(GLcontext *ctx,
* _mesa_unmap_pbo_dest().
*/
GLvoid *
-_mesa_map_validate_pbo_dest(GLcontext *ctx,
+_mesa_map_validate_pbo_dest(struct gl_context *ctx,
GLuint dimensions,
const struct gl_pixelstore_attrib *unpack,
GLsizei width, GLsizei height, GLsizei depth,
@@ -882,7 +876,7 @@ _mesa_map_validate_pbo_dest(GLcontext *ctx,
* Counterpart to _mesa_map_pbo_dest()
*/
void
-_mesa_unmap_pbo_dest(GLcontext *ctx,
+_mesa_unmap_pbo_dest(struct gl_context *ctx,
const struct gl_pixelstore_attrib *pack)
{
ASSERT(pack != &ctx->Unpack); /* catch pack/unpack mismatch */
@@ -898,7 +892,7 @@ _mesa_unmap_pbo_dest(GLcontext *ctx,
* Always return NULL for ID 0.
*/
struct gl_buffer_object *
-_mesa_lookup_bufferobj(GLcontext *ctx, GLuint buffer)
+_mesa_lookup_bufferobj(struct gl_context *ctx, GLuint buffer)
{
if (buffer == 0)
return NULL;
@@ -915,7 +909,7 @@ _mesa_lookup_bufferobj(GLcontext *ctx, GLuint buffer)
* unbound from all arrays in the current context.
*/
static void
-unbind(GLcontext *ctx,
+unbind(struct gl_context *ctx,
struct gl_buffer_object **ptr,
struct gl_buffer_object *obj)
{
@@ -1760,7 +1754,7 @@ _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
#if FEATURE_APPLE_object_purgeable
static GLenum
-_mesa_BufferObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option)
+_mesa_BufferObjectPurgeable(struct gl_context *ctx, GLuint name, GLenum option)
{
struct gl_buffer_object *bufObj;
GLenum retval;
@@ -1793,7 +1787,7 @@ _mesa_BufferObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option)
static GLenum
-_mesa_RenderObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option)
+_mesa_RenderObjectPurgeable(struct gl_context *ctx, GLuint name, GLenum option)
{
struct gl_renderbuffer *bufObj;
GLenum retval;
@@ -1822,7 +1816,7 @@ _mesa_RenderObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option)
static GLenum
-_mesa_TextureObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option)
+_mesa_TextureObjectPurgeable(struct gl_context *ctx, GLuint name, GLenum option)
{
struct gl_texture_object *bufObj;
GLenum retval;
@@ -1903,7 +1897,7 @@ _mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option)
static GLenum
-_mesa_BufferObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option)
+_mesa_BufferObjectUnpurgeable(struct gl_context *ctx, GLuint name, GLenum option)
{
struct gl_buffer_object *bufObj;
GLenum retval;
@@ -1933,7 +1927,7 @@ _mesa_BufferObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option)
static GLenum
-_mesa_RenderObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option)
+_mesa_RenderObjectUnpurgeable(struct gl_context *ctx, GLuint name, GLenum option)
{
struct gl_renderbuffer *bufObj;
GLenum retval;
@@ -1963,7 +1957,7 @@ _mesa_RenderObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option)
static GLenum
-_mesa_TextureObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option)
+_mesa_TextureObjectUnpurgeable(struct gl_context *ctx, GLuint name, GLenum option)
{
struct gl_texture_object *bufObj;
GLenum retval;
@@ -2033,7 +2027,7 @@ _mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option)
static void
-_mesa_GetBufferObjectParameterivAPPLE(GLcontext *ctx, GLuint name,
+_mesa_GetBufferObjectParameterivAPPLE(struct gl_context *ctx, GLuint name,
GLenum pname, GLint* params)
{
struct gl_buffer_object *bufObj;
@@ -2059,7 +2053,7 @@ _mesa_GetBufferObjectParameterivAPPLE(GLcontext *ctx, GLuint name,
static void
-_mesa_GetRenderObjectParameterivAPPLE(GLcontext *ctx, GLuint name,
+_mesa_GetRenderObjectParameterivAPPLE(struct gl_context *ctx, GLuint name,
GLenum pname, GLint* params)
{
struct gl_renderbuffer *bufObj;
@@ -2085,7 +2079,7 @@ _mesa_GetRenderObjectParameterivAPPLE(GLcontext *ctx, GLuint name,
static void
-_mesa_GetTextureObjectParameterivAPPLE(GLcontext *ctx, GLuint name,
+_mesa_GetTextureObjectParameterivAPPLE(struct gl_context *ctx, GLuint name,
GLenum pname, GLint* params)
{
struct gl_texture_object *bufObj;