intel/aubinator: Gracefully handle dynamic state not being available
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 27 Dec 2017 16:40:30 +0000 (08:40 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 28 Dec 2017 18:39:04 +0000 (10:39 -0800)
Some older versions of the Vulkan driver didn't properly tag dynamic
state as needing to be captured.  Also, this prevents crashes when
looking at dumps on older kernels.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/tools/gen_batch_decoder.c

index e8dd19b33e0a3d2cc8106857f72f0e527d09294b..f09b8331f8436544e9130c2ec1a698e026f0055e 100644 (file)
@@ -582,6 +582,11 @@ decode_dynamic_state_pointers(struct gen_batch_decode_ctx *ctx,
                               const char *struct_type, const uint32_t *p,
                               int count)
 {
+   if (ctx->dynamic_base.map == NULL) {
+      fprintf(ctx->fp, "  dynamic %s state unavailable\n", struct_type);
+      return;
+   }
+
    struct gen_group *inst = gen_spec_find_instruction(ctx->spec, p);
    struct gen_group *state = gen_spec_find_struct(ctx->spec, struct_type);