This is used to detect error in virgl if we overflow the shader
dumping buffers.
v2: return a bool.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
char *str;
char *ptr;
int left;
+ bool nospace;
};
static void
sctx->ptr += written;
sctx->left -= written;
}
- }
+ } else
+ sctx->nospace = true;
}
-void
+bool
tgsi_dump_str(
const struct tgsi_token *tokens,
uint flags,
ctx.str[0] = 0;
ctx.ptr = str;
ctx.left = (int)size;
+ ctx.nospace = false;
if (flags & TGSI_DUMP_FLOAT_AS_HEX)
ctx.base.dump_float_as_hex = TRUE;
ctx.base.dump_float_as_hex = FALSE;
tgsi_iterate_shader( tokens, &ctx.base.iter );
+
+ return !ctx.nospace;
}
void
ctx.str[0] = 0;
ctx.ptr = str;
ctx.left = (int)size;
+ ctx.nospace = false;
iter_instruction( &ctx.base.iter, (struct tgsi_full_instruction *)inst );
}
#define TGSI_DUMP_FLOAT_AS_HEX (1 << 0)
-void
+bool
tgsi_dump_str(
const struct tgsi_token *tokens,
uint flags,