mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-31 04:50:48 +00:00
- fix palette color problem
This commit is contained in:
parent
96547713d9
commit
b4154f1772
2 changed files with 7 additions and 2 deletions
|
@ -61,6 +61,7 @@ VulkanFrameBuffer::VulkanFrameBuffer(void *hMonitor, bool fullscreen, VulkanDevi
|
|||
{
|
||||
device = dev;
|
||||
SetViewportRects(nullptr);
|
||||
InitPalette();
|
||||
}
|
||||
|
||||
VulkanFrameBuffer::~VulkanFrameBuffer()
|
||||
|
@ -264,6 +265,8 @@ void VulkanFrameBuffer::SetVSync(bool vsync)
|
|||
|
||||
void VulkanFrameBuffer::CleanForRestart()
|
||||
{
|
||||
// force recreation of the SW scene drawer to ensure it gets a new set of resources.
|
||||
swdrawer.reset();
|
||||
}
|
||||
|
||||
IHardwareTexture *VulkanFrameBuffer::CreateHardwareTexture()
|
||||
|
|
|
@ -213,8 +213,10 @@ void VkHardwareTexture::AllocateBuffer(int w, int h, int texelsize)
|
|||
{
|
||||
auto fb = GetVulkanFrameBuffer();
|
||||
|
||||
VkFormat format = texelsize == 4 ? VK_FORMAT_B8G8R8A8_UNORM : VK_FORMAT_R8_UNORM;
|
||||
|
||||
ImageBuilder imgbuilder;
|
||||
imgbuilder.setFormat(VK_FORMAT_B8G8R8A8_UNORM);
|
||||
imgbuilder.setFormat(format);
|
||||
imgbuilder.setSize(w, h);
|
||||
imgbuilder.setUsage(VK_IMAGE_USAGE_SAMPLED_BIT, VMA_MEMORY_USAGE_CPU_TO_GPU);
|
||||
imgbuilder.setLinearTiling();
|
||||
|
@ -223,7 +225,7 @@ void VkHardwareTexture::AllocateBuffer(int w, int h, int texelsize)
|
|||
mTexelsize = texelsize;
|
||||
|
||||
ImageViewBuilder viewbuilder;
|
||||
viewbuilder.setImage(mImage.get(), texelsize == 4 ? VK_FORMAT_B8G8R8A8_UNORM : VK_FORMAT_R8_UNORM);
|
||||
viewbuilder.setImage(mImage.get(), format);
|
||||
mImageView = viewbuilder.create(fb->device);
|
||||
|
||||
auto cmdbuffer = fb->GetUploadCommands();
|
||||
|
|
Loading…
Reference in a new issue