summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2013-12-05 17:59:29 +0200
committerTopi Pohjolainen <[email protected]>2013-12-27 11:58:59 +0200
commita7757bf518d15f171d260784da9c655c4faef8e6 (patch)
treee580e84897ea2152ae57c1d7dc41c45a3dd0b56c /src/mesa
parent1cb22f0da2e5f309a327e58f72dc25e5f864ff65 (diff)
i965/blorp: allow unit tests to compile and dump assembly
Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_blit.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 51a3bef53a5..112a307c6e4 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -631,7 +631,8 @@ public:
const brw_blorp_blit_prog_key *key);
~brw_blorp_blit_program();
- const GLuint *compile(struct brw_context *brw, GLuint *program_size);
+ const GLuint *compile(struct brw_context *brw, GLuint *program_size,
+ FILE *dump_file = stdout);
brw_blorp_prog_data prog_data;
@@ -753,7 +754,8 @@ brw_blorp_blit_program::~brw_blorp_blit_program()
const GLuint *
brw_blorp_blit_program::compile(struct brw_context *brw,
- GLuint *program_size)
+ GLuint *program_size,
+ FILE *dump_file)
{
/* Sanity checks */
if (key->dst_tiled_w && key->rt_samples > 0) {
@@ -910,7 +912,7 @@ brw_blorp_blit_program::compile(struct brw_context *brw,
if (unlikely(INTEL_DEBUG & DEBUG_BLORP)) {
printf("Native code for BLORP blit:\n");
- brw_dump_compile(&func, stdout, 0, func.next_insn_offset);
+ brw_dump_compile(&func, dump_file, 0, func.next_insn_offset);
printf("\n");
}
return brw_get_program(&func, program_size);
@@ -2368,3 +2370,14 @@ brw_blorp_blit_params::get_wm_prog(struct brw_context *brw,
}
return prog_offset;
}
+
+void
+brw_blorp_blit_test_compile(struct brw_context *brw,
+ const brw_blorp_blit_prog_key *key,
+ FILE *out)
+{
+ GLuint program_size;
+ brw_blorp_blit_program prog(brw, key);
+ INTEL_DEBUG |= DEBUG_BLORP;
+ prog.compile(brw, &program_size, out);
+}