elem_types[LP_JIT_THREAD_DATA_CACHE] =
LLVMPointerType(lp_build_format_cache_type(gallivm), 0);
- elem_types[LP_JIT_THREAD_DATA_COUNTER] = LLVMInt64TypeInContext(lc);
- elem_types[LP_JIT_THREAD_DATA_INVOCATIONS] = LLVMInt64TypeInContext(lc);
+ elem_types[LP_JIT_THREAD_DATA_VIS_COUNTER] = LLVMInt64TypeInContext(lc);
+ elem_types[LP_JIT_THREAD_DATA_PS_INVOCATIONS] = LLVMInt64TypeInContext(lc);
elem_types[LP_JIT_THREAD_DATA_RASTER_STATE_VIEWPORT_INDEX] =
elem_types[LP_JIT_THREAD_DATA_RASTER_STATE_VIEW_INDEX] =
LLVMInt32TypeInContext(lc);
struct lp_jit_thread_data
{
struct lp_build_format_cache *cache;
- uint64_t vis_counter;
- uint64_t ps_invocations;
+ uint64_t vis_counter; // for occlusion query
+ uint64_t ps_invocations; // pixel shader invocations
/*
* Non-interpolated rasterizer state passed through to the fragment shader.
enum {
LP_JIT_THREAD_DATA_CACHE = 0,
- LP_JIT_THREAD_DATA_COUNTER,
- LP_JIT_THREAD_DATA_INVOCATIONS,
+ LP_JIT_THREAD_DATA_VIS_COUNTER,
+ LP_JIT_THREAD_DATA_PS_INVOCATIONS,
LP_JIT_THREAD_DATA_RASTER_STATE_VIEWPORT_INDEX,
LP_JIT_THREAD_DATA_RASTER_STATE_VIEW_INDEX,
LP_JIT_THREAD_DATA_COUNT
#define lp_jit_thread_data_cache(_gallivm, _type, _ptr) \
lp_build_struct_get2(_gallivm, _type, _ptr, LP_JIT_THREAD_DATA_CACHE, "cache")
-#define lp_jit_thread_data_counter(_gallivm, _type, _ptr) \
- lp_build_struct_get_ptr2(_gallivm, _type, _ptr, LP_JIT_THREAD_DATA_COUNTER, "counter")
+#define lp_jit_thread_data_vis_counter(_gallivm, _type, _ptr) \
+ lp_build_struct_get_ptr2(_gallivm, _type, _ptr, LP_JIT_THREAD_DATA_VIS_COUNTER, "viscounter")
-#define lp_jit_thread_data_invocations(_gallivm, _type, _ptr) \
- lp_build_struct_get_ptr2(_gallivm, _type, _ptr, LP_JIT_THREAD_DATA_INVOCATIONS, "invocs")
+#define lp_jit_thread_data_ps_invocations(_gallivm, _type, _ptr) \
+ lp_build_struct_get_ptr2(_gallivm, _type, _ptr, LP_JIT_THREAD_DATA_PS_INVOCATIONS, "psinvocs")
#define lp_jit_thread_data_raster_state_viewport_index(_gallivm, _type, _ptr) \
lp_build_struct_get2(_gallivm, _type, _ptr, \
}
if (key->occlusion_count) {
- LLVMValueRef counter = lp_jit_thread_data_counter(gallivm, thread_data_type, thread_data_ptr);
+ LLVMValueRef counter = lp_jit_thread_data_vis_counter(gallivm, thread_data_type, thread_data_ptr);
lp_build_name(counter, "counter");
lp_build_occlusion_count(gallivm, type,
if (shader->info.base.num_instructions > 1) {
LLVMValueRef invocs, val;
LLVMTypeRef invocs_type = LLVMInt64TypeInContext(gallivm->context);
- invocs = lp_jit_thread_data_invocations(gallivm, variant->jit_thread_data_type, thread_data_ptr);
+ invocs = lp_jit_thread_data_ps_invocations(gallivm, variant->jit_thread_data_type, thread_data_ptr);
val = LLVMBuildLoad2(builder, invocs_type, invocs, "");
val = LLVMBuildAdd(builder, val,
LLVMConstInt(LLVMInt64TypeInContext(gallivm->context),