Skip to content
Permalink
Browse files

- fix wipe screen when using -loadgame

  • Loading branch information...
dpjudas committed Jun 10, 2019
1 parent 037b69c commit 8853872bb444ee1c5563ce5b7872daa6342988a9
Showing with 26 additions and 9 deletions.
  1. +6 −6 src/rendering/vulkan/system/vk_framebuffer.cpp
  2. +20 −3 src/rendering/vulkan/textures/vk_hwtexture.cpp
@@ -716,11 +716,12 @@ void VulkanFrameBuffer::UpdatePalette()

FTexture *VulkanFrameBuffer::WipeStartScreen()
{
const auto &viewport = screen->mScreenViewport;
auto tex = new FWrapperTexture(viewport.width, viewport.height, 1);
SetViewportRects(nullptr);

auto tex = new FWrapperTexture(mScreenViewport.width, mScreenViewport.height, 1);
auto systex = static_cast<VkHardwareTexture*>(tex->GetSystemTexture());

systex->CreateWipeTexture(viewport.width, viewport.height, "WipeStartScreen");
systex->CreateWipeTexture(mScreenViewport.width, mScreenViewport.height, "WipeStartScreen");

return tex;
}
@@ -731,11 +732,10 @@ FTexture *VulkanFrameBuffer::WipeEndScreen()
Draw2D();
Clear2D();

const auto &viewport = screen->mScreenViewport;
auto tex = new FWrapperTexture(viewport.width, viewport.height, 1);
auto tex = new FWrapperTexture(mScreenViewport.width, mScreenViewport.height, 1);
auto systex = static_cast<VkHardwareTexture*>(tex->GetSystemTexture());

systex->CreateWipeTexture(viewport.width, viewport.height, "WipeEndScreen");
systex->CreateWipeTexture(mScreenViewport.width, mScreenViewport.height, "WipeEndScreen");

return tex;
}
@@ -382,8 +382,25 @@ void VkHardwareTexture::CreateWipeTexture(int w, int h, const char *name)
{
// hwrenderer asked image data from a frame buffer that was never written into. Let's give it that..
// (ideally the hwrenderer wouldn't do this, but the calling code is too complex for me to fix)
VkImageTransition transition;
transition.addImage(&mImage, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, true);
transition.execute(fb->GetTransferCommands());

VkImageTransition transition0;
transition0.addImage(&mImage, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, true);
transition0.execute(fb->GetTransferCommands());

VkImageSubresourceRange range = {};
range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
range.layerCount = 1;
range.levelCount = 1;

VkClearColorValue value = {};
value.float32[0] = 0.0f;
value.float32[1] = 0.0f;
value.float32[2] = 0.0f;
value.float32[3] = 1.0f;
fb->GetTransferCommands()->clearColorImage(mImage.Image->image, mImage.Layout, &value, 1, &range);

VkImageTransition transition1;
transition1.addImage(&mImage, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, false);
transition1.execute(fb->GetTransferCommands());
}
}

0 comments on commit 8853872

Please sign in to comment.
You can’t perform that action at this time.