aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2020-03-19 14:41:22 +1000
committerMarge Bot <[email protected]>2020-05-06 06:20:37 +0000
commit5697b9c00c363568c16efbfe6289d58f233a3f11 (patch)
tree37074bd4f666bd0fb32ee92eed06ec3e4221bba5
parent339a3a4dea48e1c174be4b544cec8fac50123313 (diff)
llvmpipe: pass interp location into interpolation code.
This just tracks the attribute interpolation location into the interp code. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_interp.c2
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_interp.h4
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_fs.c1
3 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.c b/src/gallium/drivers/llvmpipe/lp_bld_interp.c
index 79325683c61..9f6b577a9ee 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_interp.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.c
@@ -735,11 +735,13 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld,
/* Position */
bld->mask[0] = TGSI_WRITEMASK_XYZW;
bld->interp[0] = LP_INTERP_LINEAR;
+ bld->interp_loc[0] = 0;
/* Inputs */
for (attrib = 0; attrib < num_inputs; ++attrib) {
bld->mask[1 + attrib] = inputs[attrib].usage_mask;
bld->interp[1 + attrib] = inputs[attrib].interp;
+ bld->interp_loc[1 + attrib] = inputs[attrib].location;
}
bld->num_attribs = 1 + num_inputs;
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.h b/src/gallium/drivers/llvmpipe/lp_bld_interp.h
index 1b9ef5e878c..867a95e41d8 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_interp.h
+++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.h
@@ -71,7 +71,8 @@ struct lp_shader_input {
uint usage_mask:4; /* bitmask of TGSI_WRITEMASK_x flags */
uint src_index:8; /* where to find values in incoming vertices */
uint cyl_wrap:4; /* TGSI_CYLINDRICAL_WRAP_x flags */
- uint padding:12;
+ uint location:2; /* TGSI_INTERPOLOATE_LOC_* */
+ uint padding:10;
};
@@ -84,6 +85,7 @@ struct lp_build_interp_soa_context
unsigned num_attribs;
unsigned mask[1 + PIPE_MAX_SHADER_INPUTS]; /**< TGSI_WRITE_MASK_x */
enum lp_interp interp[1 + PIPE_MAX_SHADER_INPUTS];
+ unsigned interp_loc[1 + PIPE_MAX_SHADER_INPUTS];
boolean simple_interp;
boolean depth_clamp;
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index d44f85eb0f6..93da53340e6 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -3030,6 +3030,7 @@ llvmpipe_create_fs_state(struct pipe_context *pipe,
for (i = 0; i < shader->info.base.num_inputs; i++) {
shader->inputs[i].usage_mask = shader->info.base.input_usage_mask[i];
shader->inputs[i].cyl_wrap = shader->info.base.input_cylindrical_wrap[i];
+ shader->inputs[i].location = shader->info.base.input_interpolate_loc[i];
switch (shader->info.base.input_interpolate[i]) {
case TGSI_INTERPOLATE_CONSTANT: