summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Hellstrom <[email protected]>2011-12-14 16:18:06 +0100
committerThomas Hellstrom <[email protected]>2011-12-15 08:28:22 +0100
commit3baaa1bbd72f67f6bc7374b2b6a16b0322006a65 (patch)
tree65cf45e90e3cf999988d22ffe2d0d141827bd139 /src
parentaa7d7656f50f5c49734e3b0fad0f20a89cd5eb5b (diff)
st/xa: Disable composite solid fill with mask
Xa doesn't support it yet. Trying to do that would cause a segfault. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/xa/xa_composite.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/xa/xa_composite.c b/src/gallium/state_trackers/xa/xa_composite.c
index 43940e768d8..1f076ff26a8 100644
--- a/src/gallium/state_trackers/xa/xa_composite.c
+++ b/src/gallium/state_trackers/xa/xa_composite.c
@@ -227,6 +227,14 @@ xa_composite_check_accelerated(const struct xa_composite *comp)
if (src_pic->src_pict) {
if (src_pic->src_pict->type != xa_src_pict_solid_fill)
return -XA_ERR_INVAL;
+
+ /*
+ * Currently we don't support solid fill with a mask.
+ * We can easily do that, but that would require shader,
+ * sampler view setup and vertex setup modification.
+ */
+ if (comp->mask)
+ return -XA_ERR_INVAL;
}
if (blend_for_op(&blend, comp->op, comp->src, comp->mask, comp->dst)) {
@@ -329,7 +337,7 @@ bind_shaders(struct xa_context *ctx, const struct xa_composite *comp)
if (src_pic->src_pict) {
if (src_pic->src_pict->type == xa_src_pict_solid_fill) {
- fs_traits |= FS_SOLID_FILL;
+ fs_traits |= FS_SOLID_FILL | FS_FILL;
vs_traits |= VS_SOLID_FILL;
xa_pixel_to_float4(src_pic->src_pict->solid_fill.color,
ctx->solid_color);
@@ -439,6 +447,16 @@ bind_samplers(struct xa_context *ctx,
&view_templ);
pipe_sampler_view_reference(&ctx->bound_sampler_views[1], NULL);
ctx->bound_sampler_views[1] = src_view;
+
+
+ /*
+ * If src is a solid color, we have no src view, so set up a
+ * dummy one that will not be used anyway.
+ */
+ if (ctx->bound_sampler_views[0] == NULL)
+ pipe_sampler_view_reference(&ctx->bound_sampler_views[0],
+ src_view);
+
}
cso_set_samplers(ctx->cso, ctx->num_bound_samplers,