diff options
author | Michel Dänzer <[email protected]> | 2012-05-14 16:26:19 +0200 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2012-05-14 17:56:03 +0200 |
commit | 1deb2be2b7887d7435e103fdb042857e745ff08d (patch) | |
tree | 6da92504a34b30ab80039237add37b6785465f3e /src/gallium/drivers/radeonsi | |
parent | de52a56a0ecb6a36badaf91381d638c31cbd3165 (diff) |
radeonsi: Flesh out shader interpolation related code.
Handle perspective interpolation and ceontroid vs. center.
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/radeonsi_shader.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c index 0e1a97bba3e..396b94ad357 100644 --- a/src/gallium/drivers/radeonsi/radeonsi_shader.c +++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c @@ -201,16 +201,29 @@ static void declare_input_fs( /* XXX: Handle all possible interpolation modes */ switch (decl->Interp.Interpolate) { case TGSI_INTERPOLATE_COLOR: - if (si_shader_ctx->rctx->rasterizer->flatshade) + if (si_shader_ctx->rctx->rasterizer->flatshade) { intr_name = "llvm.SI.fs.interp.constant"; - else - intr_name = "llvm.SI.fs.interp.linear.center"; + } else { + if (decl->Interp.Centroid) + intr_name = "llvm.SI.fs.interp.persp.centroid"; + else + intr_name = "llvm.SI.fs.interp.persp.center"; + } break; case TGSI_INTERPOLATE_CONSTANT: intr_name = "llvm.SI.fs.interp.constant"; break; case TGSI_INTERPOLATE_LINEAR: - intr_name = "llvm.SI.fs.interp.linear.center"; + if (decl->Interp.Centroid) + intr_name = "llvm.SI.fs.interp.linear.centroid"; + else + intr_name = "llvm.SI.fs.interp.linear.center"; + break; + case TGSI_INTERPOLATE_PERSPECTIVE: + if (decl->Interp.Centroid) + intr_name = "llvm.SI.fs.interp.persp.centroid"; + else + intr_name = "llvm.SI.fs.interp.persp.center"; break; default: fprintf(stderr, "Warning: Unhandled interpolation mode.\n"); |