Module: Mesa
Branch: staging/22.3
Commit: c666f6ab13bc1b2d86df18a55db13cab0037e341
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c666f6ab13bc1b2d86df18a55db13cab0037e341

Author: Marek Olšák <[email protected]>
Date:   Wed Dec 21 05:45:51 2022 -0500

mesa: allow GL_UNSIGNED_INT64_ARB as vertex format for ARB_bindless_texture

This wasn't implemented, but the spec requires it.

Fixes: 1fe7b1f9724 - mesa: implement ARB_bindless_texture

Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
(cherry picked from commit 721526227cd8311b7bb6dd2f8718fcfbd3b24038)

---

 .pick_status.json      |  2 +-
 src/mesa/main/varray.c | 15 ++++++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index e4eedacfa05..0c66734f0d3 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -139,7 +139,7 @@
         "description": "mesa: allow GL_UNSIGNED_INT64_ARB as vertex format for 
ARB_bindless_texture",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "1fe7b1f9724ac38cbddcac6505d3750ef99a2eca"
     },
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index a4eaa8d66f3..f2356949714 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -67,7 +67,8 @@
 #define UNSIGNED_INT_2_10_10_10_REV_BIT   (1 << 12)
 #define INT_2_10_10_10_REV_BIT            (1 << 13)
 #define UNSIGNED_INT_10F_11F_11F_REV_BIT  (1 << 14)
-#define ALL_TYPE_BITS                    ((1 << 15) - 1)
+#define UNSIGNED_INT64_BIT                (1 << 15)
+#define ALL_TYPE_BITS                    ((1 << 16) - 1)
 
 #define ATTRIB_FORMAT_TYPES_MASK (BYTE_BIT | UNSIGNED_BYTE_BIT | \
                                   SHORT_BIT | UNSIGNED_SHORT_BIT | \
@@ -82,7 +83,7 @@
                                    SHORT_BIT | UNSIGNED_SHORT_BIT | \
                                    INT_BIT | UNSIGNED_INT_BIT)
 
-#define ATTRIB_LFORMAT_TYPES_MASK DOUBLE_BIT
+#define ATTRIB_LFORMAT_TYPES_MASK (DOUBLE_BIT | UNSIGNED_INT64_BIT)
 
 
 /** Convert GL datatype enum into a <type>_BIT value seen above */
@@ -577,7 +578,8 @@ get_legal_types_mask(const struct gl_context *ctx)
    if (_mesa_is_gles(ctx)) {
       legalTypesMask &= ~(FIXED_GL_BIT |
                           DOUBLE_BIT |
-                          UNSIGNED_INT_10F_11F_11F_REV_BIT);
+                          UNSIGNED_INT_10F_11F_11F_REV_BIT |
+                          UNSIGNED_INT64_BIT);
 
       /* GL_INT and GL_UNSIGNED_INT data is not allowed in OpenGL ES until
        * 3.0.  The 2_10_10_10 types are added in OpenGL ES 3.0 or
@@ -608,6 +610,9 @@ get_legal_types_mask(const struct gl_context *ctx)
 
       if (!ctx->Extensions.ARB_vertex_type_10f_11f_11f_rev)
          legalTypesMask &= ~UNSIGNED_INT_10F_11F_11F_REV_BIT;
+
+      if (!ctx->Extensions.ARB_bindless_texture)
+         legalTypesMask &= ~UNSIGNED_INT64_BIT;
    }
 
    return legalTypesMask;
@@ -1751,7 +1756,7 @@ _mesa_VertexArrayVertexAttribLOffsetEXT(GLuint vaobj, 
GLuint buffer, GLuint inde
       return;
    }
 
-   const GLbitfield legalTypes = DOUBLE_BIT;
+   const GLbitfield legalTypes = ATTRIB_LFORMAT_TYPES_MASK;
 
    if (!validate_array_and_format(ctx, "glVertexArrayVertexAttribLOffsetEXT",
                                   vao, vbo,
@@ -1880,7 +1885,7 @@ _mesa_VertexAttribLPointer(GLuint index, GLint size, 
GLenum type,
       return;
    }
 
-   const GLbitfield legalTypes = DOUBLE_BIT;
+   const GLbitfield legalTypes = ATTRIB_LFORMAT_TYPES_MASK;
 
    if (!validate_array_and_format(ctx, "glVertexAttribLPointer",
                                   ctx->Array.VAO, ctx->Array.ArrayBufferObj,

Reply via email to