diff options
author | Marek Olšák <[email protected]> | 2015-02-22 14:58:30 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-02-24 21:21:04 +0100 |
commit | ffd701e677bf5df9315bd42a5f07585c7ad03d93 (patch) | |
tree | 35e5c4ee82dc277cde2d4864bf209cda3b2976ce /src/gallium/drivers/radeonsi/si_shader.c | |
parent | 93daf5a2f6218ab086add878fce8e423899e1cc5 (diff) |
radeonsi: dump the shader key when dumping shaders
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index e6849ad22c7..b0417edf33e 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -2740,6 +2740,43 @@ static int si_generate_gs_copy_shader(struct si_screen *sscreen, return r; } +static void si_dump_key(unsigned shader, union si_shader_key *key) +{ + int i; + + fprintf(stderr, "SHADER KEY\n"); + + switch (shader) { + case PIPE_SHADER_VERTEX: + fprintf(stderr, " instance_divisors = {"); + for (i = 0; i < Elements(key->vs.instance_divisors); i++) + fprintf(stderr, !i ? "%u" : ", %u", + key->vs.instance_divisors[i]); + fprintf(stderr, "}\n"); + + if (key->vs.as_es) + fprintf(stderr, " gs_used_inputs = 0x%"PRIx64"\n", + key->vs.gs_used_inputs); + fprintf(stderr, " as_es = %u\n", key->vs.as_es); + break; + + case PIPE_SHADER_GEOMETRY: + break; + + case PIPE_SHADER_FRAGMENT: + fprintf(stderr, " export_16bpc = 0x%X\n", key->ps.export_16bpc); + fprintf(stderr, " last_cbuf = %u\n", key->ps.last_cbuf); + fprintf(stderr, " color_two_side = %u\n", key->ps.color_two_side); + fprintf(stderr, " alpha_func = %u\n", key->ps.alpha_func); + fprintf(stderr, " alpha_to_one = %u\n", key->ps.alpha_to_one); + fprintf(stderr, " poly_stipple = %u\n", key->ps.poly_stipple); + break; + + default: + assert(0); + } +} + int si_shader_create(struct si_screen *sscreen, struct si_shader *shader) { struct si_shader_selector *sel = shader->selector; @@ -2762,6 +2799,7 @@ int si_shader_create(struct si_screen *sscreen, struct si_shader *shader) /* Dump TGSI code before doing TGSI->LLVM conversion in case the * conversion fails. */ if (dump) { + si_dump_key(sel->type, &shader->key); tgsi_dump(tokens, 0); si_dump_streamout(&sel->so); } |