diff options
author | Michel Dänzer <[email protected]> | 2012-06-08 17:15:21 +0200 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2012-06-12 18:48:28 +0200 |
commit | 90c6eacdb4927e6395743d69e5efa0a3a0aec7cc (patch) | |
tree | 65df6e34ca093de38186a4c3941b00982ac22e47 /src | |
parent | 4c418cf1a37f824676bcc0454fcc4cf6916e0fdd (diff) |
radeonsi: Use linear instead of constant interpolation for now.
Constant interpolation still hangs the GPU for some reason.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/radeonsi/evergreen_state.c | 18 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/radeonsi_shader.c | 8 |
2 files changed, 22 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/evergreen_state.c b/src/gallium/drivers/radeonsi/evergreen_state.c index c7bd6c1fe25..9c45719c750 100644 --- a/src/gallium/drivers/radeonsi/evergreen_state.c +++ b/src/gallium/drivers/radeonsi/evergreen_state.c @@ -1058,7 +1058,8 @@ static void *evergreen_create_rs_state(struct pipe_context *ctx, rs->offset_scale = state->offset_scale * 12.0f; rstate->id = R600_PIPE_STATE_RASTERIZER; - tmp = S_0286D4_FLAT_SHADE_ENA(state->flatshade); + /* XXX: Flat shading hangs the GPU */ + tmp = S_0286D4_FLAT_SHADE_ENA(0); if (state->sprite_coord_enable) { tmp |= S_0286D4_PNT_SPRITE_ENA(1) | S_0286D4_PNT_SPRITE_OVRD_X(V_0286D4_SPI_PNT_SPRITE_SEL_S) | @@ -2032,6 +2033,11 @@ void si_pipe_shader_ps(struct pipe_context *ctx, struct si_pipe_shader *shader) db_shader_control = S_02880C_Z_ORDER(V_02880C_EARLY_Z_THEN_LATE_Z); for (i = 0; i < rshader->ninput; i++) { ninterp++; + /* XXX: Flat shading hangs the GPU */ + if (rshader->input[i].interpolate == TGSI_INTERPOLATE_CONSTANT || + (rshader->input[i].interpolate == TGSI_INTERPOLATE_COLOR && + rctx->rasterizer->flatshade)) + have_linear = TRUE; if (rshader->input[i].interpolate == TGSI_INTERPOLATE_LINEAR) have_linear = TRUE; if (rshader->input[i].interpolate == TGSI_INTERPOLATE_PERSPECTIVE) @@ -2224,11 +2230,15 @@ void si_update_spi_map(struct r600_context *rctx) for (i = 0; i < ps->ninput; i++) { tmp = 0; - if (ps->input[i].name == TGSI_SEMANTIC_COLOR || - ps->input[i].name == TGSI_SEMANTIC_BCOLOR || - ps->input[i].name == TGSI_SEMANTIC_POSITION) { +#if 0 + /* XXX: Flat shading hangs the GPU */ + if (ps->input[i].name == TGSI_SEMANTIC_POSITION || + ps->input[i].interpolate == TGSI_INTERPOLATE_CONSTANT || + (ps->input[i].interpolate == TGSI_INTERPOLATE_COLOR && + rctx->rasterizer && rctx->rasterizer->flatshade)) { tmp |= S_028644_FLAT_SHADE(1); } +#endif if (ps->input[i].name == TGSI_SEMANTIC_GENERIC && rctx->sprite_coord_enable & (1 << ps->input[i].sid)) { diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c index 0a4f04bdb12..d0820b80302 100644 --- a/src/gallium/drivers/radeonsi/radeonsi_shader.c +++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c @@ -250,8 +250,13 @@ static void declare_input_fs( /* XXX: Handle all possible interpolation modes */ switch (decl->Interp.Interpolate) { case TGSI_INTERPOLATE_COLOR: + /* XXX: Flat shading hangs the GPU */ if (si_shader_ctx->rctx->rasterizer->flatshade) { +#if 0 intr_name = "llvm.SI.fs.interp.constant"; +#else + intr_name = "llvm.SI.fs.interp.linear.center"; +#endif } else { if (decl->Interp.Centroid) intr_name = "llvm.SI.fs.interp.persp.centroid"; @@ -260,8 +265,11 @@ static void declare_input_fs( } break; case TGSI_INTERPOLATE_CONSTANT: + /* XXX: Flat shading hangs the GPU */ +#if 0 intr_name = "llvm.SI.fs.interp.constant"; break; +#endif case TGSI_INTERPOLATE_LINEAR: if (decl->Interp.Centroid) intr_name = "llvm.SI.fs.interp.linear.centroid"; |