[Mesa-dev] Returning 0 from std430_base_alignment

Ilia Mirkin imirkin at alum.mit.edu
Sat Sep 26 10:42:33 PDT 2015


Hi Samuel,

Coverity is up in a tizzy because std430_base_alignment can return 0
(which in turn would cause tons of errors since it's used with
glsl_align). Is there a better starting value that can be used for its
is_record() case? For std140 it's 16... I assume for std430 it's 4 or
something? That would allow Coverity to conclude that 0 will never be
returned from the function... as-is an empty struct would get an
alignment of 0 and create lots of div-by-zero. Not sure if that's a
legit scenario though.

Alternatively, an assert(base_alignment > 0) will most likely appease it.

  -ilia


More information about the mesa-dev mailing list