mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
intel: Use tri clears when we don't know how to blit clear the format.
Bug #32207. Fixes ARB_texture_rg/fbo-clear-formats (see my
fbo-clear-formats piglit branch currently)
(cherry picked from commit 30fef21aa3)
This commit is contained in:
parent
db4e1c44b2
commit
fa61cb3609
3 changed files with 10 additions and 7 deletions
|
|
@ -207,7 +207,7 @@ intelEmitCopyBlit(struct intel_context *intel,
|
|||
* which we're clearing with triangles.
|
||||
* \param mask bitmask of BUFFER_BIT_* values indicating buffers to clear
|
||||
*/
|
||||
void
|
||||
GLbitfield
|
||||
intelClearWithBlit(struct gl_context *ctx, GLbitfield mask)
|
||||
{
|
||||
struct intel_context *intel = intel_context(ctx);
|
||||
|
|
@ -215,6 +215,7 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask)
|
|||
GLuint clear_depth;
|
||||
GLboolean all;
|
||||
GLint cx, cy, cw, ch;
|
||||
GLbitfield fail_mask = 0;
|
||||
BATCH_LOCALS;
|
||||
|
||||
/*
|
||||
|
|
@ -237,7 +238,7 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask)
|
|||
ch = fb->_Ymax - fb->_Ymin;
|
||||
|
||||
if (cw == 0 || ch == 0)
|
||||
return;
|
||||
return 0;
|
||||
|
||||
GLuint buf;
|
||||
all = (cw == fb->Width && ch == fb->Height);
|
||||
|
|
@ -333,9 +334,9 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask)
|
|||
clear[3], clear[3]);
|
||||
break;
|
||||
default:
|
||||
_mesa_problem(ctx, "Unexpected renderbuffer format: %d\n",
|
||||
irb->Base.Format);
|
||||
clear_val = 0;
|
||||
fail_mask |= bufBit;
|
||||
mask &= ~bufBit;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -370,6 +371,8 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask)
|
|||
else
|
||||
mask &= ~bufBit; /* turn off bit, for faster loop exit */
|
||||
}
|
||||
|
||||
return fail_mask;
|
||||
}
|
||||
|
||||
GLboolean
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
extern void intelCopyBuffer(const __DRIdrawable * dpriv,
|
||||
const drm_clip_rect_t * rect);
|
||||
|
||||
extern void intelClearWithBlit(struct gl_context * ctx, GLbitfield mask);
|
||||
extern GLbitfield intelClearWithBlit(struct gl_context * ctx, GLbitfield mask);
|
||||
|
||||
GLboolean
|
||||
intelEmitCopyBlit(struct intel_context *intel,
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ intelClear(struct gl_context *ctx, GLbitfield mask)
|
|||
|
||||
if (blit_mask) {
|
||||
debug_mask("blit", blit_mask);
|
||||
intelClearWithBlit(ctx, blit_mask);
|
||||
tri_mask |= intelClearWithBlit(ctx, blit_mask);
|
||||
}
|
||||
|
||||
if (tri_mask) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue