struct intel_mipmap_tree *mt,
int x, int y, int width, int height);
-static GLuint translate_raster_op(GLenum logicop)
+static GLuint translate_raster_op(enum gl_logicop_mode logicop)
{
- switch(logicop) {
- case GL_CLEAR: return 0x00;
- case GL_AND: return 0x88;
- case GL_AND_REVERSE: return 0x44;
- case GL_COPY: return 0xCC;
- case GL_AND_INVERTED: return 0x22;
- case GL_NOOP: return 0xAA;
- case GL_XOR: return 0x66;
- case GL_OR: return 0xEE;
- case GL_NOR: return 0x11;
- case GL_EQUIV: return 0x99;
- case GL_INVERT: return 0x55;
- case GL_OR_REVERSE: return 0xDD;
- case GL_COPY_INVERTED: return 0x33;
- case GL_OR_INVERTED: return 0xBB;
- case GL_NAND: return 0x77;
- case GL_SET: return 0xFF;
- default: return 0;
- }
+ return logicop | (logicop << 4);
}
static uint32_t
int dst_level, int dst_slice,
uint32_t dst_x, uint32_t dst_y, bool dst_flip,
uint32_t width, uint32_t height,
- GLenum logicop)
+ enum gl_logicop_mode logicop)
{
/* No sRGB decode or encode is done by the hardware blitter, which is
* consistent with what we want in the callers (glCopyTexSubImage(),
GLshort src_x, GLshort src_y,
GLshort dst_x, GLshort dst_y,
GLshort w, GLshort h,
- GLenum logic_op)
+ enum gl_logicop_mode logic_op)
{
GLuint CMD, BR13, pass = 0;
int dst_y2 = dst_y + h;
uint32_t dst_tiling,
GLshort x, GLshort y,
GLshort w, GLshort h,
- GLenum logic_op)
+ enum gl_logicop_mode logic_op)
{
int dwords = ALIGN(src_size, 8) / 4;
uint32_t opcode, br13, blit_cmd;
return false;
}
- assert((logic_op >= GL_CLEAR) && (logic_op <= (GL_CLEAR + 0x0f)));
+ assert((unsigned)logic_op <= 0x0f);
assert(dst_pitch > 0);
if (w < 0 || h < 0)
0, 0, /* src x/y */
0, 0, /* dst x/y */
pitch, height, /* w, h */
- GL_COPY);
+ COLOR_LOGICOP_COPY);
if (!ok)
_mesa_problem(ctx, "Failed to linear blit %dx%d\n", pitch, height);
0, 0, /* src x/y */
0, 0, /* dst x/y */
size, 1, /* w, h */
- GL_COPY);
+ COLOR_LOGICOP_COPY);
if (!ok)
_mesa_problem(ctx, "Failed to linear blit %dx%d\n", size, 1);
}
GLshort srcx, GLshort srcy,
GLshort dstx, GLshort dsty,
GLshort w, GLshort h,
- GLenum logicop );
+ enum gl_logicop_mode logicop);
bool intel_miptree_blit(struct intel_context *intel,
struct intel_mipmap_tree *src_mt,
int dst_level, int dst_slice,
uint32_t dst_x, uint32_t dst_y, bool dst_flip,
uint32_t width, uint32_t height,
- GLenum logicop);
+ enum gl_logicop_mode logicop);
bool
intelEmitImmediateColorExpandBlit(struct intel_context *intel,
uint32_t dst_tiling,
GLshort x, GLshort y,
GLshort w, GLshort h,
- GLenum logic_op);
+ enum gl_logicop_mode logic_op);
void intel_emit_linear_blit(struct intel_context *intel,
drm_intel_bo *dst_bo,
unsigned int dst_offset,
dst_irb->mt,
dst_irb->mt_level, dst_irb->mt_layer,
dstX0, dstY0, dst_rb->Name == 0,
- dstX1 - dstX0, dstY1 - dstY0, GL_COPY)) {
+ dstX1 - dstX0, dstY1 - dstY0, COLOR_LOGICOP_COPY)) {
perf_debug("glBlitFramebuffer(): unknown blit failure. "
"Falling back to software rendering.\n");
return mask;
if (!intel_miptree_blit(intel,
src_mt, level, slice, 0, 0, false,
dst_mt, level, slice, 0, 0, false,
- width, height, GL_COPY)) {
+ width, height, COLOR_LOGICOP_COPY)) {
perf_debug("miptree validate blit for %s failed\n",
_mesa_get_format_name(format));
map->x, map->y, false,
map->mt, 0, 0,
0, 0, false,
- map->w, map->h, GL_COPY)) {
+ map->w, map->h, COLOR_LOGICOP_COPY)) {
fprintf(stderr, "Failed to blit\n");
goto fail;
}
0, 0, false,
mt, level, slice,
map->x, map->y, false,
- map->w, map->h, GL_COPY);
+ map->w, map->h, COLOR_LOGICOP_COPY);
WARN_ONCE(!ok, "Failed to blit from linear temporary mapping");
}
int h = MIN2(DY, height - py);
int w = MIN2(DX, width - px);
GLuint sz = ALIGN(ALIGN(w,8) * h, 64)/8;
- GLenum logic_op = ctx->Color.ColorLogicOpEnabled ?
- ctx->Color.LogicOp : GL_COPY;
+ const enum gl_logicop_mode logic_op = ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color._LogicOp : COLOR_LOGICOP_COPY;
assert(sz <= sizeof(stipple));
memset(stipple, 0, sz);
dstx, dsty, _mesa_is_winsys_fbo(fb),
width, height,
(ctx->Color.ColorLogicOpEnabled ?
- ctx->Color.LogicOp : GL_COPY))) {
+ ctx->Color._LogicOp : COLOR_LOGICOP_COPY))) {
DBG("%s: blit failure\n", __func__);
return false;
}
x, y, _mesa_is_winsys_fbo(ctx->ReadBuffer),
pbo_mt, 0, 0,
0, 0, dst_flip,
- width, height, GL_COPY)) {
+ width, height, COLOR_LOGICOP_COPY)) {
intel_miptree_release(&pbo_mt);
return false;
}
intelImage->mt, intelImage->base.Base.Level,
intelImage->base.Base.Face + slice,
dstx, dsty, false,
- width, height, GL_COPY)) {
+ width, height, COLOR_LOGICOP_COPY)) {
return false;
}
0, 0, false,
intelImage->mt, image->Level, image->Face,
0, 0, false,
- image->Width, image->Height, GL_COPY)) {
+ image->Width, image->Height, COLOR_LOGICOP_COPY)) {
DBG("%s: blit failed\n", __func__);
intel_miptree_release(&pbo_mt);
return false;
0, 0, false,
intelImage->mt, texImage->Level, texImage->Face,
xoffset, yoffset, false,
- width, height, GL_COPY);
+ width, height, COLOR_LOGICOP_COPY);
assert(ret);
intel_miptree_release(&temp_mt);