summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr/swr_shader.cpp
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-11-20 21:20:08 -0500
committerIlia Mirkin <[email protected]>2016-11-22 20:27:20 -0500
commitf6f644ea128f38bdf24fe7e832cdabc18cfdfb0c (patch)
tree6f09f6947e0a41a49618ce969a0407d6218dbf12 /src/gallium/drivers/swr/swr_shader.cpp
parent7cbfe59cf3432ae643837c3534c77aa034c36ca6 (diff)
swr: color interpolation is also supposed to get perspective division
Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Tim Rowley <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_shader.cpp')
-rw-r--r--src/gallium/drivers/swr/swr_shader.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/swr_shader.cpp b/src/gallium/drivers/swr/swr_shader.cpp
index 428c9b3265d..294a5686645 100644
--- a/src/gallium/drivers/swr/swr_shader.cpp
+++ b/src/gallium/drivers/swr/swr_shader.cpp
@@ -457,7 +457,8 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
// load/compute w
Value *vw = nullptr, *pAttribs;
- if (interpMode == TGSI_INTERPOLATE_PERSPECTIVE) {
+ if (interpMode == TGSI_INTERPOLATE_PERSPECTIVE ||
+ interpMode == TGSI_INTERPOLATE_COLOR) {
pAttribs = pPerspAttribs;
switch (interpLoc) {
case TGSI_INTERPOLATE_LOC_CENTER:
@@ -596,7 +597,8 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
Value *interp1 = FMUL(vb, vj);
interp = FADD(interp, interp1);
interp = FADD(interp, vc);
- if (interpMode == TGSI_INTERPOLATE_PERSPECTIVE)
+ if (interpMode == TGSI_INTERPOLATE_PERSPECTIVE ||
+ interpMode == TGSI_INTERPOLATE_COLOR)
interp = FMUL(interp, vw);
inputs[attrib][channel] = wrap(interp);
}