summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-07-18 20:46:19 +0200
committerSamuel Pitoiset <[email protected]>2017-07-31 13:53:39 +0200
commit3339b53755b520635c67f5a3ff90628023226334 (patch)
tree3e9d165d845536a8bc2f90bf3fd53f505db8f45e
parentc566ba29b6c456f4b19da704113ad70504879e3f (diff)
mesa: add delete_samplers() helper
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r--src/mesa/main/samplerobj.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index 59ec813013e..4cb4914731b 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -231,22 +231,14 @@ _mesa_CreateSamplers(GLsizei count, GLuint *samplers)
}
-void GLAPIENTRY
-_mesa_DeleteSamplers(GLsizei count, const GLuint *samplers)
+static void
+delete_samplers(struct gl_context *ctx, GLsizei count, const GLuint *samplers)
{
- GET_CURRENT_CONTEXT(ctx);
- GLsizei i;
-
FLUSH_VERTICES(ctx, 0);
- if (count < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteSamplers(count)");
- return;
- }
-
_mesa_HashLockMutex(ctx->Shared->SamplerObjects);
- for (i = 0; i < count; i++) {
+ for (GLsizei i = 0; i < count; i++) {
if (samplers[i]) {
GLuint j;
struct gl_sampler_object *sampObj =
@@ -273,6 +265,20 @@ _mesa_DeleteSamplers(GLsizei count, const GLuint *samplers)
}
+void GLAPIENTRY
+_mesa_DeleteSamplers(GLsizei count, const GLuint *samplers)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (count < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteSamplers(count)");
+ return;
+ }
+
+ delete_samplers(ctx, count, samplers);
+}
+
+
GLboolean GLAPIENTRY
_mesa_IsSampler(GLuint sampler)
{