diff options
author | Marek Olšák <[email protected]> | 2013-09-23 21:41:34 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-09-25 20:45:22 +0200 |
commit | f9ea435ebc9360e186e44fc4e9c155dc073fe8ac (patch) | |
tree | 6df078a819a2025430188d5ac9d1ddec36e39588 /src/gallium/drivers | |
parent | f7d004b9ad0deec99d465600ed7df683146b6cd7 (diff) |
radeonsi: bypass alpha-test for integer colorbuffers
Fixes spec/EXT_texture_integer/fbo-blending.
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 8f7edafcf35..b5d625aa7a3 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -2352,7 +2352,16 @@ static INLINE void si_shader_selector_key(struct pipe_context *ctx, } if (rctx->queued.named.dsa) { key->ps.alpha_func = rctx->queued.named.dsa->alpha_func; - key->ps.alpha_ref = rctx->queued.named.dsa->alpha_ref; + + /* Alpha-test should be disabled if colorbuffer 0 is integer. */ + if (rctx->framebuffer.nr_cbufs && + rctx->framebuffer.cbufs[0] && + util_format_is_pure_integer(rctx->framebuffer.cbufs[0]->texture->format)) + key->ps.alpha_func = PIPE_FUNC_ALWAYS; + + if (key->ps.alpha_func != PIPE_FUNC_ALWAYS && + key->ps.alpha_func != PIPE_FUNC_NEVER) + key->ps.alpha_ref = rctx->queued.named.dsa->alpha_ref; } else { key->ps.alpha_func = PIPE_FUNC_ALWAYS; } |