int brw_upload_cs_urb_state(struct brw_context *brw);
/* brw_disasm.c */
-int brw_disasm (FILE *file, struct brw_instruction *inst);
+int brw_disasm (FILE *file,
+ const struct brw_instruction *inst,
+ unsigned count);
/*======================================================================
* Inline conversion functions. These are better-typed than the
return err;
}
-static int dest (FILE *file, struct brw_instruction *inst)
+static int dest (FILE *file, const struct brw_instruction *inst)
{
int err = 0;
}
-static int imm (FILE *file, GLuint type, struct brw_instruction *inst) {
+static int imm (FILE *file, GLuint type, const struct brw_instruction *inst) {
switch (type) {
case BRW_REGISTER_TYPE_UD:
format (file, "0x%08xUD", inst->bits3.ud);
return 0;
}
-static int src0 (FILE *file, struct brw_instruction *inst)
+static int src0 (FILE *file, const struct brw_instruction *inst)
{
if (inst->bits1.da1.src0_reg_file == BRW_IMMEDIATE_VALUE)
return imm (file, inst->bits1.da1.src0_reg_type,
}
}
-static int src1 (FILE *file, struct brw_instruction *inst)
+static int src1 (FILE *file, const struct brw_instruction *inst)
{
if (inst->bits1.da1.src1_reg_file == BRW_IMMEDIATE_VALUE)
return imm (file, inst->bits1.da1.src1_reg_type,
}
}
-int brw_disasm (FILE *file, struct brw_instruction *inst)
+static int brw_disasm_insn (FILE *file, const struct brw_instruction *inst)
{
int err = 0;
int space = 0;
newline (file);
return err;
}
+
+
+int brw_disasm (FILE *file,
+ const struct brw_instruction *inst,
+ unsigned count)
+{
+ int i, err;
+
+ for (i = 0; i < count; i++) {
+ err = brw_disasm_insn(stderr, &inst[i]);
+ if (err)
+ return err;
+ }
+
+ fprintf(file, "\n");
+ return 0;
+}
+
int i;
debug_printf("vs-native:\n");
- for (i = 0; i < p->nr_insn; i++)
- brw_disasm(stderr, &p->store[i]);
- debug_printf("\n");
+ brw_disasm(stderr, p->store, p->nr_insn);
}
}
}
if (BRW_DEBUG & DEBUG_WM) {
- int i;
-
debug_printf("wm-native:\n");
- for (i = 0; i < p->nr_insn; i++)
- brw_disasm(stderr, &p->store[i]);
- debug_printf("\n");
+ brw_disasm(stderr, p->store, p->nr_insn);
}
}
if (BRW_DEBUG & DEBUG_WM) {
debug_printf("wm-native:\n");
- for (i = 0; i < p->nr_insn; i++)
- brw_disasm(stderr, &p->store[i]);
- debug_printf("\n");
+ brw_disasm(stderr, p->store, p->nr_insn);
}
}
#define MAX_VRAM (128*1024*1024)
-extern int brw_disasm (FILE *file, struct brw_instruction *inst);
+extern int brw_disasm (FILE *file,
+ const struct brw_instruction *inst,
+ unsigned count );
struct xlib_brw_buffer
{
brw_dump_cc_unit_state( data );
break;
case BRW_DATA_GS_WM_PROG:
- brw_disasm( stderr, data ); /* disassem */
+ case BRW_DATA_GS_SF_PROG:
+ case BRW_DATA_GS_VS_PROG:
+ case BRW_DATA_GS_GS_PROG:
+ case BRW_DATA_GS_CLIP_PROG:
+ brw_disasm( stderr, data, size / sizeof(struct brw_instruction) );
break;
case BRW_DATA_GS_SAMPLER_DEFAULT_COLOR:
brw_dump_sampler_default_color( data );
case BRW_DATA_GS_WM_UNIT:
brw_dump_wm_unit_state( data );
break;
- case BRW_DATA_GS_SF_PROG:
- brw_disasm( stderr, data ); /* disassem */
- break;
case BRW_DATA_GS_SF_VP:
brw_dump_sf_viewport( data );
break;
case BRW_DATA_GS_VS_UNIT:
brw_dump_vs_unit_state( data );
break;
- case BRW_DATA_GS_VS_PROG:
- brw_disasm( stderr, data ); /* disassem */
- break;
case BRW_DATA_GS_GS_UNIT:
brw_dump_gs_unit_state( data );
break;
- case BRW_DATA_GS_GS_PROG:
- brw_disasm( stderr, data ); /* disassem */
- break;
case BRW_DATA_GS_CLIP_VP:
brw_dump_clipper_viewport( data );
break;
case BRW_DATA_GS_CLIP_UNIT:
brw_dump_clip_unit_state( data );
break;
- case BRW_DATA_GS_CLIP_PROG:
- brw_disasm( stderr, data ); /* disassem */
- break;
case BRW_DATA_SS_SURFACE:
brw_dump_surface_state( data );
break;