glsl: assert base_alignment > 0 for records
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Mon, 28 Sep 2015 09:47:33 +0000 (11:47 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Wed, 30 Sep 2015 06:13:07 +0000 (08:13 +0200)
From GLSL 1.50 spec, section 4.1.8 "Structures":

"Structures must have at least one member declaration."

So the base_alignment should be higher than zero.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/glsl/glsl_types.cpp

index 0ead0f2a32716d7b341519aaccd50c36ee054b1e..8586b2e01f3224d715960c6df74daddc11868307 100644 (file)
@@ -1511,6 +1511,7 @@ glsl_type::std430_base_alignment(bool row_major) const
          base_alignment = MAX2(base_alignment,
                                field_type->std430_base_alignment(field_row_major));
       }
+      assert(base_alignment > 0);
       return base_alignment;
    }
    assert(!"not reached");