summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2010-01-28 17:23:58 +0100
committerRoland Scheidegger <[email protected]>2010-01-28 17:23:58 +0100
commit9b346f83a7b672e913a7bb6a089d5dbd7fbdce06 (patch)
treef5e4856c9d6fb4e57c4ddf6e64d5212f24c853ae /src/gallium/state_trackers
parentbd60e6cd5ce7c19e52338f12f73dfa1b622391d5 (diff)
parent2fa34bf44c7cd7ba03ce8a7e82fe56898a57e9b4 (diff)
Merge commit 'origin/perrtblend'
Conflicts: src/gallium/drivers/softpipe/sp_screen.c src/gallium/include/pipe/p_defines.h
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/dri/dri_extensions.c5
-rw-r--r--src/gallium/state_trackers/python/samples/gs.py10
-rw-r--r--src/gallium/state_trackers/python/samples/tri.py10
-rw-r--r--src/gallium/state_trackers/python/st_device.c10
-rw-r--r--src/gallium/state_trackers/python/tests/regress/fragment-shader/fragment-shader.py10
-rw-r--r--src/gallium/state_trackers/python/tests/regress/vertex-shader/vertex-shader.py10
-rwxr-xr-xsrc/gallium/state_trackers/python/tests/texture_render.py10
-rwxr-xr-xsrc/gallium/state_trackers/python/tests/texture_sample.py20
-rw-r--r--src/gallium/state_trackers/vega/api_filters.c18
-rw-r--r--src/gallium/state_trackers/vega/api_masks.c13
-rw-r--r--src/gallium/state_trackers/vega/mask.c15
-rw-r--r--src/gallium/state_trackers/vega/polygon.c10
-rw-r--r--src/gallium/state_trackers/vega/renderer.c20
-rw-r--r--src/gallium/state_trackers/vega/vg_context.c68
-rw-r--r--src/gallium/state_trackers/xorg/xorg_composite.c12
-rw-r--r--src/gallium/state_trackers/xorg/xorg_renderer.c10
-rw-r--r--src/gallium/state_trackers/xorg/xorg_xv.c12
17 files changed, 130 insertions, 133 deletions
diff --git a/src/gallium/state_trackers/dri/dri_extensions.c b/src/gallium/state_trackers/dri/dri_extensions.c
index 8b014a2a8b8..1259813a412 100644
--- a/src/gallium/state_trackers/dri/dri_extensions.c
+++ b/src/gallium/state_trackers/dri/dri_extensions.c
@@ -50,6 +50,7 @@
#define need_GL_EXT_blend_func_separate
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_cull_vertex
+#define need_GL_EXT_draw_buffers2
#define need_GL_EXT_fog_coord
#define need_GL_EXT_framebuffer_object
#define need_GL_EXT_multi_draw_arrays
@@ -98,6 +99,7 @@ static const struct dri_extension card_extensions[] = {
{"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions},
{"GL_EXT_blend_subtract", NULL},
{"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions},
+ {"GL_EXT_draw_buffers2", GL_EXT_draw_buffers2_functions},
{"GL_EXT_fog_coord", GL_EXT_fog_coord_functions},
{"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions},
{"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions},
@@ -130,6 +132,9 @@ dri_init_extensions(struct dri_context *ctx)
/* The card_extensions list should be pruned according to the
* capabilities of the pipe_screen. This is actually something
* that can/should be done inside st_create_context().
+ * XXX Not pruning is very bogus. Always all these extensions above
+ * will be advertized, regardless what st_init_extensions
+ * (which depends on the pipe cap bits) does.
*/
driInitExtensions(ctx->st->ctx, card_extensions, GL_TRUE);
}
diff --git a/src/gallium/state_trackers/python/samples/gs.py b/src/gallium/state_trackers/python/samples/gs.py
index a07cf557f2f..cd68abac9a1 100644
--- a/src/gallium/state_trackers/python/samples/gs.py
+++ b/src/gallium/state_trackers/python/samples/gs.py
@@ -72,11 +72,11 @@ def test(dev):
# disabled blending/masking
blend = Blend()
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.colormask = PIPE_MASK_RGBA
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].colormask = PIPE_MASK_RGBA
ctx.set_blend(blend)
# depth/stencil/alpha
diff --git a/src/gallium/state_trackers/python/samples/tri.py b/src/gallium/state_trackers/python/samples/tri.py
index e5e168bdc8d..f0b5e3dc984 100644
--- a/src/gallium/state_trackers/python/samples/tri.py
+++ b/src/gallium/state_trackers/python/samples/tri.py
@@ -72,11 +72,11 @@ def test(dev):
# disabled blending/masking
blend = Blend()
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.colormask = PIPE_MASK_RGBA
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].colormask = PIPE_MASK_RGBA
ctx.set_blend(blend)
# depth/stencil/alpha
diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c
index d144af2447d..e41125f6f99 100644
--- a/src/gallium/state_trackers/python/st_device.c
+++ b/src/gallium/state_trackers/python/st_device.c
@@ -180,11 +180,11 @@ st_context_create(struct st_device *st_dev)
{
struct pipe_blend_state blend;
memset(&blend, 0, sizeof(blend));
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.colormask = PIPE_MASK_RGBA;
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].colormask = PIPE_MASK_RGBA;
cso_set_blend(st_ctx->cso, &blend);
}
diff --git a/src/gallium/state_trackers/python/tests/regress/fragment-shader/fragment-shader.py b/src/gallium/state_trackers/python/tests/regress/fragment-shader/fragment-shader.py
index 9e668d2ac69..41dd69d2542 100644
--- a/src/gallium/state_trackers/python/tests/regress/fragment-shader/fragment-shader.py
+++ b/src/gallium/state_trackers/python/tests/regress/fragment-shader/fragment-shader.py
@@ -51,11 +51,11 @@ def test(dev, name):
# disabled blending/masking
blend = Blend()
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.colormask = PIPE_MASK_RGBA
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].colormask = PIPE_MASK_RGBA
ctx.set_blend(blend)
# depth/stencil/alpha
diff --git a/src/gallium/state_trackers/python/tests/regress/vertex-shader/vertex-shader.py b/src/gallium/state_trackers/python/tests/regress/vertex-shader/vertex-shader.py
index 96503778ae8..2c44f872e1d 100644
--- a/src/gallium/state_trackers/python/tests/regress/vertex-shader/vertex-shader.py
+++ b/src/gallium/state_trackers/python/tests/regress/vertex-shader/vertex-shader.py
@@ -52,11 +52,11 @@ def test(dev, name):
# disabled blending/masking
blend = Blend()
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.colormask = PIPE_MASK_RGBA
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].colormask = PIPE_MASK_RGBA
ctx.set_blend(blend)
# depth/stencil/alpha
diff --git a/src/gallium/state_trackers/python/tests/texture_render.py b/src/gallium/state_trackers/python/tests/texture_render.py
index 79287f2cace..0fac1ea5ef3 100755
--- a/src/gallium/state_trackers/python/tests/texture_render.py
+++ b/src/gallium/state_trackers/python/tests/texture_render.py
@@ -115,11 +115,11 @@ class TextureTest(TestCase):
# disabled blending/masking
blend = Blend()
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.colormask = PIPE_MASK_RGBA
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].colormask = PIPE_MASK_RGBA
ctx.set_blend(blend)
# no-op depth/stencil/alpha
diff --git a/src/gallium/state_trackers/python/tests/texture_sample.py b/src/gallium/state_trackers/python/tests/texture_sample.py
index 520961c8051..db32b537a17 100755
--- a/src/gallium/state_trackers/python/tests/texture_sample.py
+++ b/src/gallium/state_trackers/python/tests/texture_sample.py
@@ -140,11 +140,11 @@ class TextureColorSampleTest(TestCase):
# disabled blending/masking
blend = Blend()
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.colormask = PIPE_MASK_RGBA
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].colormask = PIPE_MASK_RGBA
ctx.set_blend(blend)
# no-op depth/stencil/alpha
@@ -327,11 +327,11 @@ class TextureDepthSampleTest(TestCase):
# disabled blending/masking
blend = Blend()
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
- blend.colormask = PIPE_MASK_RGBA
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO
+ blend.rt[0].colormask = PIPE_MASK_RGBA
ctx.set_blend(blend)
# depth/stencil/alpha
diff --git a/src/gallium/state_trackers/vega/api_filters.c b/src/gallium/state_trackers/vega/api_filters.c
index 8f69ee01099..cf4a11bb142 100644
--- a/src/gallium/state_trackers/vega/api_filters.c
+++ b/src/gallium/state_trackers/vega/api_filters.c
@@ -127,19 +127,19 @@ static void setup_blend()
struct vg_context *ctx = vg_current_context();
struct pipe_blend_state blend;
memset(&blend, 0, sizeof(blend));
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
if (ctx->state.vg.filter_channel_mask & VG_RED)
- blend.colormask |= PIPE_MASK_R;
+ blend.rt[0].colormask |= PIPE_MASK_R;
if (ctx->state.vg.filter_channel_mask & VG_GREEN)
- blend.colormask |= PIPE_MASK_G;
+ blend.rt[0].colormask |= PIPE_MASK_G;
if (ctx->state.vg.filter_channel_mask & VG_BLUE)
- blend.colormask |= PIPE_MASK_B;
+ blend.rt[0].colormask |= PIPE_MASK_B;
if (ctx->state.vg.filter_channel_mask & VG_ALPHA)
- blend.colormask |= PIPE_MASK_A;
- blend.blend_enable = 1;
+ blend.rt[0].colormask |= PIPE_MASK_A;
+ blend.rt[0].blend_enable = 0;
cso_set_blend(ctx->cso_context, &blend);
}
diff --git a/src/gallium/state_trackers/vega/api_masks.c b/src/gallium/state_trackers/vega/api_masks.c
index 97cbe69205e..e6070c7353b 100644
--- a/src/gallium/state_trackers/vega/api_masks.c
+++ b/src/gallium/state_trackers/vega/api_masks.c
@@ -128,14 +128,11 @@ clear_with_quad(struct vg_context *st, float x0, float y0,
{
struct pipe_blend_state blend;
memset(&blend, 0, sizeof(blend));
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.colormask |= PIPE_MASK_R;
- blend.colormask |= PIPE_MASK_G;
- blend.colormask |= PIPE_MASK_B;
- blend.colormask |= PIPE_MASK_A;
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].colormask = PIPE_MASK_RGBA;
cso_set_blend(st->cso_context, &blend);
}
diff --git a/src/gallium/state_trackers/vega/mask.c b/src/gallium/state_trackers/vega/mask.c
index 3e260e70736..ba8ecef1d2d 100644
--- a/src/gallium/state_trackers/vega/mask.c
+++ b/src/gallium/state_trackers/vega/mask.c
@@ -354,15 +354,12 @@ static void setup_mask_blend()
struct pipe_blend_state blend;
memset(&blend, 0, sizeof(struct pipe_blend_state));
- blend.blend_enable = 1;
- blend.colormask |= PIPE_MASK_R;
- blend.colormask |= PIPE_MASK_G;
- blend.colormask |= PIPE_MASK_B;
- blend.colormask |= PIPE_MASK_A;
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].blend_enable = 0;
+ blend.rt[0].colormask = PIPE_MASK_RGBA;
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
cso_set_blend(ctx->cso_context, &blend);
}
diff --git a/src/gallium/state_trackers/vega/polygon.c b/src/gallium/state_trackers/vega/polygon.c
index d385ee567fa..f5352ee84e5 100644
--- a/src/gallium/state_trackers/vega/polygon.c
+++ b/src/gallium/state_trackers/vega/polygon.c
@@ -248,12 +248,12 @@ VGboolean polygon_is_closed(struct polygon *p)
static void set_blend_for_fill(struct pipe_blend_state *blend)
{
memset(blend, 0, sizeof(struct pipe_blend_state));
- blend->colormask = 0; /*disable colorwrites*/
+ blend->rt[0].colormask = 0; /*disable colorwrites*/
- blend->rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend->alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend->rgb_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
- blend->alpha_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
+ blend->rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
+ blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
}
static void draw_polygon(struct vg_context *ctx,
diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c
index 64e3a7c5453..47e18dc1e23 100644
--- a/src/gallium/state_trackers/vega/renderer.c
+++ b/src/gallium/state_trackers/vega/renderer.c
@@ -317,11 +317,11 @@ void renderer_copy_texture(struct renderer *ctx,
{
struct pipe_blend_state blend;
memset(&blend, 0, sizeof(blend));
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.colormask = PIPE_MASK_RGBA;
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].colormask = PIPE_MASK_RGBA;
cso_set_blend(ctx->cso, &blend);
}
@@ -486,11 +486,11 @@ void renderer_copy_surface(struct renderer *ctx,
{
struct pipe_blend_state blend;
memset(&blend, 0, sizeof(blend));
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.colormask = PIPE_MASK_RGBA;
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].colormask = PIPE_MASK_RGBA;
cso_set_blend(ctx->cso, &blend);
}
diff --git a/src/gallium/state_trackers/vega/vg_context.c b/src/gallium/state_trackers/vega/vg_context.c
index c16ac036e3b..64207d97bac 100644
--- a/src/gallium/state_trackers/vega/vg_context.c
+++ b/src/gallium/state_trackers/vega/vg_context.c
@@ -252,7 +252,7 @@ static void update_clip_state(struct vg_context *ctx)
ctx->pipe->clear(ctx->pipe, PIPE_CLEAR_DEPTHSTENCIL, NULL, 1.0, 0);
/* disable color writes */
- blend->colormask = 0; /*disable colorwrites*/
+ blend->rt[0].colormask = 0; /*disable colorwrites*/
cso_set_blend(ctx->cso_context, blend);
/* enable scissoring */
@@ -286,7 +286,6 @@ static void update_clip_state(struct vg_context *ctx)
renderer_draw_quad(ctx->renderer, minx, miny, maxx, maxy, 0.0f);
}
- blend->colormask = 1; /*enable colorwrites*/
cso_restore_blend(ctx->cso_context);
cso_restore_fragment_shader(ctx->cso_context);
@@ -301,57 +300,56 @@ void vg_validate_state(struct vg_context *ctx)
if ((ctx->state.dirty & BLEND_DIRTY)) {
struct pipe_blend_state *blend = &ctx->state.g3d.blend;
memset(blend, 0, sizeof(struct pipe_blend_state));
- blend->blend_enable = 1;
- blend->colormask |= PIPE_MASK_R;
- blend->colormask |= PIPE_MASK_G;
- blend->colormask |= PIPE_MASK_B;
- blend->colormask |= PIPE_MASK_A;
+ blend->rt[0].blend_enable = 1;
+ blend->rt[0].colormask = PIPE_MASK_RGBA;
switch (ctx->state.vg.blend_mode) {
case VG_BLEND_SRC:
- blend->rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend->alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend->rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend->alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend->rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend->rt[0].blend_enable = 0;
break;
case VG_BLEND_SRC_OVER:
- blend->rgb_src_factor = PIPE_BLENDFACTOR_SRC_ALPHA;
- blend->alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend->rgb_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
- blend->alpha_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
+ blend->rt[0].rgb_src_factor = PIPE_BLENDFACTOR_SRC_ALPHA;
+ blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
+ blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA;
break;
case VG_BLEND_DST_OVER:
- blend->rgb_src_factor = PIPE_BLENDFACTOR_INV_DST_ALPHA;
- blend->alpha_src_factor = PIPE_BLENDFACTOR_INV_DST_ALPHA;
- blend->rgb_dst_factor = PIPE_BLENDFACTOR_DST_ALPHA;
- blend->alpha_dst_factor = PIPE_BLENDFACTOR_DST_ALPHA;
+ blend->rt[0].rgb_src_factor = PIPE_BLENDFACTOR_INV_DST_ALPHA;
+ blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_INV_DST_ALPHA;
+ blend->rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_DST_ALPHA;
+ blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_DST_ALPHA;
break;
case VG_BLEND_SRC_IN:
- blend->rgb_src_factor = PIPE_BLENDFACTOR_DST_ALPHA;
- blend->alpha_src_factor = PIPE_BLENDFACTOR_DST_ALPHA;
- blend->rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend->alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend->rt[0].rgb_src_factor = PIPE_BLENDFACTOR_DST_ALPHA;
+ blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_DST_ALPHA;
+ blend->rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
break;
case VG_BLEND_DST_IN:
- blend->rgb_src_factor = PIPE_BLENDFACTOR_ZERO;
- blend->alpha_src_factor = PIPE_BLENDFACTOR_ZERO;
- blend->rgb_dst_factor = PIPE_BLENDFACTOR_SRC_ALPHA;
- blend->alpha_dst_factor = PIPE_BLENDFACTOR_SRC_ALPHA;
+ blend->rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ZERO;
+ blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ZERO;
+ blend->rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_SRC_ALPHA;
+ blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_SRC_ALPHA;
break;
case VG_BLEND_MULTIPLY:
case VG_BLEND_SCREEN:
case VG_BLEND_DARKEN:
case VG_BLEND_LIGHTEN:
- blend->rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend->alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend->rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend->alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend->rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend->rt[0].blend_enable = 0;
break;
case VG_BLEND_ADDITIVE:
- blend->rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend->alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend->rgb_dst_factor = PIPE_BLENDFACTOR_ONE;
- blend->alpha_dst_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ONE;
+ blend->rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ONE;
break;
default:
assert(!"not implemented blend mode");
diff --git a/src/gallium/state_trackers/xorg/xorg_composite.c b/src/gallium/state_trackers/xorg/xorg_composite.c
index 0324441c067..c50873c1508 100644
--- a/src/gallium/state_trackers/xorg/xorg_composite.c
+++ b/src/gallium/state_trackers/xorg/xorg_composite.c
@@ -217,13 +217,13 @@ bind_blend_state(struct exa_context *exa, int op,
blend_for_op(&blend_opt, op, pSrcPicture, pMaskPicture, pDstPicture);
memset(&blend, 0, sizeof(struct pipe_blend_state));
- blend.blend_enable = 1;
- blend.colormask |= PIPE_MASK_RGBA;
+ blend.rt[0].blend_enable = 1;
+ blend.rt[0].colormask = PIPE_MASK_RGBA;
- blend.rgb_src_factor = blend_opt.rgb_src;
- blend.alpha_src_factor = blend_opt.rgb_src;
- blend.rgb_dst_factor = blend_opt.rgb_dst;
- blend.alpha_dst_factor = blend_opt.rgb_dst;
+ blend.rt[0].rgb_src_factor = blend_opt.rgb_src;
+ blend.rt[0].alpha_src_factor = blend_opt.rgb_src;
+ blend.rt[0].rgb_dst_factor = blend_opt.rgb_dst;
+ blend.rt[0].alpha_dst_factor = blend_opt.rgb_dst;
cso_set_blend(exa->renderer->cso, &blend);
}
diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c
index db3330bc40a..a3c3993ab81 100644
--- a/src/gallium/state_trackers/xorg/xorg_renderer.c
+++ b/src/gallium/state_trackers/xorg/xorg_renderer.c
@@ -444,11 +444,11 @@ void renderer_copy_prepare(struct xorg_renderer *r,
{
struct pipe_blend_state blend;
memset(&blend, 0, sizeof(blend));
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.colormask = PIPE_MASK_RGBA;
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].colormask = PIPE_MASK_RGBA;
cso_set_blend(r->cso, &blend);
}
diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c
index a3bcd7cb4c9..3dcef22c132 100644
--- a/src/gallium/state_trackers/xorg/xorg_xv.c
+++ b/src/gallium/state_trackers/xorg/xorg_xv.c
@@ -400,14 +400,14 @@ bind_blend_state(struct xorg_xv_port_priv *port)
struct pipe_blend_state blend;
memset(&blend, 0, sizeof(struct pipe_blend_state));
- blend.blend_enable = 1;
- blend.colormask |= PIPE_MASK_RGBA;
+ blend.rt[0].blend_enable = 0;
+ blend.rt[0].colormask = PIPE_MASK_RGBA;
/* porter&duff src */
- blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE;
- blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
- blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+ blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+ blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
cso_set_blend(port->r->cso, &blend);
}