Pārlūkot izejas kodu

Lazy loading on texture only if texture is not array (waiting for fix on dx12).

clementlandrin 1 gadu atpakaļ
vecāks
revīzija
7622436622
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 5 1
      hxd/res/Image.hx

+ 5 - 1
hxd/res/Image.hx

@@ -624,7 +624,11 @@ class Image extends Resource {
 		if( DEFAULT_FILTER != Linear ) tex.filter = DEFAULT_FILTER;
 		if( DEFAULT_FILTER != Linear ) tex.filter = DEFAULT_FILTER;
 		tex.setName(entry.path);
 		tex.setName(entry.path);
 		setupTextureFlags(tex);
 		setupTextureFlags(tex);
-		tex.realloc = () -> loadTexture();
+		// DirectX12 texture array triggers an access violation.
+		if ( tex.flags.has(IsArray) )
+			loadTexture();
+		else
+			tex.realloc = () -> loadTexture();
 		return tex;
 		return tex;
 	}
 	}