浏览代码

skip upload on disposed texture

ncannasse 10 年之前
父节点
当前提交
ad50ab9212
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      h3d/impl/Stage3dDriver.hx

+ 2 - 0
h3d/impl/Stage3dDriver.hx

@@ -271,6 +271,7 @@ class Stage3dDriver extends Driver {
 	}
 
 	override function uploadTextureBitmap( t : h3d.mat.Texture, bmp : hxd.BitmapData, mipLevel : Int, side : Int ) {
+		if( t.t == tdisposed ) return;
 		if( t.flags.has(Cubic) ) {
 			var t = flash.Lib.as(t.t, flash.display3D.textures.CubeTexture);
 			t.uploadFromBitmapData(bmp.toNative(), side, mipLevel);
@@ -286,6 +287,7 @@ class Stage3dDriver extends Driver {
 	}
 
 	override function uploadTexturePixels( t : h3d.mat.Texture, pixels : hxd.Pixels, mipLevel : Int, side : Int ) {
+		if( t.t == tdisposed ) return;
 		pixels.convert(BGRA);
 		var data = pixels.bytes.getData();
 		if( t.flags.has(Cubic) ) {