summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-05-31 14:14:55 +0200
committerSamuel Pitoiset <[email protected]>2017-06-07 11:03:47 +0200
commitec0c2eb84515e9f92f2030d212b26194e574ea83 (patch)
treeb9da603228dbe28197631dc835e7bf455fc3e802
parent2933ed56cef8804be4179d68704614735b92fee4 (diff)
mesa: add invalidate_buffer_subdata() helper
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r--src/mesa/main/bufferobj.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 9e656a4c989..4f3c6402486 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -4237,6 +4237,15 @@ _mesa_BindBuffersBase(GLenum target, GLuint first, GLsizei count,
}
}
+static ALWAYS_INLINE void
+invalidate_buffer_subdata(struct gl_context *ctx,
+ struct gl_buffer_object *bufObj, GLintptr offset,
+ GLsizeiptr length)
+{
+ if (ctx->Driver.InvalidateBufferSubData)
+ ctx->Driver.InvalidateBufferSubData(ctx, bufObj, offset, length);
+}
+
void GLAPIENTRY
_mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
GLsizeiptr length)
@@ -4286,8 +4295,7 @@ _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
return;
}
- if (ctx->Driver.InvalidateBufferSubData)
- ctx->Driver.InvalidateBufferSubData(ctx, bufObj, offset, length);
+ invalidate_buffer_subdata(ctx, bufObj, offset, length);
}
void GLAPIENTRY
@@ -4324,8 +4332,7 @@ _mesa_InvalidateBufferData(GLuint buffer)
return;
}
- if (ctx->Driver.InvalidateBufferSubData)
- ctx->Driver.InvalidateBufferSubData(ctx, bufObj, 0, bufObj->Size);
+ invalidate_buffer_subdata(ctx, bufObj, 0, bufObj->Size);
}
static void