gallivm/tgsi/swr: add mask vec to the tcs store
authorDave Airlie <airlied@redhat.com>
Mon, 17 Feb 2020 06:47:51 +0000 (16:47 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 28 Feb 2020 08:33:34 +0000 (18:33 +1000)
For the nir paths we want to access the mask vector to only
store when the mask allows it.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3841>

src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
src/gallium/drivers/swr/swr_shader.cpp

index 380579c3f70f44be02c2fe63a894e990b0ec4dca..6af8b0bea5510b17bd64808f63be699ea4955aab 100644 (file)
@@ -441,7 +441,8 @@ struct lp_build_tcs_iface
                              boolean is_aindex_indirect,
                              LLVMValueRef attrib_index,
                              LLVMValueRef swizzle_index,
-                             LLVMValueRef value);
+                             LLVMValueRef value,
+                             LLVMValueRef mask_vec);
 
    LLVMValueRef (*emit_fetch_input)(const struct lp_build_tcs_iface *tcs_iface,
                                     struct lp_build_context * bld,
index 5895fa90451b38aa981f0f6949fd08776203f16f..2586830bb468fcfbf9912c7887133d264bb62843 100644 (file)
@@ -1764,7 +1764,7 @@ emit_store_tcs_output(struct lp_build_tgsi_context *bld_base,
                                           reg->Register.Indirect,
                                           attrib_index,
                                           channel_index,
-                                          value);
+                                          value, NULL);
 }
 
 static void
index c4d0bb2fc52c12043aee34772f92b0efd777ce5c..943215703698326f19767b7e0d96b096fc3b90e1 100644 (file)
@@ -601,7 +601,8 @@ void swr_tcs_llvm_store_output(const struct lp_build_tcs_iface *tcs_iface,
                          boolean is_aindex_indirect,
                          LLVMValueRef attrib_index,
                          LLVMValueRef swizzle_index,
-                         LLVMValueRef value)
+                         LLVMValueRef value,
+                         LLVMValueRef mask_vec)
 {
     swr_tcs_llvm_iface *iface = (swr_tcs_llvm_iface*)tcs_iface;
     struct lp_build_tgsi_context *bld_base = (struct lp_build_tgsi_context*)bld;