[Mesa-dev] [PATCH] glsl: assert base_alignment > 0 for records
Ilia Mirkin
imirkin at alum.mit.edu
Tue Sep 29 08:20:08 PDT 2015
On Tue, Sep 29, 2015 at 5:02 AM, Samuel Iglesias Gonsalvez
<siglesias at igalia.com> wrote:
> 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 at igalia.com>
> Cc: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
> src/glsl/glsl_types.cpp | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
> index 0ead0f2..8586b2e 100644
> --- a/src/glsl/glsl_types.cpp
> +++ b/src/glsl/glsl_types.cpp
> @@ -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);
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
> return base_alignment;
> }
> assert(!"not reached");
> --
> 2.1.4
>
More information about the mesa-dev
mailing list