bool r600_can_dump_shader(struct r600_common_screen *rscreen,
const struct tgsi_token *tokens)
{
+ /* Compute shader don't have tgsi_tokens */
+ if (!tokens)
+ return (rscreen->debug_flags & DBG_CS) != 0;
+
switch (tgsi_get_processor_type(tokens)) {
case TGSI_PROCESSOR_VERTEX:
return (rscreen->debug_flags & DBG_VS) != 0;
unsigned i;
uint32_t *ptr;
struct radeon_llvm_binary binary;
- bool dump = r600_can_dump_shader(&rctx->screen->b, shader->selector->tokens);
-
+ bool dump = r600_can_dump_shader(&rctx->screen->b,
+ shader->selector ? shader->selector->tokens : NULL);
memset(&binary, 0, sizeof(binary));
radeon_llvm_compile(mod, &binary,
r600_get_llvm_processor_name(rctx->screen->b.family), dump);