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

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>

---

 src/mesa/main/varray.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 4bb289db567..af67d37d740 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -116,7 +116,8 @@ compile_check_uniqueness_of_gl_vertex_type(unsigned x)
 #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 | \
@@ -131,7 +132,7 @@ compile_check_uniqueness_of_gl_vertex_type(unsigned x)
                                    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 */
@@ -745,7 +746,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
@@ -776,6 +778,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;
@@ -1923,7 +1928,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,
@@ -2052,7 +2057,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