Mesa (master): mesa: fix typo and add assert() to _mesa_attach_renderbuffer_without_ref()
Timothy Arceri
tarceri at kemper.freedesktop.org
Mon Apr 10 23:59:49 UTC 2017
Module: Mesa
Branch: master
Commit: 8ffd54fef838784ef4388d48843cddf55246e529
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ffd54fef838784ef4388d48843cddf55246e529
Author: Timothy Arceri <tarceri at itsqueeze.com>
Date: Tue Apr 11 09:57:45 2017 +1000
mesa: fix typo and add assert() to _mesa_attach_renderbuffer_without_ref()
This function should only be used with a "freshly created" renderbuffer
so assert RefCount is 1.
---
src/mesa/main/renderbuffer.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c
index 627bdca66c..b58b3f3e91 100644
--- a/src/mesa/main/renderbuffer.c
+++ b/src/mesa/main/renderbuffer.c
@@ -141,13 +141,15 @@ validate_and_init_renderbuffer_attachment(struct gl_framebuffer *fb,
* \param bufferName one of the BUFFER_x tokens
*
* This function avoids adding a reference and is therefore intended to be
- * used with a freashly created renderbuffer.
+ * used with a freshly created renderbuffer.
*/
void
_mesa_add_renderbuffer_without_ref(struct gl_framebuffer *fb,
gl_buffer_index bufferName,
struct gl_renderbuffer *rb)
{
+ assert(rb->RefCount == 1);
+
validate_and_init_renderbuffer_attachment(fb, bufferName, rb);
_mesa_reference_renderbuffer(&fb->Attachment[bufferName].Renderbuffer,
More information about the mesa-commit
mailing list