llvmpipe: pass interp location into interpolation code.
authorDave Airlie <airlied@redhat.com>
Thu, 19 Mar 2020 04:41:22 +0000 (14:41 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 6 May 2020 06:20:37 +0000 (06:20 +0000)
This just tracks the attribute interpolation location into the
interp code.

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

src/gallium/drivers/llvmpipe/lp_bld_interp.c
src/gallium/drivers/llvmpipe/lp_bld_interp.h
src/gallium/drivers/llvmpipe/lp_state_fs.c

index 79325683c61efe858212f2fb9def50320ec0766d..9f6b577a9ee25f443fb314a12f0598b6e5284561 100644 (file)
@@ -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;
 
index 1b9ef5e878cc5eec053f0090ade49008d86e63a5..867a95e41d87930fc7262e37965b8917b2c55a90 100644 (file)
@@ -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;
 
index d44f85eb0f6077584adcba1d1c588d3b1b9d27f1..93da53340e66e312cb7efc51462fa0c92f705f5e 100644 (file)
@@ -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: