|
@@ -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;
|