Commit 7de14689 authored by Marek Olšák's avatar Marek Olšák
Browse files

st/mesa: skip glDrawPixels if it's totally clipped for all codepaths


Reviewed-by: Zoltán Böszörményi's avatarZoltán Böszörményi <zboszor@gmail.com>
Part-of: <mesa/mesa!7720>
parent 004c9209
......@@ -957,14 +957,6 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
GLubyte *sValues;
GLuint *zValues;
if (!zoom) {
if (!_mesa_clip_drawpixels(ctx, &x, &y, &width, &height,
&clippedUnpack)) {
/* totally clipped */
return;
}
}
strb = st_renderbuffer(ctx->DrawBuffer->
Attachment[BUFFER_STENCIL].Renderbuffer);
......@@ -1320,12 +1312,18 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
st_validate_state(st, ST_PIPELINE_META);
clippedUnpack = *unpack;
unpack = &clippedUnpack;
/* Skip totally clipped DrawPixels. */
if (ctx->Pixel.ZoomX == 1 && ctx->Pixel.ZoomY == 1 &&
!_mesa_clip_drawpixels(ctx, &x, &y, &width, &height, &clippedUnpack))
return;
/* Limit the size of the glDrawPixels to the max texture size.
* Strictly speaking, that's not correct but since we don't handle
* larger images yet, this is better than crashing.
*/
clippedUnpack = *unpack;
unpack = &clippedUnpack;
clamp_size(st, &width, &height, &clippedUnpack);
if (format == GL_DEPTH_STENCIL)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment