diff options
author | Roland Scheidegger <[email protected]> | 2014-05-16 01:00:53 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2014-05-16 22:50:14 +0200 |
commit | 26cac02c51db0f49f6c67d3cd029ce044a087473 (patch) | |
tree | 7b6d73ec23ee447239a30cf5385ff9ae6e0b8b42 /src/gallium/drivers | |
parent | ef6b6658f91bd5871739bdb71a08042f26abe389 (diff) |
gallivm: give more verbose names to modules
When we had just one module "gallivm" was an appropriate name. But now we have
modules containing all functions for a particular variant, so give it a
corresponding name (this is really just for helping debugging).
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_fs.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_setup.c | 13 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_test_arit.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_test_blend.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_test_conv.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_test_format.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_test_printf.c | 2 |
7 files changed, 21 insertions, 16 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 655891cffb1..4872e0d1a30 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -2160,7 +2160,7 @@ generate_fragment(struct llvmpipe_context *lp, struct gallivm_state *gallivm = variant->gallivm; const struct lp_fragment_shader_variant_key *key = &variant->key; struct lp_shader_input inputs[PIPE_MAX_SHADER_INPUTS]; - char func_name[256]; + char func_name[64]; struct lp_type fs_type; struct lp_type blend_type; LLVMTypeRef fs_elem_type; @@ -2247,8 +2247,8 @@ generate_fragment(struct llvmpipe_context *lp, blend_vec_type = lp_build_vec_type(gallivm, blend_type); - util_snprintf(func_name, sizeof(func_name), "fs%u_variant%u_%s", - shader->no, variant->no, partial_mask ? "partial" : "whole"); + util_snprintf(func_name, sizeof(func_name), "fs%u_variant%u_%s", + shader->no, variant->no, partial_mask ? "partial" : "whole"); arg_types[0] = variant->jit_context_ptr_type; /* context */ arg_types[1] = int32_type; /* x */ @@ -2558,12 +2558,16 @@ generate_variant(struct llvmpipe_context *lp, struct lp_fragment_shader_variant *variant; const struct util_format_description *cbuf0_format_desc; boolean fullcolormask; + char module_name[64]; variant = CALLOC_STRUCT(lp_fragment_shader_variant); if(!variant) return NULL; - variant->gallivm = gallivm_create(); + util_snprintf(module_name, sizeof(module_name), "fs%u_variant%u", + shader->no, shader->variants_created); + + variant->gallivm = gallivm_create(module_name); if (!variant->gallivm) { FREE(variant); return NULL; diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c index 361ee70b662..63c92d588c9 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c @@ -711,7 +711,7 @@ generate_setup_variant(struct lp_setup_variant_key *key, struct lp_setup_variant *variant = NULL; struct gallivm_state *gallivm; struct lp_setup_args args; - char func_name[256]; + char func_name[64]; LLVMTypeRef vec4f_type; LLVMTypeRef func_type; LLVMTypeRef arg_types[7]; @@ -726,13 +726,17 @@ generate_setup_variant(struct lp_setup_variant_key *key, if (variant == NULL) goto fail; - variant->gallivm = gallivm = gallivm_create(); + variant->no = setup_no++; + + util_snprintf(func_name, sizeof(func_name), "setup_variant_%u", + variant->no); + + variant->gallivm = gallivm = gallivm_create(func_name); if (!variant->gallivm) { goto fail; } builder = gallivm->builder; - variant->no = setup_no++; if (LP_DEBUG & DEBUG_COUNTERS) { t0 = os_time_get(); @@ -741,9 +745,6 @@ generate_setup_variant(struct lp_setup_variant_key *key, memcpy(&variant->key, key, key->size); variant->list_item_global.base = variant; - util_snprintf(func_name, sizeof(func_name), "setup_variant_%u", - variant->no); - /* Currently always deal with full 4-wide vertex attributes from * the vertices. */ diff --git a/src/gallium/drivers/llvmpipe/lp_test_arit.c b/src/gallium/drivers/llvmpipe/lp_test_arit.c index f8998c159fb..bf405a54ae1 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_arit.c +++ b/src/gallium/drivers/llvmpipe/lp_test_arit.c @@ -354,7 +354,7 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test) in[i] = 1.0; } - gallivm = gallivm_create(); + gallivm = gallivm_create("test_module"); test_func = build_unary_test_func(gallivm, test); diff --git a/src/gallium/drivers/llvmpipe/lp_test_blend.c b/src/gallium/drivers/llvmpipe/lp_test_blend.c index ec80593baf6..4775aff877b 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_blend.c +++ b/src/gallium/drivers/llvmpipe/lp_test_blend.c @@ -450,7 +450,7 @@ test_one(unsigned verbose, if(verbose >= 1) dump_blend_type(stdout, blend, type); - gallivm = gallivm_create(); + gallivm = gallivm_create("test_module"); func = add_blend_test(gallivm, blend, type); diff --git a/src/gallium/drivers/llvmpipe/lp_test_conv.c b/src/gallium/drivers/llvmpipe/lp_test_conv.c index b7d0bfda4b8..948a218d7f7 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_conv.c +++ b/src/gallium/drivers/llvmpipe/lp_test_conv.c @@ -211,7 +211,7 @@ test_one(unsigned verbose, eps = MAX2(lp_const_eps(src_type), lp_const_eps(dst_type)); - gallivm = gallivm_create(); + gallivm = gallivm_create("test_module"); func = add_conv_test(gallivm, src_type, num_srcs, dst_type, num_dsts); diff --git a/src/gallium/drivers/llvmpipe/lp_test_format.c b/src/gallium/drivers/llvmpipe/lp_test_format.c index d27e1b1c7de..2c8321939ae 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_format.c +++ b/src/gallium/drivers/llvmpipe/lp_test_format.c @@ -138,7 +138,7 @@ test_format_float(unsigned verbose, FILE *fp, boolean success = TRUE; unsigned i, j, k, l; - gallivm = gallivm_create(); + gallivm = gallivm_create("test_module_float"); fetch = add_fetch_rgba_test(gallivm, verbose, desc, lp_float32_vec4_type()); @@ -223,7 +223,7 @@ test_format_unorm8(unsigned verbose, FILE *fp, boolean success = TRUE; unsigned i, j, k, l; - gallivm = gallivm_create(); + gallivm = gallivm_create("test_module_unorm8"); fetch = add_fetch_rgba_test(gallivm, verbose, desc, lp_unorm8_vec4_type()); diff --git a/src/gallium/drivers/llvmpipe/lp_test_printf.c b/src/gallium/drivers/llvmpipe/lp_test_printf.c index 37c1b559e8b..4b74ae96a7a 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_printf.c +++ b/src/gallium/drivers/llvmpipe/lp_test_printf.c @@ -94,7 +94,7 @@ test_printf(unsigned verbose, FILE *fp, test_printf_t test_printf_func; boolean success = TRUE; - gallivm = gallivm_create(); + gallivm = gallivm_create("test_module"); test = add_printf_test(gallivm); |