Mesa (master): draw: Dump LLVM shader key.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Fri Dec 7 15:03:34 UTC 2012


Module: Mesa
Branch: master
Commit: 6e27e2e90e2aa42a306edadaa4d76fc4ecf6f7b2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6e27e2e90e2aa42a306edadaa4d76fc4ecf6f7b2

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Dec  4 16:55:32 2012 +0000

draw: Dump LLVM shader key.

Just like we do in llvmpipe for the fragment shader compilation key.

Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/auxiliary/draw/draw_llvm.c |   31 ++++++++++++++++++++++++++++++-
 src/gallium/auxiliary/draw/draw_llvm.h |    3 +++
 2 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 039db8f..a3a3bbf 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -443,8 +443,9 @@ generate_vs(struct draw_llvm_variant *variant,
    LLVMValueRef consts_ptr = draw_jit_context_vs_constants(variant->gallivm, context_ptr);
    struct lp_build_sampler_soa *sampler = 0;
 
-   if (gallivm_debug & GALLIVM_DEBUG_IR) {
+   if (gallivm_debug & (GALLIVM_DEBUG_TGSI | GALLIVM_DEBUG_IR)) {
       tgsi_dump(tokens, 0);
+      draw_llvm_dump_variant_key(&variant->key);
    }
 
    if (llvm->draw->num_sampler_views && llvm->draw->num_samplers)
@@ -1364,6 +1365,34 @@ draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store)
 
 
 void
+draw_llvm_dump_variant_key(struct draw_llvm_variant_key *key)
+{
+   unsigned i;
+   struct lp_sampler_static_state *sampler = draw_llvm_variant_key_samplers(key);
+
+   debug_printf("clamp_vertex_color = %u\n", key->clamp_vertex_color);
+   debug_printf("clip_xy = %u\n", key->clip_xy);
+   debug_printf("clip_z = %u\n", key->clip_z);
+   debug_printf("clip_user = %u\n", key->clip_user);
+   debug_printf("bypass_viewport = %u\n", key->bypass_viewport);
+   debug_printf("clip_halfz = %u\n", key->clip_halfz);
+   debug_printf("need_edgeflags = %u\n", key->need_edgeflags);
+   debug_printf("ucp_enable = %u\n", key->ucp_enable);
+
+   for (i = 0 ; i < key->nr_vertex_elements; i++) {
+      debug_printf("vertex_element[%i].src_offset = %u\n", i, key->vertex_element[i].src_offset);
+      debug_printf("vertex_element[%i].instance_divisor = %u\n", i, key->vertex_element[i].instance_divisor);
+      debug_printf("vertex_element[%i].vertex_buffer_index = %u\n", i, key->vertex_element[i].vertex_buffer_index);
+      debug_printf("vertex_element[%i].src_format = %s\n", i, util_format_name(key->vertex_element[i].src_format));
+   }
+
+   for (i = 0 ; i < key->nr_samplers; i++) {
+      debug_printf("sampler[%i].src_format = %s\n", i, util_format_name(sampler[i].format));
+   }
+}
+
+
+void
 draw_llvm_set_mapped_texture(struct draw_context *draw,
                              unsigned sampler_idx,
                              uint32_t width, uint32_t height, uint32_t depth,
diff --git a/src/gallium/auxiliary/draw/draw_llvm.h b/src/gallium/auxiliary/draw/draw_llvm.h
index bd11886..892973c 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.h
+++ b/src/gallium/auxiliary/draw/draw_llvm.h
@@ -284,6 +284,9 @@ draw_llvm_destroy_variant(struct draw_llvm_variant *variant);
 struct draw_llvm_variant_key *
 draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store);
 
+void
+draw_llvm_dump_variant_key(struct draw_llvm_variant_key *key);
+
 struct lp_build_sampler_soa *
 draw_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state,
                              LLVMValueRef context_ptr);




More information about the mesa-commit mailing list