Re: [Mesa-dev] [PATCH 9/9] mesa: Add assert to _mesa_primitive_restart_index.

2019-03-14 Thread Mathias Fröhlich
Hi Brian,

On Thursday, 14 March 2019 14:55:11 CET Brian Paul wrote:
> yeah, looks good.  Thanks.
> 
> Reviewed-by: Brian Paul 
> 
> I don't remember- do you need me to push your patches for you?
Thanks for the review!

I have rights to push.
Thanks for asking!!

best

Mathias



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Re: [Mesa-dev] [PATCH 9/9] mesa: Add assert to _mesa_primitive_restart_index.

2019-03-14 Thread Brian Paul

On 03/14/2019 06:33 AM, mathias.froehl...@gmx.net wrote:

From: Mathias Fröhlich 

Hi Brian,

You mean an assert like this?


yeah, looks good.  Thanks.

Reviewed-by: Brian Paul 

I don't remember- do you need me to push your patches for you?

-Brian



This patch also made it together with the rest of the series through intels CI.

best

Mathias





Make sure the inde_size parameter is meant to be in bytes.

Signed-off-by: Mathias Fröhlich 
---
  src/mesa/main/varray.h | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index 0be57971bd7..2831720edfc 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -316,6 +316,9 @@ static inline unsigned
  _mesa_primitive_restart_index(const struct gl_context *ctx,
unsigned index_size)
  {
+   /* The index_size parameter is menat to be in bytes. */
+   assert(index_size == 1 || index_size == 2 || index_size == 4);
+
 /* From the OpenGL 4.3 core specification, page 302:
  * "If both PRIMITIVE_RESTART and PRIMITIVE_RESTART_FIXED_INDEX are
  *  enabled, the index value determined by PRIMITIVE_RESTART_FIXED_INDEX



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev