diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-12-11 08:40:05 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2016-12-11 08:40:05 +0000 |
commit | 21ab4c9f31674b113c24177398ed39f29b7cd8e6 (patch) | |
tree | 8be392d7a792d9663c2586396be77bfd506f5164 /lib/mesa/src/gallium/auxiliary/tgsi/tgsi_dump.c | |
parent | a8f0a7916e26e550dd2a26e7188835c481978004 (diff) |
Import Mesa 13.0.2
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/tgsi/tgsi_dump.c')
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/tgsi/tgsi_dump.c | 102 |
1 files changed, 60 insertions, 42 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_dump.c b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_dump.c index 66d801d62..614bcb2ef 100644 --- a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_dump.c +++ b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_dump.c @@ -254,6 +254,20 @@ dump_imm_data(struct tgsi_iterate_context *iter, i++; break; } + case TGSI_IMM_INT64: { + union di d; + d.i = data[i].Uint | (uint64_t)data[i+1].Uint << 32; + UID( d.i ); + i++; + break; + } + case TGSI_IMM_UINT64: { + union di d; + d.ui = data[i].Uint | (uint64_t)data[i+1].Uint << 32; + UID( d.ui ); + i++; + break; + } case TGSI_IMM_FLOAT32: if (ctx->dump_float_as_hex) HFLT( data[i].Float ); @@ -295,17 +309,17 @@ iter_declaration( * two dimensional */ if (decl->Declaration.File == TGSI_FILE_INPUT && - (iter->processor.Processor == TGSI_PROCESSOR_GEOMETRY || + (iter->processor.Processor == PIPE_SHADER_GEOMETRY || (!patch && - (iter->processor.Processor == TGSI_PROCESSOR_TESS_CTRL || - iter->processor.Processor == TGSI_PROCESSOR_TESS_EVAL)))) { + (iter->processor.Processor == PIPE_SHADER_TESS_CTRL || + iter->processor.Processor == PIPE_SHADER_TESS_EVAL)))) { TXT("[]"); } /* all non-patch tess ctrl shader outputs are two dimensional */ if (decl->Declaration.File == TGSI_FILE_OUTPUT && !patch && - iter->processor.Processor == TGSI_PROCESSOR_TESS_CTRL) { + iter->processor.Processor == PIPE_SHADER_TESS_CTRL) { TXT("[]"); } @@ -365,8 +379,13 @@ iter_declaration( } if (decl->Declaration.File == TGSI_FILE_MEMORY) { - if (decl->Declaration.Shared) - TXT(", SHARED"); + switch (decl->Declaration.MemType) { + /* Note: ,GLOBAL is optional / the default */ + case TGSI_MEMORY_TYPE_GLOBAL: TXT(", GLOBAL"); break; + case TGSI_MEMORY_TYPE_SHARED: TXT(", SHARED"); break; + case TGSI_MEMORY_TYPE_PRIVATE: TXT(", PRIVATE"); break; + case TGSI_MEMORY_TYPE_INPUT: TXT(", INPUT"); break; + } } if (decl->Declaration.File == TGSI_FILE_SAMPLER_VIEW) { @@ -389,7 +408,7 @@ iter_declaration( } if (decl->Declaration.Interpolate) { - if (iter->processor.Processor == TGSI_PROCESSOR_FRAGMENT && + if (iter->processor.Processor == PIPE_SHADER_FRAGMENT && decl->Declaration.File == TGSI_FILE_INPUT) { TXT( ", " ); @@ -465,6 +484,9 @@ iter_property( case TGSI_PROPERTY_FS_COORD_PIXEL_CENTER: ENM(prop->u[i].Data, tgsi_fs_coord_pixel_center_names); break; + case TGSI_PROPERTY_NEXT_SHADER: + ENM(prop->u[i].Data, tgsi_processor_type_names); + break; default: SID( prop->u[i].Data ); break; @@ -640,6 +662,14 @@ iter_instruction( TXT(", "); ENM(bit, tgsi_memory_names); } + if (inst->Memory.Texture) { + TXT( ", " ); + ENM( inst->Memory.Texture, tgsi_texture_names ); + } + if (inst->Memory.Format) { + TXT( ", " ); + TXT( util_format_name(inst->Memory.Format) ); + } } switch (inst->Instruction.Opcode) { @@ -696,31 +726,32 @@ prolog( return TRUE; } +static void +init_dump_ctx(struct dump_ctx *ctx, uint flags) +{ + memset(ctx, 0, sizeof(*ctx)); + + ctx->iter.prolog = prolog; + ctx->iter.iterate_instruction = iter_instruction; + ctx->iter.iterate_declaration = iter_declaration; + ctx->iter.iterate_immediate = iter_immediate; + ctx->iter.iterate_property = iter_property; + + if (flags & TGSI_DUMP_FLOAT_AS_HEX) + ctx->dump_float_as_hex = TRUE; +} + void tgsi_dump_to_file(const struct tgsi_token *tokens, uint flags, FILE *file) { struct dump_ctx ctx; memset(&ctx, 0, sizeof(ctx)); - ctx.iter.prolog = prolog; - ctx.iter.iterate_instruction = iter_instruction; - ctx.iter.iterate_declaration = iter_declaration; - ctx.iter.iterate_immediate = iter_immediate; - ctx.iter.iterate_property = iter_property; - ctx.iter.epilog = NULL; + init_dump_ctx(&ctx, flags); - ctx.instno = 0; - ctx.immno = 0; - ctx.indent = 0; ctx.dump_printf = dump_ctx_printf; - ctx.indentation = 0; ctx.file = file; - if (flags & TGSI_DUMP_FLOAT_AS_HEX) - ctx.dump_float_as_hex = TRUE; - else - ctx.dump_float_as_hex = FALSE; - tgsi_iterate_shader( tokens, &ctx.iter ); } @@ -744,7 +775,7 @@ str_dump_ctx_printf(struct dump_ctx *ctx, const char *format, ...) { struct str_dump_ctx *sctx = (struct str_dump_ctx *)ctx; - if(sctx->left > 1) { + if (!sctx->nospace) { int written; va_list ap; va_start(ap, format); @@ -755,12 +786,14 @@ str_dump_ctx_printf(struct dump_ctx *ctx, const char *format, ...) * vsnprintf: */ if (written > 0) { - written = MIN2(sctx->left, written); + if (written >= sctx->left) { + sctx->nospace = true; + written = sctx->left; + } sctx->ptr += written; sctx->left -= written; } - } else - sctx->nospace = true; + } } bool @@ -773,19 +806,9 @@ tgsi_dump_str( struct str_dump_ctx ctx; memset(&ctx, 0, sizeof(ctx)); - ctx.base.iter.prolog = prolog; - ctx.base.iter.iterate_instruction = iter_instruction; - ctx.base.iter.iterate_declaration = iter_declaration; - ctx.base.iter.iterate_immediate = iter_immediate; - ctx.base.iter.iterate_property = iter_property; - ctx.base.iter.epilog = NULL; + init_dump_ctx(&ctx.base, flags); - ctx.base.instno = 0; - ctx.base.immno = 0; - ctx.base.indent = 0; ctx.base.dump_printf = &str_dump_ctx_printf; - ctx.base.indentation = 0; - ctx.base.file = NULL; ctx.str = str; ctx.str[0] = 0; @@ -793,11 +816,6 @@ tgsi_dump_str( ctx.left = (int)size; ctx.nospace = false; - if (flags & TGSI_DUMP_FLOAT_AS_HEX) - ctx.base.dump_float_as_hex = TRUE; - else - ctx.base.dump_float_as_hex = FALSE; - tgsi_iterate_shader( tokens, &ctx.base.iter ); return !ctx.nospace; |