diff options
author | Jerome Glisse <[email protected]> | 2010-08-20 17:57:38 +0200 |
---|---|---|
committer | Jerome Glisse <[email protected]> | 2010-08-20 18:54:26 +0200 |
commit | 921c987c6f43b4d63a98b61013d43bac97baff21 (patch) | |
tree | 9cfa490978f422c17fb39ec8bb6cebdd0a31f4ee /src/gallium/drivers/r600/r600_state.c | |
parent | a43a2f0662c4aa33b50882411181252198819942 (diff) |
r600g: cleanup definition, fix segfault when no valid pixel shader
Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_state.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 3943ebacb36..93fc68e42ef 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -980,15 +980,19 @@ static struct radeon_state *r600_dsa(struct r600_context *rctx) struct r600_screen *rscreen = rctx->screen; unsigned db_depth_control, alpha_test_control, alpha_ref, db_shader_control; unsigned stencil_ref_mask, stencil_ref_mask_bf; - struct r600_shader *rshader = &rctx->ps_shader->shader; + struct r600_shader *rshader; struct radeon_state *rstate; int i; + if (rctx->ps_shader == NULL) { + return NULL; + } rstate = radeon_state(rscreen->rw, R600_DSA_TYPE, R600_DSA); if (rstate == NULL) return NULL; db_shader_control = 0x210; + rshader = &rctx->ps_shader->shader; for (i = 0; i < rshader->noutput; i++) { if (rshader->output[i].name == TGSI_SEMANTIC_POSITION) db_shader_control |= 1; |