aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_texture.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-09-26 17:04:30 +0200
committermarha <marha@users.sourceforge.net>2011-09-26 17:04:30 +0200
commit873965b49f283ad028dd4e0e5b7e93a758c84993 (patch)
tree84122d76cb641b54ea85cee9b631fb51c25052b5 /mesalib/src/mesa/state_tracker/st_texture.c
parentc1e6c7428a8d2c1b60ffac7df7a3f56c300fa983 (diff)
downloadvcxsrv-873965b49f283ad028dd4e0e5b7e93a758c84993.tar.gz
vcxsrv-873965b49f283ad028dd4e0e5b7e93a758c84993.tar.bz2
vcxsrv-873965b49f283ad028dd4e0e5b7e93a758c84993.zip
fontconfig libX11 libXext libXft libXmu mesa git update 26 sep 2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_texture.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_texture.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_texture.c b/mesalib/src/mesa/state_tracker/st_texture.c
index c5dc7dcc4..c18268829 100644
--- a/mesalib/src/mesa/state_tracker/st_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_texture.c
@@ -170,8 +170,7 @@ st_gl_texture_dims_to_pipe_dims(GLenum texture,
*/
GLboolean
st_texture_match_image(const struct pipe_resource *pt,
- const struct gl_texture_image *image,
- GLuint face, GLuint level)
+ const struct gl_texture_image *image)
{
GLuint ptWidth, ptHeight, ptDepth, ptLayers;
@@ -192,9 +191,9 @@ st_texture_match_image(const struct pipe_resource *pt,
/* Test if this image's size matches what's expected in the
* established texture.
*/
- if (ptWidth != u_minify(pt->width0, level) ||
- ptHeight != u_minify(pt->height0, level) ||
- ptDepth != u_minify(pt->depth0, level) ||
+ if (ptWidth != u_minify(pt->width0, image->Level) ||
+ ptHeight != u_minify(pt->height0, image->Level) ||
+ ptDepth != u_minify(pt->depth0, image->Level) ||
ptLayers != pt->array_size)
return GL_FALSE;
@@ -366,9 +365,15 @@ st_texture_image_copy(struct pipe_context *pipe,
struct pipe_box src_box;
GLuint i;
- assert(u_minify(src->width0, srcLevel) == width);
- assert(u_minify(src->height0, srcLevel) == height);
- assert(u_minify(src->depth0, srcLevel) == depth);
+ if (u_minify(src->width0, srcLevel) != width ||
+ u_minify(src->height0, srcLevel) != height ||
+ u_minify(src->depth0, srcLevel) != depth) {
+ /* The source image size doesn't match the destination image size.
+ * This can happen in some degenerate situations such as rendering to a
+ * cube map face which was set up with mismatched texture sizes.
+ */
+ return;
+ }
src_box.x = 0;
src_box.y = 0;