diff options
author | Brian Paul <[email protected]> | 2011-04-05 19:02:07 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-04-05 19:02:09 -0600 |
commit | 874a2c0b7da62f4dd08dedcec221f55b22e40e95 (patch) | |
tree | ea9f5132853bac739c6808efa99e799cbcb31dbf /src/mesa/main/texobj.c | |
parent | 9a77e285e8d015328278fcd0a110e662dba2e744 (diff) |
mesa: core support for GL_ARB_texture_buffer_object
No GLSL or driver support yet.
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r-- | src/mesa/main/texobj.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index c1e3e4dec79..61b9bc70d77 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -29,6 +29,7 @@ #include "mfeatures.h" +#include "bufferobj.h" #include "colortab.h" #include "context.h" #include "enums.h" @@ -105,7 +106,8 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, target == GL_TEXTURE_CUBE_MAP_ARB || target == GL_TEXTURE_RECTANGLE_NV || target == GL_TEXTURE_1D_ARRAY_EXT || - target == GL_TEXTURE_2D_ARRAY_EXT); + target == GL_TEXTURE_2D_ARRAY_EXT || + target == GL_TEXTURE_BUFFER); memset(obj, 0, sizeof(*obj)); /* init the non-zero fields */ @@ -204,6 +206,8 @@ _mesa_delete_texture_object(struct gl_context *ctx, } } + _mesa_reference_buffer_object(ctx, &texObj->BufferObject, NULL); + /* destroy the mutex -- it may have allocated memory (eg on bsd) */ _glthread_DESTROY_MUTEX(texObj->Mutex); @@ -299,6 +303,7 @@ valid_texture_object(const struct gl_texture_object *tex) case GL_TEXTURE_RECTANGLE_NV: case GL_TEXTURE_1D_ARRAY_EXT: case GL_TEXTURE_2D_ARRAY_EXT: + case GL_TEXTURE_BUFFER: return GL_TRUE; case 0x99: _mesa_problem(NULL, "invalid reference to a deleted texture object"); @@ -989,6 +994,8 @@ target_enum_to_index(GLenum target) return TEXTURE_1D_ARRAY_INDEX; case GL_TEXTURE_2D_ARRAY_EXT: return TEXTURE_2D_ARRAY_INDEX; + case GL_TEXTURE_BUFFER_ARB: + return TEXTURE_BUFFER_INDEX; default: return -1; } |