mesa: remove unneeded semicolons
[mesa.git] / src / mesa / main / samplerobj.c
index 260cff6450aba7ff62e428e50d80745dceccb0dc..5ebf9e24f94d30ef07926870790a076072236446 100644 (file)
@@ -63,7 +63,7 @@ delete_sampler_object(struct gl_context *ctx,
                       struct gl_sampler_object *sampObj)
 {
    _mesa_delete_sampler_handles(ctx, sampObj);
-   mtx_destroy(&sampObj->Mutex);
+   simple_mtx_destroy(&sampObj->Mutex);
    free(sampObj->Label);
    free(sampObj);
 }
@@ -83,11 +83,11 @@ _mesa_reference_sampler_object_(struct gl_context *ctx,
       GLboolean deleteFlag = GL_FALSE;
       struct gl_sampler_object *oldSamp = *ptr;
 
-      mtx_lock(&oldSamp->Mutex);
+      simple_mtx_lock(&oldSamp->Mutex);
       assert(oldSamp->RefCount > 0);
       oldSamp->RefCount--;
       deleteFlag = (oldSamp->RefCount == 0);
-      mtx_unlock(&oldSamp->Mutex);
+      simple_mtx_unlock(&oldSamp->Mutex);
 
       if (deleteFlag)
          delete_sampler_object(ctx, oldSamp);
@@ -98,12 +98,12 @@ _mesa_reference_sampler_object_(struct gl_context *ctx,
 
    if (samp) {
       /* reference new sampler */
-      mtx_lock(&samp->Mutex);
+      simple_mtx_lock(&samp->Mutex);
       assert(samp->RefCount > 0);
 
       samp->RefCount++;
       *ptr = samp;
-      mtx_unlock(&samp->Mutex);
+      simple_mtx_unlock(&samp->Mutex);
    }
 }
 
@@ -114,7 +114,7 @@ _mesa_reference_sampler_object_(struct gl_context *ctx,
 static void
 _mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name)
 {
-   mtx_init(&sampObj->Mutex, mtx_plain);
+   simple_mtx_init(&sampObj->Mutex, mtx_plain);
    sampObj->Name = name;
    sampObj->RefCount = 1;
    sampObj->WrapS = GL_REPEAT;
@@ -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,28 @@ _mesa_DeleteSamplers(GLsizei count, const GLuint *samplers)
 }
 
 
+void GLAPIENTRY
+_mesa_DeleteSamplers_no_error(GLsizei count, const GLuint *samplers)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   delete_samplers(ctx, count, 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)
 {
@@ -318,6 +332,13 @@ bind_sampler(struct gl_context *ctx, GLuint unit, GLuint sampler, bool no_error)
    _mesa_bind_sampler(ctx, unit, sampObj);
 }
 
+void GLAPIENTRY
+_mesa_BindSampler_no_error(GLuint unit, GLuint sampler)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   bind_sampler(ctx, unit, sampler, true);
+}
+
 void GLAPIENTRY
 _mesa_BindSampler(GLuint unit, GLuint sampler)
 {