aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_cb_texture.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-15 14:48:46 +0000
committermarha <marha@users.sourceforge.net>2011-04-15 14:48:46 +0000
commit71372d36e1a3f0230b88808f70d35446fda12260 (patch)
tree205982f029074be1167820e69891d8332e0a8df2 /mesalib/src/mesa/state_tracker/st_cb_texture.c
parent019fc27ce6dc2a1809107be10d4deb80e0fa436b (diff)
downloadvcxsrv-71372d36e1a3f0230b88808f70d35446fda12260.tar.gz
vcxsrv-71372d36e1a3f0230b88808f70d35446fda12260.tar.bz2
vcxsrv-71372d36e1a3f0230b88808f70d35446fda12260.zip
xserver xkeyboard-config libX11 mesa git update 15 April 2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_texture.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index 914c06b70..43c24ae95 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -600,7 +600,12 @@ st_TexImage(struct gl_context * ctx,
* memory or malloc space for it.
*/
if (stImage->pt) {
- /* Store the image in the gallium texture memory buffer */
+ if (!pixels) {
+ /* We've allocated texture resource, but have no pixel data - all done. */
+ goto done;
+ }
+
+ /* Store the image in the gallium transfer object */
if (format == GL_DEPTH_COMPONENT &&
util_format_is_depth_and_stencil(stImage->pt->format))
transfer_usage = PIPE_TRANSFER_READ_WRITE;