예제 #1
0
static void
writer_decode_scissor_rect(const struct ilo_builder *builder,
                           enum ilo_builder_writer_type which,
                           const struct ilo_builder_item *item)
{
   const unsigned state_size = sizeof(uint32_t) * 2;
   const unsigned count = item->size / state_size;
   unsigned offset = item->offset;
   unsigned i;

   for (i = 0; i < count; i++) {
      uint32_t dw;

      dw = writer_dw(builder, which, offset, 0, "SCISSOR%d", i);
      ilo_printf("xmin %d, ymin %d\n",
            GEN_EXTRACT(dw, GEN6_SCISSOR_DW0_MIN_X),
            GEN_EXTRACT(dw, GEN6_SCISSOR_DW0_MIN_Y));

      dw = writer_dw(builder, which, offset, 1, "SCISSOR%d", i);
      ilo_printf("xmax %d, ymax %d\n",
            GEN_EXTRACT(dw, GEN6_SCISSOR_DW1_MAX_X),
            GEN_EXTRACT(dw, GEN6_SCISSOR_DW1_MAX_Y));

      offset += state_size;
   }
}
예제 #2
0
static void
writer_decode_sampler(const struct ilo_builder *builder,
                      enum ilo_builder_writer_type which,
                      const struct ilo_builder_item *item)
{
   const unsigned state_size = sizeof(uint32_t) * 4;
   const unsigned count = item->size / state_size;
   unsigned offset = item->offset;
   unsigned i;

   for (i = 0; i < count; i++) {
      writer_dw(builder, which, offset, 0, "WM SAMP%d", i);
      ilo_printf("filtering\n");

      writer_dw(builder, which, offset, 1, "WM SAMP%d", i);
      ilo_printf("wrapping, lod\n");

      writer_dw(builder, which, offset, 2, "WM SAMP%d", i);
      ilo_printf("default color pointer\n");

      writer_dw(builder, which, offset, 3, "WM SAMP%d", i);
      ilo_printf("chroma key, aniso\n");

      offset += state_size;
   }
}
예제 #3
0
static void
writer_decode_clip_viewport(const struct ilo_builder *builder,
                            enum ilo_builder_writer_type which,
                            const struct ilo_builder_item *item)
{
   const unsigned state_size = sizeof(uint32_t) * 4;
   const unsigned count = item->size / state_size;
   unsigned offset = item->offset;
   unsigned i;

   for (i = 0; i < count; i++) {
      uint32_t dw;

      dw = writer_dw(builder, which, offset, 0, "CLIP VP%d", i);
      ilo_printf("xmin = %f\n", uif(dw));

      dw = writer_dw(builder, which, offset, 1, "CLIP VP%d", i);
      ilo_printf("xmax = %f\n", uif(dw));

      dw = writer_dw(builder, which, offset, 2, "CLIP VP%d", i);
      ilo_printf("ymin = %f\n", uif(dw));

      dw = writer_dw(builder, which, offset, 3, "CLIP VP%d", i);
      ilo_printf("ymax = %f\n", uif(dw));

      offset += state_size;
   }
}
예제 #4
0
static void
writer_decode_blend(const struct ilo_builder *builder,
                    enum ilo_builder_writer_type which,
                    const struct ilo_builder_item *item)
{
   const unsigned state_size = sizeof(uint32_t) * 2;
   const unsigned count = item->size / state_size;
   unsigned offset = item->offset;
   unsigned i;

   for (i = 0; i < count; i++) {
      writer_dw(builder, which, offset, 0, "BLEND%d\n", i);
      writer_dw(builder, which, offset, 1, "BLEND%d\n", i);

      offset += state_size;
   }
}
예제 #5
0
static void
writer_decode_sf_clip_viewport_gen7(const struct ilo_builder *builder,
                                    enum ilo_builder_writer_type which,
                                    const struct ilo_builder_item *item)
{
   const unsigned state_size = sizeof(uint32_t) * 16;
   const unsigned count = item->size / state_size;
   unsigned offset = item->offset;
   unsigned i;

   for (i = 0; i < count; i++) {
      uint32_t dw;

      dw = writer_dw(builder, which, offset, 0, "SF_CLIP VP%d", i);
      ilo_printf("m00 = %f\n", uif(dw));

      dw = writer_dw(builder, which, offset, 1, "SF_CLIP VP%d", i);
      ilo_printf("m11 = %f\n", uif(dw));

      dw = writer_dw(builder, which, offset, 2, "SF_CLIP VP%d", i);
      ilo_printf("m22 = %f\n", uif(dw));

      dw = writer_dw(builder, which, offset, 3, "SF_CLIP VP%d", i);
      ilo_printf("m30 = %f\n", uif(dw));

      dw = writer_dw(builder, which, offset, 4, "SF_CLIP VP%d", i);
      ilo_printf("m31 = %f\n", uif(dw));

      dw = writer_dw(builder, which, offset, 5, "SF_CLIP VP%d", i);
      ilo_printf("m32 = %f\n", uif(dw));

      dw = writer_dw(builder, which, offset, 8, "SF_CLIP VP%d", i);
      ilo_printf("guardband xmin = %f\n", uif(dw));

      dw = writer_dw(builder, which, offset, 9, "SF_CLIP VP%d", i);
      ilo_printf("guardband xmax = %f\n", uif(dw));

      dw = writer_dw(builder, which, offset, 10, "SF_CLIP VP%d", i);
      ilo_printf("guardband ymin = %f\n", uif(dw));

      dw = writer_dw(builder, which, offset, 11, "SF_CLIP VP%d", i);
      ilo_printf("guardband ymax = %f\n", uif(dw));

      offset += state_size;
   }
}
예제 #6
0
static void
writer_decode_surface_gen6(const struct ilo_builder *builder,
                           enum ilo_builder_writer_type which,
                           const struct ilo_builder_item *item)
{
   uint32_t dw;

   dw = writer_dw(builder, which, item->offset, 0, "SURF");
   ilo_printf("type 0x%x, format 0x%x\n",
         GEN_EXTRACT(dw, GEN6_SURFACE_DW0_TYPE),
         GEN_EXTRACT(dw, GEN6_SURFACE_DW0_FORMAT));

   writer_dw(builder, which, item->offset, 1, "SURF");
   ilo_printf("offset\n");

   dw = writer_dw(builder, which, item->offset, 2, "SURF");
   ilo_printf("%dx%d size, %d mips\n",
         GEN_EXTRACT(dw, GEN6_SURFACE_DW2_WIDTH),
         GEN_EXTRACT(dw, GEN6_SURFACE_DW2_HEIGHT),
         GEN_EXTRACT(dw, GEN6_SURFACE_DW2_MIP_COUNT_LOD));

   dw = writer_dw(builder, which, item->offset, 3, "SURF");
   ilo_printf("pitch %d, tiling %d\n",
         GEN_EXTRACT(dw, GEN6_SURFACE_DW3_PITCH),
         GEN_EXTRACT(dw, GEN6_SURFACE_DW3_TILING));

   dw = writer_dw(builder, which, item->offset, 4, "SURF");
   ilo_printf("mip base %d\n",
         GEN_EXTRACT(dw, GEN6_SURFACE_DW4_MIN_LOD));

   dw = writer_dw(builder, which, item->offset, 5, "SURF");
   ilo_printf("x,y offset: %d,%d\n",
         GEN_EXTRACT(dw, GEN6_SURFACE_DW5_X_OFFSET),
         GEN_EXTRACT(dw, GEN6_SURFACE_DW5_Y_OFFSET));
}
예제 #7
0
static void
writer_decode_color_calc(const struct ilo_builder *builder,
                         enum ilo_builder_writer_type which,
                         const struct ilo_builder_item *item)
{
   uint32_t dw;

   dw = writer_dw(builder, which, item->offset, 0, "CC");
   ilo_printf("alpha test format %s, round disable %d, "
              "stencil ref %d, bf stencil ref %d\n",
	      GEN_EXTRACT(dw, GEN6_CC_DW0_ALPHATEST) ? "FLOAT32" : "UNORM8",
	      (bool) (dw & GEN6_CC_DW0_ROUND_DISABLE_DISABLE),
	      GEN_EXTRACT(dw, GEN6_CC_DW0_STENCIL0_REF),
	      GEN_EXTRACT(dw, GEN6_CC_DW0_STENCIL1_REF));

   writer_dw(builder, which, item->offset, 1, "CC\n");

   dw = writer_dw(builder, which, item->offset, 2, "CC");
   ilo_printf("constant red %f\n", uif(dw));

   dw = writer_dw(builder, which, item->offset, 3, "CC");
   ilo_printf("constant green %f\n", uif(dw));

   dw = writer_dw(builder, which, item->offset, 4, "CC");
   ilo_printf("constant blue %f\n", uif(dw));

   dw = writer_dw(builder, which, item->offset, 5, "CC");
   ilo_printf("constant alpha %f\n", uif(dw));
}
예제 #8
0
static void
writer_decode_depth_stencil(const struct ilo_builder *builder,
                            enum ilo_builder_writer_type which,
                            const struct ilo_builder_item *item)
{
   uint32_t dw;

   dw = writer_dw(builder, which, item->offset, 0, "D_S");
   ilo_printf("stencil %sable, func %d, write %sable\n",
         (dw & GEN6_ZS_DW0_STENCIL_TEST_ENABLE) ? "en" : "dis",
         GEN_EXTRACT(dw, GEN6_ZS_DW0_STENCIL0_FUNC),
         (dw & GEN6_ZS_DW0_STENCIL_WRITE_ENABLE) ? "en" : "dis");

   dw = writer_dw(builder, which, item->offset, 1, "D_S");
   ilo_printf("stencil test mask 0x%x, write mask 0x%x\n",
         GEN_EXTRACT(dw, GEN6_ZS_DW1_STENCIL0_VALUEMASK),
         GEN_EXTRACT(dw, GEN6_ZS_DW1_STENCIL0_WRITEMASK));

   dw = writer_dw(builder, which, item->offset, 2, "D_S");
   ilo_printf("depth test %sable, func %d, write %sable\n",
         (dw & GEN6_ZS_DW2_DEPTH_TEST_ENABLE) ? "en" : "dis",
         GEN_EXTRACT(dw, GEN6_ZS_DW2_DEPTH_FUNC),
         (dw & GEN6_ZS_DW2_DEPTH_WRITE_ENABLE) ? "en" : "dis");
}
예제 #9
0
static void
writer_decode_binding_table(const struct ilo_builder *builder,
                            enum ilo_builder_writer_type which,
                            const struct ilo_builder_item *item)
{
   const unsigned state_size = sizeof(uint32_t) * 1;
   const unsigned count = item->size / state_size;
   unsigned offset = item->offset;
   unsigned i;

   for (i = 0; i < count; i++) {
      writer_dw(builder, which, offset, 0, "BIND");
      ilo_printf("BINDING_TABLE_STATE[%d]\n", i);

      offset += state_size;
   }
}
예제 #10
0
static void
writer_decode_blob(const struct ilo_builder *builder,
                   enum ilo_builder_writer_type which,
                   const struct ilo_builder_item *item)
{
   const unsigned state_size = sizeof(uint32_t);
   const unsigned count = item->size / state_size;
   unsigned offset = item->offset;
   unsigned i;

   for (i = 0; i < count; i += 4) {
      const uint32_t *dw = writer_pointer(builder, which, offset);

      writer_dw(builder, which, offset, 0, "BLOB%d", i / 4);

      switch (count - i) {
      case 1:
         ilo_printf("(%10.4f, %10c, %10c, %10c) "
                    "(0x%08x, %10c, %10c, %10c)\n",
                    uif(dw[0]), 'X', 'X', 'X',
                        dw[0],  'X', 'X', 'X');
         break;
      case 2:
         ilo_printf("(%10.4f, %10.4f, %10c, %10c) "
                    "(0x%08x, 0x%08x, %10c, %10c)\n",
                    uif(dw[0]), uif(dw[1]), 'X', 'X',
                        dw[0],      dw[1],  'X', 'X');
         break;
      case 3:
         ilo_printf("(%10.4f, %10.4f, %10.4f, %10c) "
                    "(0x%08x, 0x%08x, 0x%08x, %10c)\n",
                    uif(dw[0]), uif(dw[1]), uif(dw[2]), 'X',
                        dw[0],      dw[1],      dw[2],  'X');
         break;
      default:
         ilo_printf("(%10.4f, %10.4f, %10.4f, %10.4f) "
                    "(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
                    uif(dw[0]), uif(dw[1]), uif(dw[2]), uif(dw[3]),
                        dw[0],      dw[1],      dw[2],      dw[3]);
         break;
      }

      offset += state_size * 4;
   }
}
예제 #11
0
static void
writer_decode_surface_gen7(const struct ilo_builder *builder,
                           enum ilo_builder_writer_type which,
                           const struct ilo_builder_item *item)
{
   uint32_t dw;

   dw = writer_dw(builder, which, item->offset, 0, "SURF");
   ilo_printf("type 0x%x, format 0x%x, tiling %d, %s array\n",
         READ(dw, GEN7_SURFACE_DW0_TYPE),
         READ(dw, GEN7_SURFACE_DW0_FORMAT),
         READ(dw, GEN7_SURFACE_DW0_TILING),
         (dw & GEN7_SURFACE_DW0_IS_ARRAY) ? "is" : "not");

   writer_dw(builder, which, item->offset, 1, "SURF");
   ilo_printf("offset\n");

   dw = writer_dw(builder, which, item->offset, 2, "SURF");
   ilo_printf("%dx%d size\n",
         READ(dw, GEN7_SURFACE_DW2_WIDTH),
         READ(dw, GEN7_SURFACE_DW2_HEIGHT));

   dw = writer_dw(builder, which, item->offset, 3, "SURF");
   ilo_printf("depth %d, pitch %d\n",
         READ(dw, GEN7_SURFACE_DW3_DEPTH),
         READ(dw, GEN7_SURFACE_DW3_PITCH));

   dw = writer_dw(builder, which, item->offset, 4, "SURF");
   ilo_printf("min array element %d, array extent %d\n",
         READ(dw, GEN7_SURFACE_DW4_MIN_ARRAY_ELEMENT),
         READ(dw, GEN7_SURFACE_DW4_RT_VIEW_EXTENT));

   dw = writer_dw(builder, which, item->offset, 5, "SURF");
   ilo_printf("mip base %d, mips %d, x,y offset: %d,%d\n",
         READ(dw, GEN7_SURFACE_DW5_MIN_LOD),
         READ(dw, GEN7_SURFACE_DW5_MIP_COUNT_LOD),
         READ(dw, GEN7_SURFACE_DW5_X_OFFSET),
         READ(dw, GEN7_SURFACE_DW5_Y_OFFSET));

   writer_dw(builder, which, item->offset, 6, "SURF\n");
   writer_dw(builder, which, item->offset, 7, "SURF\n");
}
예제 #12
0
static void
writer_decode_interface_descriptor(const struct ilo_builder *builder,
                                   enum ilo_builder_writer_type which,
                                   const struct ilo_builder_item *item)
{
   const unsigned state_size = sizeof(uint32_t) * 8;
   const unsigned count = item->size / state_size;
   unsigned offset = item->offset;
   unsigned i;

   for (i = 0; i < count; i++) {
      writer_dw(builder, which, offset, 0, "IDRT[%d]", i);
      ilo_printf("kernel\n");

      writer_dw(builder, which, offset, 1, "IDRT[%d]", i);
      ilo_printf("spf, fp mode\n");

      writer_dw(builder, which, offset, 2, "IDRT[%d]", i);
      ilo_printf("sampler\n");

      writer_dw(builder, which, offset, 3, "IDRT[%d]", i);
      ilo_printf("binding table\n");

      writer_dw(builder, which, offset, 4, "IDRT[%d]", i);
      ilo_printf("curbe read len\n");

      writer_dw(builder, which, offset, 5, "IDRT[%d]", i);
      ilo_printf("rounding mode, slm size\n");

      writer_dw(builder, which, offset, 6, "IDRT[%d]", i);
      ilo_printf("cross-thread curbe read len\n");

      writer_dw(builder, which, offset, 7, "IDRT[%d]", i);
      ilo_printf("mbz\n");

      offset += state_size;
   }
}
예제 #13
0
static void
writer_decode_blob(const struct ilo_builder *builder,
                   enum ilo_builder_writer_type which,
                   const struct ilo_builder_item *item)
{
   const unsigned state_size = sizeof(uint32_t) * 4;
   const unsigned count = item->size / state_size;
   unsigned offset = item->offset;
   unsigned i;

   for (i = 0; i < count; i++) {
      const uint32_t *dw = writer_pointer(builder, which, offset);

      writer_dw(builder, which, offset, 0, "BLOB%d", i);
      /* output a single line for all four DWords */
      ilo_printf("(% f, % f, % f, % f) (0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
               uif(dw[0]), uif(dw[1]), uif(dw[2]), uif(dw[3]),
               dw[0], dw[1], dw[2], dw[3]);

      offset += state_size;
   }
}