Mesa (main): llvmpipe: split coefficient calculation and store
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Aug 24 07:55:22 UTC 2021
Module: Mesa
Branch: main
Commit: 1fa61483dedacfb245428e701029f00825cc58a9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1fa61483dedacfb245428e701029f00825cc58a9
Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date: Mon Aug 23 15:52:46 2021 +0200
llvmpipe: split coefficient calculation and store
This will be used for some underhanded smuggling of values in the next
commit.
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12442>
---
src/gallium/drivers/llvmpipe/lp_state_setup.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c
index e214d6e48c1..e0f8b3daad5 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c
@@ -389,12 +389,12 @@ load_attribute(struct gallivm_state *gallivm,
* which obviously wouldn't work)).
*/
static void
-emit_coef4( struct gallivm_state *gallivm,
+calc_coef4( struct gallivm_state *gallivm,
struct lp_setup_args *args,
- unsigned slot,
LLVMValueRef a0,
LLVMValueRef a1,
- LLVMValueRef a2)
+ LLVMValueRef a2,
+ LLVMValueRef out[3])
{
LLVMBuilderRef b = gallivm->builder;
LLVMValueRef attr_0;
@@ -426,7 +426,23 @@ emit_coef4( struct gallivm_state *gallivm,
LLVMValueRef attr_v0 = LLVMBuildFAdd(b, dadx_x0, dady_y0, "attr_v0");
attr_0 = LLVMBuildFSub(b, a0, attr_v0, "attr_0");
- store_coef(gallivm, args, slot, attr_0, dadx, dady);
+ out[0] = attr_0;
+ out[1] = dadx;
+ out[2] = dady;
+}
+
+static void
+emit_coef4( struct gallivm_state *gallivm,
+ struct lp_setup_args *args,
+ unsigned slot,
+ LLVMValueRef a0,
+ LLVMValueRef a1,
+ LLVMValueRef a2)
+{
+ LLVMValueRef coeffs[3];
+ calc_coef4(gallivm, args, a0, a1, a2, coeffs);
+ store_coef(gallivm, args, slot,
+ coeffs[0], coeffs[1], coeffs[2]);
}
More information about the mesa-commit
mailing list