summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_program.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2014-02-20 18:23:52 -0800
committerEric Anholt <eric@anholt.net>2014-02-22 19:23:21 -0800
commitf28c9208652143b4925bd97ce9823728c34d34a5 (patch)
tree9190b65ce54f3946796f020effcfd43abe1e6cd3 /src/mesa/drivers/dri/i965/brw_program.c
parent9ac9d133ed3d675a0c4cb527fb643ca590fe7d78 (diff)
downloadexternal_mesa3d-f28c9208652143b4925bd97ce9823728c34d34a5.zip
external_mesa3d-f28c9208652143b4925bd97ce9823728c34d34a5.tar.gz
external_mesa3d-f28c9208652143b4925bd97ce9823728c34d34a5.tar.bz2
i965: Refactor debug dumping of GLSL IR.
This was only going to get worse when tesselation shows up, and was causing too much extra duplication in my stderr changes coming up. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_program.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_program.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index 2145d7b..43d29fd 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -34,10 +34,12 @@
#include "main/enums.h"
#include "main/shaderobj.h"
#include "program/prog_parameter.h"
+#include "program/prog_print.h"
#include "program/program.h"
#include "program/programopt.h"
#include "tnl/tnl.h"
#include "glsl/ralloc.h"
+#include "glsl/ir.h"
#include "brw_context.h"
#include "brw_wm.h"
@@ -583,3 +585,19 @@ brw_stage_prog_data_free(const void *p)
ralloc_free(prog_data->param);
ralloc_free(prog_data->pull_param);
}
+
+void
+brw_dump_ir(struct brw_context *brw, const char *stage,
+ struct gl_shader_program *shader_prog,
+ struct gl_shader *shader, struct gl_program *prog)
+{
+ if (shader_prog) {
+ printf("GLSL IR for native %s shader %d:\n", stage, shader_prog->Name);
+ _mesa_print_ir(shader->ir, NULL);
+ printf("\n\n");
+ } else {
+ printf("ARB_%s_program %d ir for native %s shader\n",
+ stage, prog->Id, stage);
+ _mesa_print_program(prog);
+ }
+}