diff options
author | Christoph Bumiller <[email protected]> | 2012-01-12 19:28:03 +0100 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2012-01-12 22:38:01 +0100 |
commit | af0ce1dba8219ff8628f1fa61cf93c11a77dab94 (patch) | |
tree | 736077c2d6656093e0cd89e364eca0f40c559071 /src/gallium/drivers/nv50/codegen | |
parent | 7b6881932a71b36dd47f63200c9dbee8e2b9af4f (diff) |
nv50/ir: make use of TGSI_INTERPOLATE_COLOR
Flat SHADE_MODEL still overrides any non-flat interpolation
qualifier, but pulling that state out of the rasterizer cso
isn't really worth the effort, is it ?
NOTE: This is a candidate for the 8.0 branch.
Diffstat (limited to 'src/gallium/drivers/nv50/codegen')
-rw-r--r-- | src/gallium/drivers/nv50/codegen/nv50_ir_driver.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp | 14 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_driver.h b/src/gallium/drivers/nv50/codegen/nv50_ir_driver.h index a37a29a99a6..84a514091c6 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_driver.h +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_driver.h @@ -42,6 +42,7 @@ struct nv50_ir_varying unsigned mask : 4; /* vec4 mask */ unsigned linear : 1; /* linearly interpolated if true (and not flat) */ unsigned flat : 1; + unsigned sc : 1; /* special colour interpolation mode (SHADE_MODEL) */ unsigned centroid : 1; unsigned patch : 1; /* patch constant value */ unsigned regular : 1; /* driver-specific meaning (e.g. input in sreg) */ diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp index c104dbe9670..3fb679b29de 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp @@ -817,9 +817,11 @@ bool Source::scanDeclaration(const struct tgsi_full_declaration *decl) case TGSI_INTERPOLATE_CONSTANT: info->in[i].flat = 1; break; + case TGSI_INTERPOLATE_COLOR: + info->in[i].sc = 1; + break; case TGSI_INTERPOLATE_LINEAR: - if (sn != TGSI_SEMANTIC_COLOR) // GL_NICEST - info->in[i].linear = 1; + info->in[i].linear = 1; break; default: break; @@ -1141,7 +1143,7 @@ Converter::makeSym(uint tgsiFile, int fileIdx, int idx, int c, uint32_t address) static inline uint8_t translateInterpMode(const struct nv50_ir_varying *var, operation& op) { - uint8_t mode; + uint8_t mode = NV50_IR_INTERP_PERSPECTIVE; if (var->flat) mode = NV50_IR_INTERP_FLAT; @@ -1149,9 +1151,11 @@ translateInterpMode(const struct nv50_ir_varying *var, operation& op) if (var->linear) mode = NV50_IR_INTERP_LINEAR; else - mode = NV50_IR_INTERP_PERSPECTIVE; + if (var->sc) + mode = NV50_IR_INTERP_SC; - op = (mode == NV50_IR_INTERP_PERSPECTIVE) ? OP_PINTERP : OP_LINTERP; + op = (mode == NV50_IR_INTERP_PERSPECTIVE || mode == NV50_IR_INTERP_SC) + ? OP_PINTERP : OP_LINTERP; if (var->centroid) mode |= NV50_IR_INTERP_CENTROID; |