mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 07:58:07 +02:00
mesa/st: fix _BlendForceAlphaToOneDraw bitfield use
Previously we were assuming that all color attachments were active.
Fixes: 4f28e2827c ("mesa: fix blending when using luminance/intensity emulation")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35014>
This commit is contained in:
parent
d04d9da98c
commit
c1d00c9a1a
3 changed files with 7 additions and 6 deletions
|
|
@ -760,6 +760,9 @@ _mesa_update_drawbuffer_masks(struct gl_context *ctx,
|
|||
{
|
||||
update_drawbuffer_mask(ctx, fb, &ctx->DrawBuffer->_IntegerBuffers,
|
||||
&ctx->DrawBuffer->_IntegerDrawBuffers);
|
||||
update_drawbuffer_mask(ctx, fb, &ctx->DrawBuffer->_BlendForceAlphaToOne,
|
||||
&ctx->DrawBuffer->_BlendForceAlphaToOneDraw);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2693,7 +2693,8 @@ struct gl_framebuffer
|
|||
|
||||
GLbitfield _IntegerBuffers; /**< Which color buffer attachments are integer valued */
|
||||
GLbitfield _IntegerDrawBuffers; /**< Which color draw buffers are integer valued */
|
||||
GLbitfield _BlendForceAlphaToOne; /**< Which color buffers need blend factor adjustment */
|
||||
GLbitfield _BlendForceAlphaToOne; /**< Which color attachments need blend factor adjustment */
|
||||
GLbitfield _BlendForceAlphaToOneDraw; /**< Which color buffers need blend factor adjustment */
|
||||
GLbitfield _IsRGB; /**< Which color buffers have an RGB base format? */
|
||||
GLbitfield _FP32Buffers; /**< Which color buffers are FP32 */
|
||||
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ blend_per_rt(const struct st_context *st, unsigned num_cb)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
if (ctx->DrawBuffer->_BlendForceAlphaToOne) {
|
||||
if (ctx->DrawBuffer->_BlendForceAlphaToOneDraw) {
|
||||
/* Overriding requires independent blend functions (not just enables),
|
||||
* requiring drivers to expose pipe_caps.indep_blend_func.
|
||||
*/
|
||||
|
|
@ -320,10 +320,7 @@ st_update_blend( struct st_context *st )
|
|||
translate_blend(ctx->Color.Blend[j].DstA);
|
||||
}
|
||||
|
||||
const struct gl_renderbuffer *rb =
|
||||
ctx->DrawBuffer->_ColorDrawBuffers[i];
|
||||
|
||||
if (rb && (ctx->DrawBuffer->_BlendForceAlphaToOne & (1 << i))) {
|
||||
if (ctx->DrawBuffer->_BlendForceAlphaToOneDraw & (1 << i)) {
|
||||
struct pipe_rt_blend_state *rt = &blend->rt[i];
|
||||
rt->rgb_src_factor = fix_xrgb_alpha(rt->rgb_src_factor);
|
||||
rt->rgb_dst_factor = fix_xrgb_alpha(rt->rgb_dst_factor);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue