lima: decode depth/stencil write bits in RSW
authorVasily Khoruzhick <anarsoul@gmail.com>
Sun, 15 Mar 2020 19:09:30 +0000 (12:09 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 18 Mar 2020 08:36:17 +0000 (08:36 +0000)
Now that we know the bits that are responsible for enabling depth/stencil
writes in shader we can decode them properly.

Reviewed-by: Andreas Baierl <ichgeh@imkreisrum.de>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4197>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4197>

src/gallium/drivers/lima/lima_parser.c

index 6dd8513f92911ae3044c2b6004e3493b6d559253..6770be8f9196ff8c05b0756aefc3e5b79a2dac03 100644 (file)
@@ -478,11 +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, ": blend_func %d (%s)", ((*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",