summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaura Ekstrand <laura@jlekstrand.net>2018-03-07 14:58:05 -0800
committerLaura Ekstrand <laura@jlekstrand.net>2018-03-12 13:18:43 -0700
commit573336cbd97b1f1f85b3af8fd1688ef7338e7a40 (patch)
treee51a1ffa305670942928cb04f0e1a5885d2ebd48
parentec12bb1e8e10cc61061e81b1ca8495fb0c2c0f81 (diff)
i965, meta: Remove color logic ops from CopyPixels.
Blorp doesn't handle color logic ops. Since color logic ops functionality is ancient and rarely ever used, we have chosen not to add it to Blorp at this time. This patch removes logic ops in preparation for porting CopyPixels to Blorp. Since logic ops is also not implemented in meta, this adds a fallback to swrast.
-rw-r--r--src/mesa/drivers/common/meta.c4
-rw-r--r--src/mesa/drivers/dri/i965/intel_pixel_copy.c10
2 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 830d82ad49..f81ddf9e92 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1862,7 +1862,9 @@ _mesa_meta_CopyPixels(struct gl_context *ctx, GLint srcX, GLint srcY,
ctx->_ImageTransferState ||
ctx->Fog.Enabled ||
width > tex->MaxSize ||
- height > tex->MaxSize) {
+ height > tex->MaxSize ||
+ (ctx->Color.ColorLogicOpEnabled &&
+ ctx->Color._LogicOp != COLOR_LOGICOP_COPY)) {
/* XXX avoid this fallback */
_swrast_CopyPixels(ctx, srcX, srcY, width, height, dstX, dstY, type);
return;
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/src/mesa/drivers/dri/i965/intel_pixel_copy.c
index 8029ffbedd..c2a9d4d601 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_copy.c
@@ -144,6 +144,13 @@ do_blit_copypixels(struct gl_context * ctx,
return false;
}
+ /* No LogicOps in Blorp, by design; LogicOps is esoteric */
+ if (ctx->Color.ColorLogicOpEnabled &&
+ ctx->Color._LogicOp != COLOR_LOGICOP_COPY) {
+ perf_debug("glCopyPixels(): Unsupported color index logic op\n");
+ return false;
+ }
+
intel_batchbuffer_flush(brw);
/* Clip to destination buffer. */
@@ -174,8 +181,7 @@ do_blit_copypixels(struct gl_context * ctx,
draw_irb->mt, draw_irb->mt_level, draw_irb->mt_layer,
dstx, dsty, _mesa_is_winsys_fbo(fb),
width, height,
- (ctx->Color.ColorLogicOpEnabled ?
- ctx->Color._LogicOp : COLOR_LOGICOP_COPY))) {
+ COLOR_LOGICOP_COPY)) {
DBG("%s: blit failure\n", __func__);
return false;
}