From ed48f91275f52f26b513fc2970233063bfa023af Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 26 Sep 2014 10:33:11 -0400 Subject: freedreno/a3xx: add flat interpolation mode Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/ir3/ir3_compiler.c | 1 + src/gallium/drivers/freedreno/ir3/ir3_shader.h | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/freedreno/ir3') diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c index c6026bbe74a..c2d4942b66d 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c @@ -2380,6 +2380,7 @@ decl_in(struct ir3_compile_context *ctx, struct tgsi_full_declaration *decl) so->inputs[n].compmask = (1 << ncomp) - 1; so->inputs[n].regid = r; so->inputs[n].inloc = ctx->next_inloc; + so->inputs[n].interpolate = decl->Interp.Interpolate; for (j = 0; j < ncomp; j++) { struct ir3_instruction *instr = NULL; diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.h b/src/gallium/drivers/freedreno/ir3/ir3_shader.h index 882893fdde5..ea861649176 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_shader.h +++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.h @@ -122,9 +122,20 @@ struct ir3_shader_variant { uint8_t regid; uint8_t compmask; uint8_t ncomp; - /* in theory inloc of fs should match outloc of vs: */ + /* In theory inloc of fs should match outloc of vs. Or + * rather the outloc of the vs is 8 plus the offset passed + * to bary.f. Presumably that +8 is to account for + * gl_Position/gl_PointSize? + * + * NOTE inloc is currently aligned to 4 (we don't try + * to pack varyings). Changing this would likely break + * assumptions in few places (like setting up of flat + * shading in fd3_program) so be sure to check all the + * spots where inloc is used. + */ uint8_t inloc; uint8_t bary; + uint8_t interpolate; } inputs[16 + 2]; /* +POSITION +FACE */ unsigned total_in; /* sum of inputs (scalar) */ @@ -159,9 +170,9 @@ struct ir3_shader { struct ir3_shader_variant *variants; /* so far, only used for blit_prog shader.. values for - * VPC_VARYING_INTERP[i].MODE and VPC_VARYING_PS_REPL[i].MODE + * VPC_VARYING_PS_REPL[i].MODE */ - uint32_t vinterp[4], vpsrepl[4]; + uint32_t vpsrepl[4]; }; -- cgit v1.2.3