mesa: remove Driver.DeleteSamplerObject
authorMarek Olšák <marek.olsak@amd.com>
Sun, 27 Sep 2015 19:28:22 +0000 (21:28 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 3 Oct 2015 20:06:09 +0000 (22:06 +0200)
Nothing overrides it.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/dd.h
src/mesa/main/samplerobj.c

index 0b04c8db23dcc3b07fd23468b2da20233ff0ad98..03cbff472b604b871a42966eeffdd0a94dfd439c 100644 (file)
@@ -875,8 +875,6 @@ struct dd_function_table {
     */
    struct gl_sampler_object * (*NewSamplerObject)(struct gl_context *ctx,
                                                   GLuint name);
-   void (*DeleteSamplerObject)(struct gl_context *ctx,
-                               struct gl_sampler_object *samp);
 
    /**
     * \name Return a timestamp in nanoseconds as defined by GL_ARB_timer_query.
index c7b96664c21e7c12b94745d24109bb3f3f0fbeac..9bcba60fd6fd7a2da13c1ace1a40287bca9890bf 100644 (file)
@@ -72,6 +72,14 @@ lookup_samplerobj_locked(struct gl_context *ctx, GLuint name)
          _mesa_HashLookupLocked(ctx->Shared->SamplerObjects, name);
 }
 
+static void
+delete_sampler_object(struct gl_context *ctx,
+                      struct gl_sampler_object *sampObj)
+{
+   mtx_destroy(&sampObj->Mutex);
+   free(sampObj->Label);
+   free(sampObj);
+}
 
 /**
  * Handle reference counting.
@@ -94,10 +102,8 @@ _mesa_reference_sampler_object_(struct gl_context *ctx,
       deleteFlag = (oldSamp->RefCount == 0);
       mtx_unlock(&oldSamp->Mutex);
 
-      if (deleteFlag) {
-        assert(ctx->Driver.DeleteSamplerObject);
-         ctx->Driver.DeleteSamplerObject(ctx, oldSamp);
-      }
+      if (deleteFlag)
+         delete_sampler_object(ctx, oldSamp);
 
       *ptr = NULL;
    }
@@ -162,19 +168,6 @@ _mesa_new_sampler_object(struct gl_context *ctx, GLuint name)
    return sampObj;
 }
 
-
-/**
- * Fallback for ctx->Driver.DeleteSamplerObject();
- */
-static void
-_mesa_delete_sampler_object(struct gl_context *ctx,
-                            struct gl_sampler_object *sampObj)
-{
-   mtx_destroy(&sampObj->Mutex);
-   free(sampObj->Label);
-   free(sampObj);
-}
-
 static void
 create_samplers(struct gl_context *ctx, GLsizei count, GLuint *samplers,
                 const char *caller)
@@ -1626,5 +1619,4 @@ void
 _mesa_init_sampler_object_functions(struct dd_function_table *driver)
 {
    driver->NewSamplerObject = _mesa_new_sampler_object;
-   driver->DeleteSamplerObject = _mesa_delete_sampler_object;
 }