X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Flima%2Flima_parser.c;h=6770be8f9196ff8c05b0756aefc3e5b79a2dac03;hb=59fa26902d56e068de1769a62d8329e6777bba92;hp=ae1764723eb3c810fa1bf77c74bb72d7d0aca95f;hpb=5802259e5438571c799bac2137da8bca505c6a94;p=mesa.git diff --git a/src/gallium/drivers/lima/lima_parser.c b/src/gallium/drivers/lima/lima_parser.c index ae1764723eb..6770be8f919 100644 --- a/src/gallium/drivers/lima/lima_parser.c +++ b/src/gallium/drivers/lima/lima_parser.c @@ -450,19 +450,25 @@ parse_rsw(FILE *fp, uint32_t *value, int i, uint32_t *helper) (float)(ubyte_to_float(*value & 0x0000ffff))); break; case 2: /* ALPHA BLEND */ - fprintf(fp, "(1): colormask 0x%02x, rgb_func %d, alpha_func %d */\n", + fprintf(fp, "(1): colormask 0x%02x, rgb_func %d (%s), alpha_func %d (%s) */\n", (*value & 0xf0000000) >> 28, /* colormask */ - (*value & 0x00000007), /* rgb_func */ - (*value & 0x00000038) >> 3); /* alpha_func */ + (*value & 0x00000007), + lima_get_blend_func_string((*value & 0x00000007)), /* rgb_func */ + (*value & 0x00000038) >> 3, + lima_get_blend_func_string((*value & 0x00000038) >> 3)); /* alpha_func */ /* add a few tabs for alignment */ fprintf(fp, "\t\t\t\t\t\t/* %s(2)", render_state_infos[i].info); - fprintf(fp, ": rgb_src_factor %d, rbg_dst_factor %d */\n", - (*value & 0x000007c0) >> 6, /* rgb_src_factor */ - (*value & 0x0000f800) >> 11); /* rgb_dst_factor */ + fprintf(fp, ": rgb_src_factor %d (%s), rbg_dst_factor %d (%s) */\n", + (*value & 0x000007c0) >> 6, + lima_get_blendfactor_string((*value & 0x000007c0) >> 6), /* rgb_src_factor */ + (*value & 0x0000f800) >> 11, + lima_get_blendfactor_string((*value & 0x0000f800) >> 11)); /* rgb_dst_factor */ fprintf(fp, "\t\t\t\t\t\t/* %s(3)", render_state_infos[i].info); - fprintf(fp, ": alpha_src_factor %d, alpha_dst_factor %d, bits 24-27 0x%02x */\n", - (*value & 0x000f0000) >> 16, /* alpha_src_factor */ - (*value & 0x00f00000) >> 20, /* alpha_dst_factor */ + fprintf(fp, ": alpha_src_factor %d (%s), alpha_dst_factor %d (%s), bits 24-27 0x%02x */\n", + (*value & 0x000f0000) >> 16, + lima_get_blendfactor_string((*value & 0x000f0000) >> 16), /* alpha_src_factor */ + (*value & 0x00f00000) >> 20, + lima_get_blendfactor_string((*value & 0x00f00000) >> 20), /* alpha_dst_factor */ (*value & 0x0f000000) >> 24); /* bits 24-27 */ break; case 3: /* DEPTH TEST */ @@ -472,10 +478,19 @@ parse_rsw(FILE *fp, uint32_t *value, int i, uint32_t *helper) fprintf(fp, "(1): depth test disabled || writes not allowed"); fprintf(fp, "\n\t\t\t\t\t\t/* %s(2)", render_state_infos[i].info); - fprintf(fp, ": PIPE_FUNC_%d", (*value & 0x0000000e) >> 1); + fprintf(fp, ": depth_func %d (%s)", ((*value & 0x0000000e) >> 1), + lima_get_compare_func_string((*value & 0x0000000e) >> 1)); fprintf(fp, ", offset_scale: %d", (*value & 0x00ff0000) >> 16); fprintf(fp, ", offset_units: %d", (*value & 0xff000000) >> 24); - fprintf(fp, ", unknown bits 4-15: 0x%08x */\n", *value & 0x0000fff0); + if (*value & 0x400) + fprintf(fp, ", shader writes depth or stencil"); + if (*value & 0x800) + fprintf(fp, ", shader writes depth"); + if (*value & 0x1000) + fprintf(fp, ", shader writes stencil"); + fprintf(fp, " */\n\t\t\t\t\t\t/* %s(3)", render_state_infos[i].info); + fprintf(fp, ": unknown bits 4-9: 0x%08x", *value & 0x000003f0); + fprintf(fp, ", unknown bits 13-15: 0x%08x */\n", *value & 0x00000e000); break; case 4: /* DEPTH RANGE */ fprintf(fp, ": viewport.far = %f, viewport.near = %f */\n", @@ -483,29 +498,37 @@ parse_rsw(FILE *fp, uint32_t *value, int i, uint32_t *helper) (float)(ushort_to_float(*value & 0x0000ffff))); break; case 5: /* STENCIL FRONT */ - fprintf(fp, "(1): valuemask 0x%02x, ref value %d (0x%02x), stencil_func %d */\n", + fprintf(fp, "(1): valuemask 0x%02x, ref value %d (0x%02x), stencil_func %d (%s)*/\n", (*value & 0xff000000) >> 24, /* valuemask */ (*value & 0x00ff0000) >> 16, (*value & 0x00ff0000) >> 16, /* ref value */ - (*value & 0x00000007)); /* stencil_func */ + (*value & 0x00000007), + lima_get_compare_func_string((*value & 0x00000007))); /* stencil_func */ /* add a few tabs for alignment */ fprintf(fp, "\t\t\t\t\t\t/* %s(2)", render_state_infos[i].info); - fprintf(fp, ": fail_op %d, zfail_op %d, zpass_op %d, unknown (12-15) 0x%02x */\n", - (*value & 0x00000038) >> 3, /* fail_op */ - (*value & 0x000001c0) >> 6, /* zfail_op */ - (*value & 0x00000e00) >> 9, /* zpass_op */ + fprintf(fp, ": fail_op %d (%s), zfail_op %d (%s), zpass_op %d (%s), unknown (12-15) 0x%02x */\n", + (*value & 0x00000038) >> 3, + lima_get_stencil_op_string((*value & 0x00000038) >> 3), /* fail_op */ + (*value & 0x000001c0) >> 6, + lima_get_stencil_op_string((*value & 0x000001c0) >> 6), /* zfail_op */ + (*value & 0x00000e00) >> 9, + lima_get_stencil_op_string((*value & 0x00000e00) >> 9), /* zpass_op */ (*value & 0x0000f000) >> 12); /* unknown */ break; case 6: /* STENCIL BACK */ - fprintf(fp, "(1): valuemask 0x%02x, ref value %d (0x%02x), stencil_func %d */\n", + fprintf(fp, "(1): valuemask 0x%02x, ref value %d (0x%02x), stencil_func %d (%s)*/\n", (*value & 0xff000000) >> 24, /* valuemask */ (*value & 0x00ff0000) >> 16, (*value & 0x00ff0000) >> 16, /* ref value */ - (*value & 0x00000007)); /* stencil_func */ + (*value & 0x00000007), + lima_get_compare_func_string((*value & 0x00000007))); /* stencil_func */ /* add a few tabs for alignment */ fprintf(fp, "\t\t\t\t\t\t/* %s(2)", render_state_infos[i].info); - fprintf(fp, ": fail_op %d, zfail_op %d, zpass_op %d, unknown (12-15) 0x%02x */\n", - (*value & 0x00000038) >> 3, /* fail_op */ - (*value & 0x000001c0) >> 6, /* zfail_op */ - (*value & 0x00000e00) >> 9, /* zpass_op */ + fprintf(fp, ": fail_op %d (%s), zfail_op %d (%s), zpass_op %d (%s), unknown (12-15) 0x%02x */\n", + (*value & 0x00000038) >> 3, + lima_get_stencil_op_string((*value & 0x00000038) >> 3), /* fail_op */ + (*value & 0x000001c0) >> 6, + lima_get_stencil_op_string((*value & 0x000001c0) >> 6), /* zfail_op */ + (*value & 0x00000e00) >> 9, + lima_get_stencil_op_string((*value & 0x00000e00) >> 9), /* zpass_op */ (*value & 0x0000f000) >> 12); /* unknown */ break; case 7: /* STENCIL TEST */ @@ -535,7 +558,7 @@ parse_rsw(FILE *fp, uint32_t *value, int i, uint32_t *helper) fprintf(fp, ", UNKNOWN\n"); break; case 9: /* SHADER ADDRESS */ - fprintf(fp, ": fs shader @ 0x%08x, ((uint32_t *)ctx->fs->bo->map)[0] & 0x1f: 0x%08x */\n", + fprintf(fp, ": fs shader @ 0x%08x, first instr length %d */\n", *value & 0xffffffe0, *value & 0x0000001f); break; case 10: /* VARYING TYPES */