From: Dave Airlie Date: Thu, 19 Mar 2020 04:41:22 +0000 (+1000) Subject: llvmpipe: pass interp location into interpolation code. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5697b9c00c363568c16efbfe6289d58f233a3f11;p=mesa.git llvmpipe: pass interp location into interpolation code. This just tracks the attribute interpolation location into the interp code. Reviewed-by: Roland Scheidegger Part-of: --- 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: