[Mesa-dev] [PATCH 2/2] st/mesa: fix assertion failures with GL_UNSIGNED_INT64_ARB (v2)

Marek Olšák maraeo at gmail.com
Tue May 29 01:10:42 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

Bindless texture handles can be passed via vertex attribs using this type.
They use the double codepath, so don't use st_pipe_vertex_format.

Cc: 18.0 18.1 <mesa-stable at lists.freedesktop.org>
---
 src/mesa/state_tracker/st_atom_array.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_atom_array.c b/src/mesa/state_tracker/st_atom_array.c
index 9a0935e21a5..e4fc19eb5e2 100644
--- a/src/mesa/state_tracker/st_atom_array.c
+++ b/src/mesa/state_tracker/st_atom_array.c
@@ -317,21 +317,20 @@ static void init_velement(struct pipe_vertex_element *velement,
    velement->vertex_buffer_index = vbo_index;
    assert(velement->src_format);
 }
 
 static void init_velement_lowered(const struct st_vertex_program *vp,
                                   struct pipe_vertex_element *velements,
                                   const struct gl_array_attributes *attrib,
                                   int src_offset, int instance_divisor,
                                   int vbo_index, int idx)
 {
-   const unsigned format = st_pipe_vertex_format(attrib);
    const GLubyte nr_components = attrib->Size;
 
    if (attrib->Doubles) {
       int lower_format;
 
       if (nr_components < 2)
          lower_format = PIPE_FORMAT_R32G32_UINT;
       else
          lower_format = PIPE_FORMAT_R32G32B32A32_UINT;
 
@@ -351,20 +350,22 @@ static void init_velement_lowered(const struct st_vertex_program *vp,
                         lower_format, instance_divisor, vbo_index);
          } else {
             /* The values here are undefined. Fill in some conservative
              * dummy values.
              */
             init_velement(&velements[idx], src_offset, PIPE_FORMAT_R32G32_UINT,
                           instance_divisor, vbo_index);
          }
       }
    } else {
+      const unsigned format = st_pipe_vertex_format(attrib);
+
       init_velement(&velements[idx], src_offset,
                     format, instance_divisor, vbo_index);
    }
 }
 
 static void
 set_vertex_attribs(struct st_context *st,
                    struct pipe_vertex_buffer *vbuffers,
                    unsigned num_vbuffers,
                    struct pipe_vertex_element *velements,
-- 
2.17.0



More information about the mesa-dev mailing list