Mesa (main): mesa/st: drop release all sampler views wrapper

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jan 21 01:47:16 UTC 2022


Module: Mesa
Branch: main
Commit: 0f8a3a71754ef072ff2dae22186d40a1466c8cea
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0f8a3a71754ef072ff2dae22186d40a1466c8cea

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Dec 21 15:33:24 2021 +1000

mesa/st: drop release all sampler views wrapper

Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>

---

 src/mesa/main/texobj.c                 |  3 ++-
 src/mesa/state_tracker/st_cb_texture.c | 15 ---------------
 src/mesa/state_tracker/st_cb_texture.h |  2 --
 3 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 84c71c698b6..266384ad18e 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -49,6 +49,7 @@
 #include "api_exec_decl.h"
 
 #include "state_tracker/st_cb_texture.h"
+#include "state_tracker/st_context.h"
 #include "state_tracker/st_format.h"
 #include "state_tracker/st_cb_flush.h"
 #include "state_tracker/st_texture.h"
@@ -1485,7 +1486,7 @@ delete_textures(struct gl_context *ctx, GLsizei n, const GLuint *textures)
              */
             _mesa_HashRemove(ctx->Shared->TexObjects, delObj->Name);
 
-            st_TextureReleaseAllSamplerViews(ctx, delObj);
+            st_texture_release_all_sampler_views(st_context(ctx), delObj);
 
             /* Unreference the texobj.  If refcount hits zero, the texture
              * will be deleted.
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 0c1454cb276..ce89831f530 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -386,21 +386,6 @@ st_pbo_get_dst_format(struct gl_context *ctx, enum pipe_texture_target target,
    return dst_format;
 }
 
-/**
- * Called via ctx->Driver.TextureRemovedFromShared()
- * When texture is removed from ctx->Shared->TexObjects we lose
- * the ability to clean up views on context destruction, which may
- * lead to dangling pointers to destroyed contexts.
- * Release the views to prevent this.
- */
-void
-st_TextureReleaseAllSamplerViews(struct gl_context *ctx,
-                                 struct gl_texture_object *texObj)
-{
-   struct st_context *st = st_context(ctx);
-   st_texture_release_all_sampler_views(st, texObj);
-}
-
 void
 st_FreeTextureImageBuffer(struct gl_context *ctx,
                           struct gl_texture_image *texImage)
diff --git a/src/mesa/state_tracker/st_cb_texture.h b/src/mesa/state_tracker/st_cb_texture.h
index 8691e6f01a4..2d874bb732c 100644
--- a/src/mesa/state_tracker/st_cb_texture.h
+++ b/src/mesa/state_tracker/st_cb_texture.h
@@ -55,8 +55,6 @@ st_finalize_texture(struct gl_context *ctx,
 		    struct gl_texture_object *tObj,
 		    GLuint cubeMapFace);
 
-void st_TextureReleaseAllSamplerViews(struct gl_context *ctx,
-                                      struct gl_texture_object *texObj);
 void st_FreeTextureImageBuffer(struct gl_context *ctx,
                                struct gl_texture_image *texImage);
 void st_MapTextureImage(struct gl_context *ctx,



More information about the mesa-commit mailing list