debug_printf("llvmpipe: nr_empty_4x4: %9u (%2.0f%% of %u)\n", lp_count.nr_empty_4, p1, total_4);
debug_printf("llvmpipe: nr_non_empty_4x4: %9u (%2.0f%% of %u)\n", lp_count.nr_non_empty_4, p2, total_4);
+
+ debug_printf("llvmpipe: nr_llvm_compiles: %u\n", lp_count.nr_llvm_compiles);
+ debug_printf("llvmpipe: total LLVM compile time: %.2f sec\n", lp_count.llvm_compile_time / 1000000.0);
+ debug_printf("llvmpipe: average LLVM compile time: %.2f sec\n", lp_count.llvm_compile_time / 1000000.0 / lp_count.nr_llvm_compiles);
}
}
unsigned nr_partially_covered_16;
unsigned nr_empty_4;
unsigned nr_non_empty_4;
+ unsigned nr_llvm_compiles;
+ int64_t llvm_compile_time; /**< total, in microseconds */
};
/** Increment the named counter (only for debug builds) */
#ifdef DEBUG
#define LP_COUNT(counter) lp_count.counter++
+#define LP_COUNT_ADD(counter, incr) lp_count.counter += (incr)
#else
#define LP_COUNT(counter)
+#define LP_COUNT_ADD(counter, incr) (void) incr
#endif
#include "util/u_memory.h"
#include "util/u_format.h"
#include "util/u_debug_dump.h"
+#include "util/u_time.h"
#include "pipe/internal/p_winsys_screen.h"
#include "pipe/p_shader_tokens.h"
#include "draw/draw_context.h"
#include "lp_bld_swizzle.h"
#include "lp_bld_flow.h"
#include "lp_bld_debug.h"
-#include "lp_screen.h"
-#include "lp_context.h"
#include "lp_buffer.h"
+#include "lp_context.h"
+#include "lp_debug.h"
+#include "lp_perf.h"
+#include "lp_screen.h"
#include "lp_setup.h"
#include "lp_state.h"
#include "lp_tex_sample.h"
-#include "lp_debug.h"
static const unsigned char quad_offset_x[4] = {0, 1, 0, 1};
variant = variant->next;
}
- if(!variant)
+ if (!variant) {
+ struct util_time t0, t1;
+ int64_t dt;
+ util_time_get(&t0);
+
variant = generate_variant(lp, shader, &key);
+ util_time_get(&t1);
+ dt = util_time_diff(&t0, &t1);
+ LP_COUNT_ADD(llvm_compile_time, dt);
+ LP_COUNT_ADD(nr_llvm_compiles, 2); /* emit vs. omit in/out test */
+ }
+
shader->current = variant;
/* TODO: put this in the variant */