radeon: need to flush cs when moving images between mipmap trees
authorMaciej Cencora <m.cencora@gmail.com>
Sat, 28 Nov 2009 20:31:24 +0000 (21:31 +0100)
committerMaciej Cencora <m.cencora@gmail.com>
Sat, 28 Nov 2009 20:36:59 +0000 (21:36 +0100)
src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c

index 46603de2e76c338c56642edeb28ca24ca27856dc..94211048aecfce23edb554643adc01aab3473d89 100644 (file)
@@ -594,6 +594,10 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t
                                if (RADEON_DEBUG & RADEON_TEXTURE) {
                                        fprintf(stderr, "MIGRATING\n");
                                }
+                               struct radeon_bo *src_bo = (img->mt) ? img->mt->bo : img->bo;
+                               if (src_bo && radeon_bo_is_referenced_by_cs(src_bo, rmesa->cmdbuf.cs)) {
+                                       radeon_firevertices(rmesa);
+                               }
                                migrate_image_to_miptree(dst_miptree, img, face, radeon_gl_level_to_miptree_level(texObj, level));
                        } else if (RADEON_DEBUG & RADEON_TEXTURE) {
                                fprintf(stderr, "OK\n");