From e0907f62d52bcc50cd997e7f2c7e304ea4524450 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 14 Jun 2022 01:59:46 +0200 Subject: [PATCH] Use a black lightmap texture rather than an undefined one (NV and AMD differ on the contents of undefined textures) --- .../rendering/vulkan/textures/vk_texture.cpp | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/common/rendering/vulkan/textures/vk_texture.cpp b/src/common/rendering/vulkan/textures/vk_texture.cpp index bb9ca23d6..406034525 100644 --- a/src/common/rendering/vulkan/textures/vk_texture.cpp +++ b/src/common/rendering/vulkan/textures/vk_texture.cpp @@ -181,22 +181,12 @@ void VkTextureManager::CreateShadowmap() void VkTextureManager::CreateLightmap() { - ImageBuilder builder; - builder.setSize(1, 1); - builder.setFormat(VK_FORMAT_R16G16B16A16_SFLOAT); - builder.setUsage(VK_IMAGE_USAGE_SAMPLED_BIT); - Lightmap.Image = builder.create(fb->device); - Lightmap.Image->SetDebugName("VkRenderBuffers.Lightmap"); - - ImageViewBuilder viewbuilder; - viewbuilder.setType(VK_IMAGE_VIEW_TYPE_2D_ARRAY); - viewbuilder.setImage(Lightmap.Image.get(), VK_FORMAT_R16G16B16A16_SFLOAT); - Lightmap.View = viewbuilder.create(fb->device); - Lightmap.View->SetDebugName("VkRenderBuffers.LightmapView"); - - VkImageTransition barrier; - barrier.addImage(&Lightmap, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, true); - barrier.execute(fb->GetCommands()->GetDrawCommands()); + TArray data; + data.Push(0); + data.Push(0); + data.Push(0); + data.Push(0x3c00); // half-float 1.0 + SetLightmap(1, 1, data); } void VkTextureManager::SetLightmap(int LMTextureSize, int LMTextureCount, const TArray& LMTextureData)