summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2015-04-01 12:31:46 -0400
committerRob Clark <[email protected]>2015-04-05 16:36:34 -0400
commit6cd9c94ce49a2c1a8826c1b1bf2fb73dc595131d (patch)
treed72bde69c05a83b8025d16a1f2e4883eb99249fa /src
parentf513f006ceed825fa09e606d99190e490e559885 (diff)
freedreno/ir3: handle FRAG IN's without interpolation specified
Fallback to picking based on semantic name. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_compiler.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c
index 82393088fe6..38df8b5fdf4 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c
@@ -3107,15 +3107,23 @@ decl_in(struct ir3_compile_context *ctx, struct tgsi_full_declaration *decl)
} else {
bool use_ldlv = false;
- /* I don't believe it is valid to not have Interp
- * on a normal frag shader input, and various parts
- * that that handle flat/smooth shading make this
- * assumption as well.
+ /* if no interpolation given, pick based on
+ * semantic:
*/
- compile_assert(ctx, decl->Declaration.Interpolate);
+ if (!decl->Declaration.Interpolate) {
+ switch (decl->Semantic.Name) {
+ case TGSI_SEMANTIC_COLOR:
+ so->inputs[n].interpolate =
+ TGSI_INTERPOLATE_COLOR;
+ break;
+ default:
+ so->inputs[n].interpolate =
+ TGSI_INTERPOLATE_LINEAR;
+ }
+ }
if (ctx->flat_bypass) {
- switch (decl->Interp.Interpolate) {
+ switch (so->inputs[n].interpolate) {
case TGSI_INTERPOLATE_COLOR:
if (!ctx->so->key.rasterflat)
break;
@@ -3162,7 +3170,7 @@ decl_sv(struct ir3_compile_context *ctx, struct tgsi_full_declaration *decl)
so->inputs[n].compmask = 1;
so->inputs[n].regid = r;
so->inputs[n].inloc = ctx->next_inloc;
- so->inputs[n].interpolate = false;
+ so->inputs[n].interpolate = TGSI_INTERPOLATE_CONSTANT;
struct ir3_instruction *instr = NULL;