summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-03 09:41:41 -0600
committerBrian Paul <[email protected]>2009-09-03 09:42:38 -0600
commit2f6d2a9e27f8582591dc60655f7d7b14d7552bbc (patch)
tree899c13067d3dd04223bf214e43209e32878cf041 /src/mesa/drivers/dri/radeon
parent848ab8be8c34b00b2afe6120882f8c29f047ced5 (diff)
mesa: change ctx->Driver.BufferData() to return GLboolean for success/failure
Return GL_FALSE if we failed to allocate the buffer. Then raise GL_OUT_OF_MEMORY in core Mesa.
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_buffer_objects.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c
index e8ae51e6eab..a24b6dac265 100644
--- a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c
+++ b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c
@@ -78,9 +78,10 @@ radeonDeleteBufferObject(GLcontext * ctx,
* Allocate space for and store data in a buffer object. Any data that was
* previously stored in the buffer object is lost. If data is NULL,
* memory will be allocated, but no copy will occur.
- * Called via glBufferDataARB().
+ * Called via ctx->Driver.BufferData().
+ * \return GL_TRUE for success, GL_FALSE if out of memory
*/
-static void
+static GLboolean
radeonBufferData(GLcontext * ctx,
GLenum target,
GLsizeiptrARB size,
@@ -107,6 +108,9 @@ radeonBufferData(GLcontext * ctx,
RADEON_GEM_DOMAIN_GTT,
0);
+ if (!radeon_obj->bo)
+ return GL_FALSE;
+
if (data != NULL) {
radeon_bo_map(radeon_obj->bo, GL_TRUE);
@@ -115,6 +119,7 @@ radeonBufferData(GLcontext * ctx,
radeon_bo_unmap(radeon_obj->bo);
}
}
+ return GL_TRUE;
}
/**