mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
Use a black lightmap texture rather than an undefined one (NV and AMD differ on the contents of undefined textures)
This commit is contained in:
parent
0f08a0f511
commit
e0907f62d5
1 changed files with 6 additions and 16 deletions
|
@ -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<uint16_t> 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<uint16_t>& LMTextureData)
|
||||
|
|
Loading…
Reference in a new issue