i965: added intelFlush() call in intel_get_tex_image()
authorBrian Paul <brianp@vmware.com>
Tue, 9 Jun 2009 21:07:39 +0000 (15:07 -0600)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 22 Jun 2009 22:15:20 +0000 (15:15 -0700)
Fixes the render-to-texture test in progs/tests/getteximage.c
(cherry picked from commit a03b349153660e449daf4f56d750f1caef23b1a5)

src/mesa/drivers/dri/intel/intel_tex_image.c

index 66a3b4e492bf7bf81c0ff497ba4f0203decf5acd..5e61e9e95ecc272c7d60212205ff7e874a76529e 100644 (file)
@@ -637,6 +637,12 @@ intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level,
    struct intel_context *intel = intel_context(ctx);
    struct intel_texture_image *intelImage = intel_texture_image(texImage);
 
+   /* If we're reading from a texture that has been rendered to, need to
+    * make sure rendering is complete.
+    * We could probably predicate this on texObj->_RenderToTexture
+    */
+   intelFlush(ctx);
+
    /* Map */
    if (intelImage->mt) {
       /* Image is stored in hardware format in a buffer managed by the