Module: Mesa
Branch: main
Commit: 3658fd68237c4ed3eb2bd2b50f3e4f4dc759e810
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3658fd68237c4ed3eb2bd2b50f3e4f4dc759e810

Author: Brian Paul <[email protected]>
Date:   Mon Apr  3 14:47:53 2023 -0600

llvmpipe: rename some vars related to occlusion query and ps invocations

More consistent naming.

Signed-off-by: Brian Paul <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>

---

 src/gallium/drivers/llvmpipe/lp_jit.c      |  4 ++--
 src/gallium/drivers/llvmpipe/lp_jit.h      | 16 ++++++++--------
 src/gallium/drivers/llvmpipe/lp_state_fs.c |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c 
b/src/gallium/drivers/llvmpipe/lp_jit.c
index 7fca9dcdb35..11ba078de4d 100644
--- a/src/gallium/drivers/llvmpipe/lp_jit.c
+++ b/src/gallium/drivers/llvmpipe/lp_jit.c
@@ -296,8 +296,8 @@ lp_jit_create_types(struct lp_fragment_shader_variant *lp)
 
       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);
diff --git a/src/gallium/drivers/llvmpipe/lp_jit.h 
b/src/gallium/drivers/llvmpipe/lp_jit.h
index c79a87a7a47..2d26e952322 100644
--- a/src/gallium/drivers/llvmpipe/lp_jit.h
+++ b/src/gallium/drivers/llvmpipe/lp_jit.h
@@ -242,8 +242,8 @@ enum {
 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.
@@ -257,8 +257,8 @@ struct lp_jit_thread_data
 
 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
@@ -268,11 +268,11 @@ enum {
 #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, \
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c 
b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index a06f79c2328..ac55f8e3d69 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -1347,7 +1347,7 @@ generate_fs_loop(struct gallivm_state *gallivm,
    }
 
    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,
@@ -3268,7 +3268,7 @@ generate_fragment(struct llvmpipe_context *lp,
    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),

Reply via email to