Przeglądaj źródła

Fix Vulkan texture loading
Fix refl. cubemap filtering so it uses the proper source texture

BearishSun 8 lat temu
rodzic
commit
0447f00bb1

+ 1 - 1
Source/BansheeEngine/Source/BsIBLUtility.cpp

@@ -364,7 +364,7 @@ namespace bs { namespace ct
 				src->copy(dst, face, srcMip, face, dstMip);
 		}
 		else
-			downsampleCubemap(src, srcMip, dst, dstMip);
+			downsampleCubemap(scratchTex, srcMip, dst, dstMip);
 	}
 
 	void IBLUtility::downsampleCubemap(const SPtr<Texture>& src, UINT32 srcMip, const SPtr<Texture>& dst, UINT32 dstMip)

+ 7 - 1
Source/BansheeVulkanRenderAPI/Source/BsVulkanTextureManager.cpp

@@ -4,6 +4,7 @@
 #include "BsVulkanTexture.h"
 #include "BsVulkanRenderTexture.h"
 #include "BsVulkanResource.h"
+#include "BsVulkanUtility.h"
 
 namespace bs
 {
@@ -16,7 +17,12 @@ namespace bs
 
 	PixelFormat VulkanTextureManager::getNativeFormat(TextureType ttype, PixelFormat format, int usage, bool hwGamma)
 	{
-		return PF_R8G8B8A8;;
+		PixelUtil::checkFormat(format, ttype, usage);
+
+		if (ct::VulkanUtility::getPixelFormat(format, hwGamma) == VK_FORMAT_UNDEFINED)
+			return PF_R8G8B8A8;
+
+		return format;
 	}
 
 	namespace ct