diff options
author | Brian Paul <[email protected]> | 2011-01-11 15:07:38 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-01-15 18:35:39 -0700 |
commit | 74713e2d293f9e796a4053a5a99ee5cb7df5c740 (patch) | |
tree | 0c3ad404ba3a090e53801f93b1cd0649370cead2 /src/mesa/drivers | |
parent | 3dab2b1795e9f9ff3584f612397d118459b12731 (diff) |
mesa: begin implementation of GL_ARB_draw_buffers_blend
Diffstat (limited to 'src/mesa/drivers')
20 files changed, 117 insertions, 116 deletions
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index fc67bee98c6..3c6ecb83f0a 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -231,13 +231,14 @@ _mesa_init_driver_state(struct gl_context *ctx) ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor); ctx->Driver.BlendEquationSeparate(ctx, - ctx->Color.BlendEquationRGB, - ctx->Color.BlendEquationA); + ctx->Color.Blend[0].EquationRGB, + ctx->Color.Blend[0].EquationA); ctx->Driver.BlendFuncSeparate(ctx, - ctx->Color.BlendSrcRGB, - ctx->Color.BlendDstRGB, - ctx->Color.BlendSrcA, ctx->Color.BlendDstA); + ctx->Color.Blend[0].SrcRGB, + ctx->Color.Blend[0].DstRGB, + ctx->Color.Blend[0].SrcA, + ctx->Color.Blend[0].DstA); if (ctx->Driver.ColorMaskIndexed) { GLuint i; diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c index 7c3fbb1424d..6040abf7fac 100644 --- a/src/mesa/drivers/dri/i810/i810state.c +++ b/src/mesa/drivers/dri/i810/i810state.c @@ -95,7 +95,7 @@ static void i810BlendFuncSeparate( struct gl_context *ctx, GLenum sfactorRGB, GLuint a = SDM_UPDATE_SRC_BLEND | SDM_UPDATE_DST_BLEND; GLboolean fallback = GL_FALSE; - switch (ctx->Color.BlendSrcRGB) { + switch (ctx->Color.Blend[0].SrcRGB) { case GL_ZERO: a |= SDM_SRC_ZERO; break; case GL_ONE: a |= SDM_SRC_ONE; break; case GL_SRC_COLOR: a |= SDM_SRC_SRC_COLOR; break; @@ -124,7 +124,7 @@ static void i810BlendFuncSeparate( struct gl_context *ctx, GLenum sfactorRGB, return; } - switch (ctx->Color.BlendDstRGB) { + switch (ctx->Color.Blend[0].DstRGB) { case GL_ZERO: a |= SDM_DST_ZERO; break; case GL_ONE: a |= SDM_DST_ONE; break; case GL_SRC_COLOR: a |= SDM_DST_SRC_COLOR; break; diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c index 147192adc7a..ef5b8d971da 100644 --- a/src/mesa/drivers/dri/i915/i830_state.c +++ b/src/mesa/drivers/dri/i915/i830_state.c @@ -291,10 +291,10 @@ i830_set_blend_state(struct gl_context * ctx) funcRGB = - SRC_BLND_FACT(intel_translate_blend_factor(ctx->Color.BlendSrcRGB)) - | DST_BLND_FACT(intel_translate_blend_factor(ctx->Color.BlendDstRGB)); + SRC_BLND_FACT(intel_translate_blend_factor(ctx->Color.Blend[0].SrcRGB)) + | DST_BLND_FACT(intel_translate_blend_factor(ctx->Color.Blend[0].DstRGB)); - switch (ctx->Color.BlendEquationRGB) { + switch (ctx->Color.Blend[0].EquationRGB) { case GL_FUNC_ADD: eqnRGB = BLENDFUNC_ADD; break; @@ -314,15 +314,15 @@ i830_set_blend_state(struct gl_context * ctx) break; default: fprintf(stderr, "[%s:%u] Invalid RGB blend equation (0x%04x).\n", - __FUNCTION__, __LINE__, ctx->Color.BlendEquationRGB); + __FUNCTION__, __LINE__, ctx->Color.Blend[0].EquationRGB); return; } - funcA = SRC_ABLEND_FACT(intel_translate_blend_factor(ctx->Color.BlendSrcA)) - | DST_ABLEND_FACT(intel_translate_blend_factor(ctx->Color.BlendDstA)); + funcA = SRC_ABLEND_FACT(intel_translate_blend_factor(ctx->Color.Blend[0].SrcA)) + | DST_ABLEND_FACT(intel_translate_blend_factor(ctx->Color.Blend[0].DstA)); - switch (ctx->Color.BlendEquationA) { + switch (ctx->Color.Blend[0].EquationA) { case GL_FUNC_ADD: eqnA = BLENDFUNC_ADD; break; @@ -342,7 +342,7 @@ i830_set_blend_state(struct gl_context * ctx) break; default: fprintf(stderr, "[%s:%u] Invalid alpha blend equation (0x%04x).\n", - __FUNCTION__, __LINE__, ctx->Color.BlendEquationA); + __FUNCTION__, __LINE__, ctx->Color.Blend[0].EquationA); return; } diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index 9508fbaf942..63c6e78ebe9 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -267,12 +267,12 @@ i915UpdateBlendState(struct gl_context * ctx) ~(S6_CBUF_SRC_BLEND_FACT_MASK | S6_CBUF_DST_BLEND_FACT_MASK | S6_CBUF_BLEND_FUNC_MASK)); - GLuint eqRGB = ctx->Color.BlendEquationRGB; - GLuint eqA = ctx->Color.BlendEquationA; - GLuint srcRGB = ctx->Color.BlendSrcRGB; - GLuint dstRGB = ctx->Color.BlendDstRGB; - GLuint srcA = ctx->Color.BlendSrcA; - GLuint dstA = ctx->Color.BlendDstA; + GLuint eqRGB = ctx->Color.Blend[0].EquationRGB; + GLuint eqA = ctx->Color.Blend[0].EquationA; + GLuint srcRGB = ctx->Color.Blend[0].SrcRGB; + GLuint dstRGB = ctx->Color.Blend[0].DstRGB; + GLuint srcA = ctx->Color.Blend[0].SrcA; + GLuint dstA = ctx->Color.Blend[0].DstA; if (eqRGB == GL_MIN || eqRGB == GL_MAX) { srcRGB = dstRGB = GL_ONE; diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index d286c9dbdc7..c986970a757 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -141,12 +141,12 @@ static void upload_cc_unit(struct brw_context *brw) cc.cc2.logicop_enable = 1; cc.cc5.logicop_func = intel_translate_logic_op(ctx->Color.LogicOp); } else if (ctx->Color.BlendEnabled) { - GLenum eqRGB = ctx->Color.BlendEquationRGB; - GLenum eqA = ctx->Color.BlendEquationA; - GLenum srcRGB = ctx->Color.BlendSrcRGB; - GLenum dstRGB = ctx->Color.BlendDstRGB; - GLenum srcA = ctx->Color.BlendSrcA; - GLenum dstA = ctx->Color.BlendDstA; + GLenum eqRGB = ctx->Color.Blend[0].EquationRGB; + GLenum eqA = ctx->Color.Blend[0].EquationA; + GLenum srcRGB = ctx->Color.Blend[0].SrcRGB; + GLenum dstRGB = ctx->Color.Blend[0].DstRGB; + GLenum srcA = ctx->Color.Blend[0].SrcA; + GLenum dstA = ctx->Color.Blend[0].DstA; /* If the renderbuffer is XRGB, we have to frob the blend function to * force the destination alpha to 1.0. This means replacing GL_DST_ALPHA diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c index dbcdc5b8693..f51afa40716 100644 --- a/src/mesa/drivers/dri/i965/gen6_cc.c +++ b/src/mesa/drivers/dri/i965/gen6_cc.c @@ -66,12 +66,12 @@ blend_state_populate_key(struct brw_context *brw, /* _NEW_COLOR */ key->color_blend = ctx->Color.BlendEnabled; if (key->color_blend) { - key->blend_eq_rgb = ctx->Color.BlendEquationRGB; - key->blend_eq_a = ctx->Color.BlendEquationA; - key->blend_src_rgb = ctx->Color.BlendSrcRGB; - key->blend_dst_rgb = ctx->Color.BlendDstRGB; - key->blend_src_a = ctx->Color.BlendSrcA; - key->blend_dst_a = ctx->Color.BlendDstA; + key->blend_eq_rgb = ctx->Color.Blend[0].EquationRGB; + key->blend_eq_a = ctx->Color.Blend[0].EquationA; + key->blend_src_rgb = ctx->Color.Blend[0].SrcRGB; + key->blend_dst_rgb = ctx->Color.Blend[0].DstRGB; + key->blend_src_a = ctx->Color.Blend[0].SrcA; + key->blend_dst_a = ctx->Color.Blend[0].DstA; } /* _NEW_COLOR */ diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index d5c35775ce4..f97256e59bb 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -66,12 +66,12 @@ intel_check_blit_fragment_ops(struct gl_context * ctx, GLboolean src_alpha_is_on } if (ctx->Color.BlendEnabled && - (effective_func(ctx->Color.BlendSrcRGB, src_alpha_is_one) != GL_ONE || - effective_func(ctx->Color.BlendDstRGB, src_alpha_is_one) != GL_ZERO || - ctx->Color.BlendEquationRGB != GL_FUNC_ADD || - effective_func(ctx->Color.BlendSrcA, src_alpha_is_one) != GL_ONE || - effective_func(ctx->Color.BlendDstA, src_alpha_is_one) != GL_ZERO || - ctx->Color.BlendEquationA != GL_FUNC_ADD)) { + (effective_func(ctx->Color.Blend[0].SrcRGB, src_alpha_is_one) != GL_ONE || + effective_func(ctx->Color.Blend[0].DstRGB, src_alpha_is_one) != GL_ZERO || + ctx->Color.Blend[0].EquationRGB != GL_FUNC_ADD || + effective_func(ctx->Color.Blend[0].SrcA, src_alpha_is_one) != GL_ONE || + effective_func(ctx->Color.Blend[0].DstA, src_alpha_is_one) != GL_ZERO || + ctx->Color.Blend[0].EquationA != GL_FUNC_ADD)) { DBG("fallback due to blend\n"); return GL_FALSE; } diff --git a/src/mesa/drivers/dri/mach64/mach64_state.c b/src/mesa/drivers/dri/mach64/mach64_state.c index 8e795955c2c..c1a4e63204f 100644 --- a/src/mesa/drivers/dri/mach64/mach64_state.c +++ b/src/mesa/drivers/dri/mach64/mach64_state.c @@ -102,7 +102,7 @@ static void mach64UpdateAlphaMode( struct gl_context *ctx ) MACH64_ALPHA_BLEND_DST_MASK | MACH64_ALPHA_BLEND_SAT); - switch ( ctx->Color.BlendSrcRGB ) { + switch ( ctx->Color.Blend[0].SrcRGB ) { case GL_ZERO: s |= MACH64_ALPHA_BLEND_SRC_ZERO; break; @@ -135,7 +135,7 @@ static void mach64UpdateAlphaMode( struct gl_context *ctx ) FALLBACK( mmesa, MACH64_FALLBACK_BLEND_FUNC, GL_TRUE ); } - switch ( ctx->Color.BlendDstRGB ) { + switch ( ctx->Color.Blend[0].DstRGB ) { case GL_ZERO: s |= MACH64_ALPHA_BLEND_DST_ZERO; break; diff --git a/src/mesa/drivers/dri/mga/mgastate.c b/src/mesa/drivers/dri/mga/mgastate.c index 25d7de28fe8..2fac2b49cd2 100644 --- a/src/mesa/drivers/dri/mga/mgastate.c +++ b/src/mesa/drivers/dri/mga/mgastate.c @@ -141,7 +141,7 @@ static void mgaDDBlendFuncSeparate( struct gl_context *ctx, GLenum sfactorRGB, GLuint src; GLuint dst; - switch (ctx->Color.BlendSrcRGB) { + switch (ctx->Color.Blend[0].SrcRGB) { case GL_ZERO: src = AC_src_zero; break; case GL_SRC_ALPHA: @@ -169,7 +169,7 @@ static void mgaDDBlendFuncSeparate( struct gl_context *ctx, GLenum sfactorRGB, break; } - switch (ctx->Color.BlendDstRGB) { + switch (ctx->Color.Blend[0].DstRGB) { case GL_SRC_ALPHA: dst = AC_dst_src_alpha; break; case GL_ONE_MINUS_SRC_ALPHA: diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c index 98f2f98f1d0..ecfbdfedff6 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c @@ -264,8 +264,8 @@ nv04_emit_blend(struct gl_context *ctx, int emit) NV04_MULTITEX_TRIANGLE_BLEND_TEXTURE_PERSPECTIVE_ENABLE; /* Alpha blending. */ - blend |= get_blend_func(ctx->Color.BlendDstRGB) << 28 | - get_blend_func(ctx->Color.BlendSrcRGB) << 24; + blend |= get_blend_func(ctx->Color.Blend[0].DstRGB) << 28 | + get_blend_func(ctx->Color.Blend[0].SrcRGB) << 24; if (ctx->Color.BlendEnabled) blend |= NV04_MULTITEX_TRIANGLE_BLEND_BLEND_ENABLE; @@ -296,8 +296,8 @@ nv04_emit_blend(struct gl_context *ctx, int emit) NV04_TEXTURED_TRIANGLE_BLEND_TEXTURE_PERSPECTIVE_ENABLE; /* Alpha blending. */ - blend |= get_blend_func(ctx->Color.BlendDstRGB) << 28 | - get_blend_func(ctx->Color.BlendSrcRGB) << 24; + blend |= get_blend_func(ctx->Color.Blend[0].DstRGB) << 28 | + get_blend_func(ctx->Color.Blend[0].SrcRGB) << 24; if (ctx->Color.BlendEnabled) blend |= NV04_TEXTURED_TRIANGLE_BLEND_BLEND_ENABLE; diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c index bb1084ed11b..50021b0a7bf 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c @@ -68,7 +68,7 @@ nv10_emit_blend_equation(struct gl_context *ctx, int emit) OUT_RINGb(chan, ctx->Color.BlendEnabled); BEGIN_RING(chan, celsius, NV10_3D_BLEND_EQUATION, 1); - OUT_RING(chan, nvgl_blend_eqn(ctx->Color.BlendEquationRGB)); + OUT_RING(chan, nvgl_blend_eqn(ctx->Color.Blend[0].EquationRGB)); } void @@ -78,8 +78,8 @@ nv10_emit_blend_func(struct gl_context *ctx, int emit) struct nouveau_grobj *celsius = context_eng3d(ctx); BEGIN_RING(chan, celsius, NV10_3D_BLEND_FUNC_SRC, 2); - OUT_RING(chan, nvgl_blend_func(ctx->Color.BlendSrcRGB)); - OUT_RING(chan, nvgl_blend_func(ctx->Color.BlendDstRGB)); + OUT_RING(chan, nvgl_blend_func(ctx->Color.Blend[0].SrcRGB)); + OUT_RING(chan, nvgl_blend_func(ctx->Color.Blend[0].DstRGB)); } void diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c index 4a49e8fc70f..d6725cdd0ec 100644 --- a/src/mesa/drivers/dri/r128/r128_state.c +++ b/src/mesa/drivers/dri/r128/r128_state.c @@ -178,12 +178,12 @@ static void r128UpdateAlphaMode( struct gl_context *ctx ) (R128_ALPHA_BLEND_MASK << R128_ALPHA_BLEND_DST_SHIFT) | R128_ALPHA_COMB_FCN_MASK); - a |= blend_factor( rmesa, ctx->Color.BlendSrcRGB, GL_TRUE ) + a |= blend_factor( rmesa, ctx->Color.Blend[0].SrcRGB, GL_TRUE ) << R128_ALPHA_BLEND_SRC_SHIFT; - a |= blend_factor( rmesa, ctx->Color.BlendDstRGB, GL_FALSE ) + a |= blend_factor( rmesa, ctx->Color.Blend[0].DstRGB, GL_FALSE ) << R128_ALPHA_BLEND_DST_SHIFT; - switch (ctx->Color.BlendEquationRGB) { + switch (ctx->Color.Blend[0].EquationRGB) { case GL_FUNC_ADD: a |= R128_ALPHA_COMB_ADD_CLAMP; break; diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index b523edcb5d9..0a1e0b47577 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -245,10 +245,10 @@ static void r200_set_blend_state( struct gl_context * ctx ) } } - func = (blend_factor( ctx->Color.BlendSrcRGB, GL_TRUE ) << R200_SRC_BLEND_SHIFT) | - (blend_factor( ctx->Color.BlendDstRGB, GL_FALSE ) << R200_DST_BLEND_SHIFT); + func = (blend_factor( ctx->Color.Blend[0].SrcRGB, GL_TRUE ) << R200_SRC_BLEND_SHIFT) | + (blend_factor( ctx->Color.Blend[0].DstRGB, GL_FALSE ) << R200_DST_BLEND_SHIFT); - switch(ctx->Color.BlendEquationRGB) { + switch(ctx->Color.Blend[0].EquationRGB) { case GL_FUNC_ADD: eqn = R200_COMB_FCN_ADD_CLAMP; break; @@ -275,7 +275,7 @@ static void r200_set_blend_state( struct gl_context * ctx ) default: fprintf( stderr, "[%s:%u] Invalid RGB blend equation (0x%04x).\n", - __FUNCTION__, __LINE__, ctx->Color.BlendEquationRGB ); + __FUNCTION__, __LINE__, ctx->Color.Blend[0].EquationRGB ); return; } @@ -284,10 +284,10 @@ static void r200_set_blend_state( struct gl_context * ctx ) return; } - funcA = (blend_factor( ctx->Color.BlendSrcA, GL_TRUE ) << R200_SRC_BLEND_SHIFT) | - (blend_factor( ctx->Color.BlendDstA, GL_FALSE ) << R200_DST_BLEND_SHIFT); + funcA = (blend_factor( ctx->Color.Blend[0].SrcA, GL_TRUE ) << R200_SRC_BLEND_SHIFT) | + (blend_factor( ctx->Color.Blend[0].DstA, GL_FALSE ) << R200_DST_BLEND_SHIFT); - switch(ctx->Color.BlendEquationA) { + switch(ctx->Color.Blend[0].EquationA) { case GL_FUNC_ADD: eqnA = R200_COMB_FCN_ADD_CLAMP; break; @@ -314,7 +314,7 @@ static void r200_set_blend_state( struct gl_context * ctx ) default: fprintf( stderr, "[%s:%u] Invalid A blend equation (0x%04x).\n", - __FUNCTION__, __LINE__, ctx->Color.BlendEquationA ); + __FUNCTION__, __LINE__, ctx->Color.Blend[0].EquationA ); return; } diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index ab8c1df5f74..9df9101bcd3 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -220,12 +220,12 @@ static void r300SetBlendState(struct gl_context * ctx) } func = - (blend_factor(ctx->Color.BlendSrcRGB, GL_TRUE) << - R300_SRC_BLEND_SHIFT) | (blend_factor(ctx->Color.BlendDstRGB, + (blend_factor(ctx->Color.Blend[0].SrcRGB, GL_TRUE) << + R300_SRC_BLEND_SHIFT) | (blend_factor(ctx->Color.Blend[0].DstRGB, GL_FALSE) << R300_DST_BLEND_SHIFT); - switch (ctx->Color.BlendEquationRGB) { + switch (ctx->Color.Blend[0].EquationRGB) { case GL_FUNC_ADD: eqn = R300_COMB_FCN_ADD_CLAMP; break; @@ -253,17 +253,17 @@ static void r300SetBlendState(struct gl_context * ctx) default: fprintf(stderr, "[%s:%u] Invalid RGB blend equation (0x%04x).\n", - __FUNCTION__, __LINE__, ctx->Color.BlendEquationRGB); + __FUNCTION__, __LINE__, ctx->Color.Blend[0].EquationRGB); return; } funcA = - (blend_factor(ctx->Color.BlendSrcA, GL_TRUE) << - R300_SRC_BLEND_SHIFT) | (blend_factor(ctx->Color.BlendDstA, + (blend_factor(ctx->Color.Blend[0].SrcA, GL_TRUE) << + R300_SRC_BLEND_SHIFT) | (blend_factor(ctx->Color.Blend[0].DstA, GL_FALSE) << R300_DST_BLEND_SHIFT); - switch (ctx->Color.BlendEquationA) { + switch (ctx->Color.Blend[0].EquationA) { case GL_FUNC_ADD: eqnA = R300_COMB_FCN_ADD_CLAMP; break; @@ -291,7 +291,7 @@ static void r300SetBlendState(struct gl_context * ctx) default: fprintf(stderr, "[%s:%u] Invalid A blend equation (0x%04x).\n", - __FUNCTION__, __LINE__, ctx->Color.BlendEquationA); + __FUNCTION__, __LINE__, ctx->Color.Blend[0].EquationA); return; } diff --git a/src/mesa/drivers/dri/r600/evergreen_state.c b/src/mesa/drivers/dri/r600/evergreen_state.c index 648cda0078e..006e50007b6 100644 --- a/src/mesa/drivers/dri/r600/evergreen_state.c +++ b/src/mesa/drivers/dri/r600/evergreen_state.c @@ -363,13 +363,13 @@ static void evergreenSetBlendState(struct gl_context * ctx) //diff : CB_COLOR_CO } SETfield(blend_reg, - evergreenblend_factor(ctx->Color.BlendSrcRGB, GL_TRUE), + evergreenblend_factor(ctx->Color.Blend[0].SrcRGB, GL_TRUE), COLOR_SRCBLEND_shift, COLOR_SRCBLEND_mask); SETfield(blend_reg, - evergreenblend_factor(ctx->Color.BlendDstRGB, GL_FALSE), + evergreenblend_factor(ctx->Color.Blend[0].DstRGB, GL_FALSE), COLOR_DESTBLEND_shift, COLOR_DESTBLEND_mask); - switch (ctx->Color.BlendEquationRGB) { + switch (ctx->Color.Blend[0].EquationRGB) { case GL_FUNC_ADD: eqn = COMB_DST_PLUS_SRC; break; @@ -401,20 +401,20 @@ static void evergreenSetBlendState(struct gl_context * ctx) //diff : CB_COLOR_CO default: fprintf(stderr, "[%s:%u] Invalid RGB blend equation (0x%04x).\n", - __FUNCTION__, __LINE__, ctx->Color.BlendEquationRGB); + __FUNCTION__, __LINE__, ctx->Color.Blend[0].EquationRGB); return; } SETfield(blend_reg, eqn, COLOR_COMB_FCN_shift, COLOR_COMB_FCN_mask); SETfield(blend_reg, - evergreenblend_factor(ctx->Color.BlendSrcA, GL_TRUE), + evergreenblend_factor(ctx->Color.Blend[0].SrcA, GL_TRUE), ALPHA_SRCBLEND_shift, ALPHA_SRCBLEND_mask); SETfield(blend_reg, - evergreenblend_factor(ctx->Color.BlendDstA, GL_FALSE), + evergreenblend_factor(ctx->Color.Blend[0].DstA, GL_FALSE), ALPHA_DESTBLEND_shift, ALPHA_DESTBLEND_mask); - switch (ctx->Color.BlendEquationA) { + switch (ctx->Color.Blend[0].EquationA) { case GL_FUNC_ADD: eqnA = COMB_DST_PLUS_SRC; break; @@ -445,7 +445,7 @@ static void evergreenSetBlendState(struct gl_context * ctx) //diff : CB_COLOR_CO default: fprintf(stderr, "[%s:%u] Invalid A blend equation (0x%04x).\n", - __FUNCTION__, __LINE__, ctx->Color.BlendEquationA); + __FUNCTION__, __LINE__, ctx->Color.Blend[0].EquationA); return; } diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index bd04a633b48..f8770690ff6 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -474,13 +474,13 @@ static void r700SetBlendState(struct gl_context * ctx) } SETfield(blend_reg, - blend_factor(ctx->Color.BlendSrcRGB, GL_TRUE), + blend_factor(ctx->Color.Blend[0].SrcRGB, GL_TRUE), COLOR_SRCBLEND_shift, COLOR_SRCBLEND_mask); SETfield(blend_reg, - blend_factor(ctx->Color.BlendDstRGB, GL_FALSE), + blend_factor(ctx->Color.Blend[0].DstRGB, GL_FALSE), COLOR_DESTBLEND_shift, COLOR_DESTBLEND_mask); - switch (ctx->Color.BlendEquationRGB) { + switch (ctx->Color.Blend[0].EquationRGB) { case GL_FUNC_ADD: eqn = COMB_DST_PLUS_SRC; break; @@ -512,20 +512,20 @@ static void r700SetBlendState(struct gl_context * ctx) default: fprintf(stderr, "[%s:%u] Invalid RGB blend equation (0x%04x).\n", - __FUNCTION__, __LINE__, ctx->Color.BlendEquationRGB); + __FUNCTION__, __LINE__, ctx->Color.Blend[0].EquationRGB); return; } SETfield(blend_reg, eqn, COLOR_COMB_FCN_shift, COLOR_COMB_FCN_mask); SETfield(blend_reg, - blend_factor(ctx->Color.BlendSrcA, GL_TRUE), + blend_factor(ctx->Color.Blend[0].SrcA, GL_TRUE), ALPHA_SRCBLEND_shift, ALPHA_SRCBLEND_mask); SETfield(blend_reg, - blend_factor(ctx->Color.BlendDstA, GL_FALSE), + blend_factor(ctx->Color.Blend[0].DstA, GL_FALSE), ALPHA_DESTBLEND_shift, ALPHA_DESTBLEND_mask); - switch (ctx->Color.BlendEquationA) { + switch (ctx->Color.Blend[0].EquationA) { case GL_FUNC_ADD: eqnA = COMB_DST_PLUS_SRC; break; @@ -556,7 +556,7 @@ static void r700SetBlendState(struct gl_context * ctx) default: fprintf(stderr, "[%s:%u] Invalid A blend equation (0x%04x).\n", - __FUNCTION__, __LINE__, ctx->Color.BlendEquationA); + __FUNCTION__, __LINE__, ctx->Color.Blend[0].EquationA); return; } diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index cae12f192c3..ca42aa39474 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -136,7 +136,7 @@ static void radeonBlendEquationSeparate( struct gl_context *ctx, RADEON_STATECHANGE( rmesa, ctx ); rmesa->hw.ctx.cmd[CTX_RB3D_BLENDCNTL] = b; if ( (ctx->Color.ColorLogicOpEnabled || (ctx->Color.BlendEnabled - && ctx->Color.BlendEquationRGB == GL_LOGIC_OP)) ) { + && ctx->Color.Blend[0].EquationRGB == GL_LOGIC_OP)) ) { rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_ROP_ENABLE; } else { rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ROP_ENABLE; @@ -153,7 +153,7 @@ static void radeonBlendFuncSeparate( struct gl_context *ctx, ~(RADEON_SRC_BLEND_MASK | RADEON_DST_BLEND_MASK); GLboolean fallback = GL_FALSE; - switch ( ctx->Color.BlendSrcRGB ) { + switch ( ctx->Color.Blend[0].SrcRGB ) { case GL_ZERO: b |= RADEON_SRC_BLEND_GL_ZERO; break; @@ -200,7 +200,7 @@ static void radeonBlendFuncSeparate( struct gl_context *ctx, break; } - switch ( ctx->Color.BlendDstRGB ) { + switch ( ctx->Color.Blend[0].DstRGB ) { case GL_ZERO: b |= RADEON_DST_BLEND_GL_ZERO; break; @@ -1602,7 +1602,7 @@ static void radeonEnable( struct gl_context *ctx, GLenum cap, GLboolean state ) rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ALPHA_BLEND_ENABLE; } if ( (ctx->Color.ColorLogicOpEnabled || (ctx->Color.BlendEnabled - && ctx->Color.BlendEquationRGB == GL_LOGIC_OP)) ) { + && ctx->Color.Blend[0].EquationRGB == GL_LOGIC_OP)) ) { rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_ROP_ENABLE; } else { rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ROP_ENABLE; @@ -1612,12 +1612,12 @@ static void radeonEnable( struct gl_context *ctx, GLenum cap, GLboolean state ) */ if (state) { ctx->Driver.BlendEquationSeparate( ctx, - ctx->Color.BlendEquationRGB, - ctx->Color.BlendEquationA ); - ctx->Driver.BlendFuncSeparate( ctx, ctx->Color.BlendSrcRGB, - ctx->Color.BlendDstRGB, - ctx->Color.BlendSrcA, - ctx->Color.BlendDstA ); + ctx->Color.Blend[0].EquationRGB, + ctx->Color.Blend[0].EquationA ); + ctx->Driver.BlendFuncSeparate( ctx, ctx->Color.Blend[0].SrcRGB, + ctx->Color.Blend[0].DstRGB, + ctx->Color.Blend[0].SrcA, + ctx->Color.Blend[0].DstA ); } else { FALLBACK( rmesa, RADEON_FALLBACK_BLEND_FUNC, GL_FALSE ); @@ -1741,7 +1741,7 @@ static void radeonEnable( struct gl_context *ctx, GLenum cap, GLboolean state ) case GL_COLOR_LOGIC_OP: RADEON_STATECHANGE( rmesa, ctx ); if ( (ctx->Color.ColorLogicOpEnabled || (ctx->Color.BlendEnabled - && ctx->Color.BlendEquationRGB == GL_LOGIC_OP)) ) { + && ctx->Color.Blend[0].EquationRGB == GL_LOGIC_OP)) ) { rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] |= RADEON_ROP_ENABLE; } else { rmesa->hw.ctx.cmd[CTX_RB3D_CNTL] &= ~RADEON_ROP_ENABLE; diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c index 0906f85b1fa..1feffa0b0a2 100644 --- a/src/mesa/drivers/dri/savage/savagestate.c +++ b/src/mesa/drivers/dri/savage/savagestate.c @@ -136,7 +136,7 @@ static void savageBlendFunc_s4(struct gl_context *ctx) * blend modes */ if(ctx->Color.BlendEnabled){ - switch (ctx->Color.BlendDstRGB) + switch (ctx->Color.Blend[0].DstRGB) { case GL_ZERO: imesa->regs.s4.drawLocalCtrl.ni.dstAlphaMode = DAM_Zero; @@ -192,7 +192,7 @@ static void savageBlendFunc_s4(struct gl_context *ctx) break; } - switch (ctx->Color.BlendSrcRGB) + switch (ctx->Color.Blend[0].SrcRGB) { case GL_ZERO: imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_Zero; @@ -310,7 +310,7 @@ static void savageBlendFunc_s3d(struct gl_context *ctx) * blend modes */ if(ctx->Color.BlendEnabled){ - switch (ctx->Color.BlendDstRGB) + switch (ctx->Color.Blend[0].DstRGB) { case GL_ZERO: imesa->regs.s3d.drawCtrl.ni.dstAlphaMode = DAM_Zero; @@ -366,7 +366,7 @@ static void savageBlendFunc_s3d(struct gl_context *ctx) break; } - switch (ctx->Color.BlendSrcRGB) + switch (ctx->Color.Blend[0].SrcRGB) { case GL_ZERO: imesa->regs.s3d.drawCtrl.ni.srcAlphaMode = SAM_Zero; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c index 3f6822d4574..b26b2c710b9 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_state.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c @@ -84,7 +84,7 @@ static void tdfxUpdateAlphaMode( struct gl_context *ctx ) if ( ctx->Color.BlendEnabled && (fxMesa->Fallback & TDFX_FALLBACK_BLEND) == 0 ) { - switch ( ctx->Color.BlendSrcRGB ) { + switch ( ctx->Color.Blend[0].SrcRGB ) { case GL_ZERO: srcRGB = GR_BLEND_ZERO; break; @@ -126,7 +126,7 @@ static void tdfxUpdateAlphaMode( struct gl_context *ctx ) srcRGB = GR_BLEND_ONE; } - switch ( ctx->Color.BlendSrcA ) { + switch ( ctx->Color.Blend[0].SrcA ) { case GL_ZERO: srcA = GR_BLEND_ZERO; break; @@ -156,7 +156,7 @@ static void tdfxUpdateAlphaMode( struct gl_context *ctx ) srcA = GR_BLEND_ONE; } - switch ( ctx->Color.BlendDstRGB ) { + switch ( ctx->Color.Blend[0].DstRGB ) { case GL_ZERO: dstRGB = GR_BLEND_ZERO; break; @@ -195,7 +195,7 @@ static void tdfxUpdateAlphaMode( struct gl_context *ctx ) dstRGB = GR_BLEND_ZERO; } - switch ( ctx->Color.BlendDstA ) { + switch ( ctx->Color.Blend[0].DstA ) { case GL_ZERO: dstA = GR_BLEND_ZERO; break; @@ -222,7 +222,7 @@ static void tdfxUpdateAlphaMode( struct gl_context *ctx ) dstA = GR_BLEND_ZERO; } - switch ( ctx->Color.BlendEquationRGB ) { + switch ( ctx->Color.Blend[0].EquationRGB ) { case GL_FUNC_SUBTRACT: eqRGB = GR_BLEND_OP_SUB; break; @@ -235,7 +235,7 @@ static void tdfxUpdateAlphaMode( struct gl_context *ctx ) break; } - switch ( ctx->Color.BlendEquationA ) { + switch ( ctx->Color.Blend[0].EquationA ) { case GL_FUNC_SUBTRACT: eqA = GR_BLEND_OP_SUB; break; diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index 033352188d4..774f439bfb6 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -552,7 +552,7 @@ static void viaBlendFunc(struct gl_context *ctx, GLenum sfactor, GLenum dfactor) if (VIA_DEBUG & DEBUG_STATE) fprintf(stderr, "%s in\n", __FUNCTION__); - switch (ctx->Color.BlendSrcRGB) { + switch (ctx->Color.Blend[0].SrcRGB) { case GL_SRC_ALPHA_SATURATE: case GL_CONSTANT_COLOR: case GL_ONE_MINUS_CONSTANT_COLOR: @@ -564,7 +564,7 @@ static void viaBlendFunc(struct gl_context *ctx, GLenum sfactor, GLenum dfactor) break; } - switch (ctx->Color.BlendDstRGB) { + switch (ctx->Color.Blend[0].DstRGB) { case GL_CONSTANT_COLOR: case GL_ONE_MINUS_CONSTANT_COLOR: case GL_CONSTANT_ALPHA: @@ -757,14 +757,14 @@ void viaInitState(struct gl_context *ctx) */ ctx->Driver.BlendEquationSeparate( ctx, - ctx->Color.BlendEquationRGB, - ctx->Color.BlendEquationA); + ctx->Color.Blend[0].EquationRGB, + ctx->Color.Blend[0].EquationA); ctx->Driver.BlendFuncSeparate( ctx, - ctx->Color.BlendSrcRGB, - ctx->Color.BlendDstRGB, - ctx->Color.BlendSrcA, - ctx->Color.BlendDstA); + ctx->Color.Blend[0].SrcRGB, + ctx->Color.Blend[0].DstRGB, + ctx->Color.Blend[0].SrcA, + ctx->Color.Blend[0].DstA); ctx->Driver.Scissor( ctx, ctx->Scissor.X, ctx->Scissor.Y, ctx->Scissor.Width, ctx->Scissor.Height ); @@ -953,8 +953,8 @@ static GLboolean viaChooseTextureState(struct gl_context *ctx) static void viaChooseColorState(struct gl_context *ctx) { struct via_context *vmesa = VIA_CONTEXT(ctx); - GLenum s = ctx->Color.BlendSrcRGB; - GLenum d = ctx->Color.BlendDstRGB; + GLenum s = ctx->Color.Blend[0].SrcRGB; + GLenum d = ctx->Color.Blend[0].DstRGB; /* The HW's blending equation is: * (Ca * FCa + Cbias + Cb * FCb) << Cshift |