From 8fbd81b4ed59e371aa616b87296e4263d8992bff Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 10 Aug 2007 15:47:45 -0600 Subject: added pipe->max_texture_size() query, use it in st_drawpixels() --- src/mesa/state_tracker/st_cb_drawpixels.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mesa/state_tracker/st_cb_drawpixels.c') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index a5ba614429..ce417b9b7e 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -250,6 +250,15 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, struct pipe_context *pipe = ctx->st->pipe; struct pipe_mipmap_tree *mt; GLfloat x0, y0, x1, y1; + GLuint maxWidth, maxHeight; + + /* limit checks */ + /* XXX if DrawPixels image is larger than max texture size, break + * it up into chunks. + */ + pipe->max_texture_size(pipe, PIPE_TEXTURE_2D, &maxWidth, &maxHeight, NULL); + assert(width <= maxWidth); + assert(height <= maxHeight); /* setup state: just scissor */ { -- cgit v1.2.3