Browse Source

fix copyTexture wrt textures arrays

Nicolas Cannasse 4 years ago
parent
commit
2108e4be36
2 changed files with 2 additions and 2 deletions
  1. 1 1
      h3d/impl/DirectXDriver.hx
  2. 1 1
      h3d/pass/Copy.hx

+ 1 - 1
h3d/impl/DirectXDriver.hx

@@ -813,7 +813,7 @@ 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 )
+		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 )
 			to.alloc();

+ 1 - 1
h3d/pass/Copy.hx

@@ -110,7 +110,7 @@ class Copy extends ScreenFx<CopyShader> {
 
 	public static function run( from : h3d.mat.Texture, to : h3d.mat.Texture, ?blend : h3d.mat.BlendMode, ?pass : h3d.mat.Pass, ?layer : Int ) {
 		var engine = h3d.Engine.getCurrent();
-		if( to != null && from != null && (blend == null || blend == None) && pass == null && engine.driver.copyTexture(from, to) )
+		if( to != null && from != null && (blend == null || blend == None) && pass == null && layer == null && engine.driver.copyTexture(from, to) )
 			return;
 		var inst : Copy = @:privateAccess engine.resCache.get(Copy);
 		if( inst == null ) {