etnaviv: fix incorrectly failing vertex size assert
authorJonathan Marek <jonathan@marek.ca>
Mon, 9 Dec 2019 15:31:47 +0000 (10:31 -0500)
committerJonathan Marek <jonathan@marek.ca>
Sun, 5 Jan 2020 17:04:39 +0000 (17:04 +0000)
Changes the assert to match the comment above.

This assert was failing in some cases while running darkplaces.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_state.c

index cf44a7ea12469e02988a54c9c4eab00f722af94c..67f9512f74ec533f7b1aeb8930e492c3a627b45e 100644 (file)
@@ -574,7 +574,7 @@ etna_vertex_elements_state_create(struct pipe_context *pctx,
          start_offset = elements[idx].src_offset;
 
       /* maximum vertex size is 256 bytes */
-      assert(element_size != 0 && end_offset <= 256);
+      assert(element_size != 0 && (end_offset - start_offset) < 256);
 
       /* check whether next element is consecutive to this one */
       nonconsecutive = (idx == (num_elements - 1)) ||