mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-02 22:01:41 +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()
|
void VkTextureManager::CreateLightmap()
|
||||||
{
|
{
|
||||||
ImageBuilder builder;
|
TArray<uint16_t> data;
|
||||||
builder.setSize(1, 1);
|
data.Push(0);
|
||||||
builder.setFormat(VK_FORMAT_R16G16B16A16_SFLOAT);
|
data.Push(0);
|
||||||
builder.setUsage(VK_IMAGE_USAGE_SAMPLED_BIT);
|
data.Push(0);
|
||||||
Lightmap.Image = builder.create(fb->device);
|
data.Push(0x3c00); // half-float 1.0
|
||||||
Lightmap.Image->SetDebugName("VkRenderBuffers.Lightmap");
|
SetLightmap(1, 1, data);
|
||||||
|
|
||||||
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());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VkTextureManager::SetLightmap(int LMTextureSize, int LMTextureCount, const TArray<uint16_t>& LMTextureData)
|
void VkTextureManager::SetLightmap(int LMTextureSize, int LMTextureCount, const TArray<uint16_t>& LMTextureData)
|
||||||
|
|
Loading…
Reference in a new issue