glsl_type: initialize offset and location to -1 for glsl_struct_field
authorKarol Herbst <kherbst@redhat.com>
Sat, 9 Feb 2019 00:22:27 +0000 (01:22 +0100)
committerKarol Herbst <kherbst@redhat.com>
Sat, 9 Feb 2019 12:52:15 +0000 (13:52 +0100)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/glsl_types.h

index bf9be0f48fb5d050e74e8cf143e07632a5300f4b..934dc479998a883c1610d206f792f9d71f21ff5b 100644 (file)
@@ -1083,7 +1083,7 @@ struct glsl_struct_field {
    unsigned implicit_sized_array:1;
 #ifdef __cplusplus
    glsl_struct_field(const struct glsl_type *_type, const char *_name)
-      : type(_type), name(_name), location(-1), offset(0), xfb_buffer(0),
+      : type(_type), name(_name), location(-1), offset(-1), xfb_buffer(0),
         xfb_stride(0), interpolation(0), centroid(0),
         sample(0), matrix_layout(GLSL_MATRIX_LAYOUT_INHERITED), patch(0),
         precision(GLSL_PRECISION_NONE), memory_read_only(0),
@@ -1095,7 +1095,7 @@ struct glsl_struct_field {
    }
 
    glsl_struct_field()
-      : type(NULL), name(NULL), location(0), offset(0), xfb_buffer(0),
+      : type(NULL), name(NULL), location(-1), offset(-1), xfb_buffer(0),
         xfb_stride(0), interpolation(0), centroid(0),
         sample(0), matrix_layout(0), patch(0),
         precision(0), memory_read_only(0),