Mesa (main): mesa: remove USAGE_ELEMENT_ARRAY_BUFFER because it's unused and adding overhead

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Oct 25 20:19:54 UTC 2021


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Tue Oct 19 23:30:07 2021 -0400

mesa: remove USAGE_ELEMENT_ARRAY_BUFFER because it's unused and adding overhead

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13513>

---

 src/mesa/main/arrayobj.c                     | 2 --
 src/mesa/main/bufferobj.c                    | 3 ---
 src/mesa/main/mtypes.h                       | 1 -
 src/mesa/state_tracker/st_cb_bufferobjects.c | 2 --
 4 files changed, 8 deletions(-)

diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 1537178a1e4..01a7c9b99fc 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -1260,8 +1260,6 @@ vertex_array_element_buffer(struct gl_context *ctx, GLuint vaobj, GLuint buffer,
 
       if (!bufObj)
          return;
-
-      bufObj->UsageHistory |= USAGE_ELEMENT_ARRAY_BUFFER;
    } else {
       bufObj = NULL;
    }
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 486aac31a8a..7dcf38a3075 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -131,9 +131,6 @@ get_buffer_target(struct gl_context *ctx, GLenum target)
          ctx->Array.ArrayBufferObj->UsageHistory |= USAGE_ARRAY_BUFFER;
       return &ctx->Array.ArrayBufferObj;
    case GL_ELEMENT_ARRAY_BUFFER_ARB:
-      if (ctx->Array.VAO->IndexBufferObj)
-         ctx->Array.VAO->IndexBufferObj->UsageHistory
-            |= USAGE_ELEMENT_ARRAY_BUFFER;
       return &ctx->Array.VAO->IndexBufferObj;
    case GL_PIXEL_PACK_BUFFER_EXT:
       return &ctx->Pack.BufferObj;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index ca349f4bb47..c54e1664540 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1354,7 +1354,6 @@ typedef enum
    USAGE_TRANSFORM_FEEDBACK_BUFFER = 0x10,
    USAGE_PIXEL_PACK_BUFFER = 0x20,
    USAGE_ARRAY_BUFFER = 0x40,
-   USAGE_ELEMENT_ARRAY_BUFFER = 0x80,
    USAGE_DISABLE_MINMAX_CACHE = 0x100,
 } gl_buffer_usage;
 
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 782c0250b79..1e5882e6973 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -408,8 +408,6 @@ bufferobj_data(struct gl_context *ctx,
     */
    if (st_obj->Base.UsageHistory & USAGE_ARRAY_BUFFER)
       ctx->NewDriverState |= ST_NEW_VERTEX_ARRAYS;
-   /* if (st_obj->Base.UsageHistory & USAGE_ELEMENT_ARRAY_BUFFER) */
-   /*    ctx->NewDriverState |= TODO: Handle indices as gallium state; */
    if (st_obj->Base.UsageHistory & USAGE_UNIFORM_BUFFER)
       ctx->NewDriverState |= ST_NEW_UNIFORM_BUFFER;
    if (st_obj->Base.UsageHistory & USAGE_SHADER_STORAGE_BUFFER)



More information about the mesa-commit mailing list