llvmpipe: put variant print/debug code into separate function

This commit is contained in:
Brian Paul
2010-05-19 11:28:29 -06:00
parent e67c338b41
commit c2a036d4ef

View File

@@ -882,22 +882,17 @@ generate_fragment(struct llvmpipe_context *lp,
}
static struct lp_fragment_shader_variant *
generate_variant(struct llvmpipe_context *lp,
struct lp_fragment_shader *shader,
const struct lp_fragment_shader_variant_key *key)
static void
dump_fs_variant_key(const struct lp_fragment_shader_variant_key *key)
{
struct lp_fragment_shader_variant *variant;
if (gallivm_debug & GALLIVM_DEBUG_IR) {
unsigned i;
tgsi_dump(shader->base.tokens, 0);
if (key->depth.enabled) {
debug_printf("depth.format = %s\n", util_format_name(key->zsbuf_format));
debug_printf("depth.func = %s\n", util_dump_func(key->depth.func, TRUE));
debug_printf("depth.writemask = %u\n", key->depth.writemask);
}
for (i = 0; i < 2; ++i) {
if (key->stencil[i].enabled) {
debug_printf("stencil[%u].func = %s\n", i, util_dump_func(key->stencil[i].func, TRUE));
@@ -908,10 +903,12 @@ generate_variant(struct llvmpipe_context *lp,
debug_printf("stencil[%u].writemask = 0x%x\n", i, key->stencil[i].writemask);
}
}
if (key->alpha.enabled) {
debug_printf("alpha.func = %s\n", util_dump_func(key->alpha.func, TRUE));
debug_printf("alpha.ref_value = %f\n", key->alpha.ref_value);
}
if (key->blend.logicop_enable) {
debug_printf("blend.logicop_func = %u\n", key->blend.logicop_func);
}
@@ -952,6 +949,20 @@ generate_variant(struct llvmpipe_context *lp,
}
}
static struct lp_fragment_shader_variant *
generate_variant(struct llvmpipe_context *lp,
struct lp_fragment_shader *shader,
const struct lp_fragment_shader_variant_key *key)
{
struct lp_fragment_shader_variant *variant;
if (gallivm_debug & GALLIVM_DEBUG_IR) {
tgsi_dump(shader->base.tokens, 0);
dump_fs_variant_key(key);
}
variant = CALLOC_STRUCT(lp_fragment_shader_variant);
if(!variant)
return NULL;