mesa: don't AND with VERT_BIT_ALL because it's ~0u
authorMarek Olšák <marek.olsak@amd.com>
Tue, 22 Nov 2022 09:34:04 +0000 (04:34 -0500)
committerMarge Bot <emma+marge@anholt.net>
Mon, 12 Dec 2022 19:15:34 +0000 (19:15 +0000)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>

src/mesa/main/arrayobj.h
src/mesa/main/varray.c
src/mesa/vbo/vbo_exec_draw.c
src/mesa/vbo/vbo_private.h
src/mesa/vbo/vbo_save_draw.c

index 58feea5..09d655f 100644 (file)
@@ -222,7 +222,7 @@ _mesa_get_derived_vao_masks(const struct gl_context *ctx,
 static inline GLbitfield
 _mesa_draw_current_bits(const struct gl_context *ctx)
 {
-   return ~ctx->Array._DrawVAOEnabledAttribs & VERT_BIT_ALL;
+   return ~ctx->Array._DrawVAOEnabledAttribs;
 }
 
 
index 29f2e6b..1b1eb93 100644 (file)
@@ -2060,7 +2060,6 @@ _mesa_enable_vertex_array_attribs(struct gl_context *ctx,
                                   struct gl_vertex_array_object *vao,
                                   GLbitfield attrib_bits)
 {
-   assert((attrib_bits & ~VERT_BIT_ALL) == 0);
    assert(!vao->SharedAndImmutable);
 
    /* Only work on bits that are disabled */
@@ -2165,7 +2164,6 @@ _mesa_disable_vertex_array_attribs(struct gl_context *ctx,
                                    struct gl_vertex_array_object *vao,
                                    GLbitfield attrib_bits)
 {
-   assert((attrib_bits & ~VERT_BIT_ALL) == 0);
    assert(!vao->SharedAndImmutable);
 
    /* Only work on bits that are enabled */
index 235b97b..1c39ef4 100644 (file)
@@ -112,7 +112,7 @@ vbo_exec_bind_arrays(struct gl_context *ctx,
    }
 
    /* At first disable arrays no longer needed */
-   _mesa_disable_vertex_array_attribs(ctx, vao, VERT_BIT_ALL & ~vao_enabled);
+   _mesa_disable_vertex_array_attribs(ctx, vao, ~vao_enabled);
    assert((~vao_enabled & vao->Enabled) == 0);
 
    /* Bind the buffer object */
index 9f7e70f..cd79c59 100644 (file)
@@ -235,7 +235,7 @@ _vbo_get_vao_enabled_from_vbo(gl_vertex_processing_mode vertex_processing_mode,
       return (((GLbitfield)enabled) & VERT_BIT_FF_ALL)
          | (((GLbitfield)(enabled >> VBO_MATERIAL_SHIFT)) & VERT_BIT_MAT_ALL);
    } else {
-      return ((GLbitfield)enabled) & VERT_BIT_ALL;
+      return enabled;
    }
 }
 
index 0148810..20da9c4 100644 (file)
@@ -108,7 +108,7 @@ playback_copy_to_current(struct gl_context *ctx,
    bool color0_changed = false;
 
    /* Copy conventional attribs and generics except pos */
-   copy_vao(ctx, node->cold->VAO[VP_MODE_SHADER], ~VERT_BIT_POS & VERT_BIT_ALL,
+   copy_vao(ctx, node->cold->VAO[VP_MODE_SHADER], ~VERT_BIT_POS,
             _NEW_CURRENT_ATTRIB, GL_CURRENT_BIT, 0, &data, &color0_changed);
    /* Copy materials */
    copy_vao(ctx, node->cold->VAO[VP_MODE_FF], VERT_BIT_MAT_ALL,