2
0
Эх сурвалжийг харах

fixed from texture being disposed when to texture is allocated

Nicolas Cannasse 3 жил өмнө
parent
commit
163848461b

+ 5 - 1
h3d/impl/DirectXDriver.hx

@@ -889,8 +889,12 @@ class DirectXDriver extends h3d.impl.Driver {
 	override function copyTexture(from:h3d.mat.Texture, to:h3d.mat.Texture) {
 		if( from.t == null || from.format != to.format || from.width != to.width || from.height != to.height || from.layerCount != to.layerCount )
 			return false;
-		if( to.t == null )
+		if( to.t == null ) {
+			var prev = from.lastFrame;
+			from.preventAutoDispose();
 			to.alloc();
+			from.lastFrame = prev;
+		}
 		to.t.res.copyResource(from.t.res);
 		to.flags.set(WasCleared);
 		return true;