zink: add some asserts for building access chains in ntv
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 26 Jun 2020 19:14:20 +0000 (15:14 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 22 Jul 2020 14:01:29 +0000 (14:01 +0000)
we're never going to pass a 0 here, and it's going to be an error if we do

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5911>

src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c

index 8bcad066601fbf1d16528b4e7300f250aef8262b..530036d3d7081a6b35585f0f8188e54fc504d78c 100644 (file)
@@ -351,6 +351,8 @@ spirv_builder_emit_access_chain(struct spirv_builder *b, SpvId result_type,
                                 SpvId base, const SpvId indexes[],
                                 size_t num_indexes)
 {
+   assert(base);
+   assert(result_type);
    SpvId result = spirv_builder_new_id(b);
 
    int words = 4 + num_indexes;