mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-07 08:21:04 +00:00
- fix wrong layout and image format for the swap chain
This commit is contained in:
parent
ff68d2e651
commit
5581fbfd93
2 changed files with 9 additions and 1 deletions
|
@ -387,8 +387,11 @@ void VkPostprocess::RenderEffect(const FString &name)
|
||||||
key.InputTextures = step.Textures.Size();
|
key.InputTextures = step.Textures.Size();
|
||||||
key.Uniforms = step.Uniforms.Data.Size();
|
key.Uniforms = step.Uniforms.Data.Size();
|
||||||
key.Shader = mShaders[step.ShaderName].get();
|
key.Shader = mShaders[step.ShaderName].get();
|
||||||
|
key.SwapChain = (step.Output.Type == PPTextureType::SwapChain);
|
||||||
if (step.Output.Type == PPTextureType::PPTexture)
|
if (step.Output.Type == PPTextureType::PPTexture)
|
||||||
key.OutputFormat = mTextures[step.Output.Texture]->Format;
|
key.OutputFormat = mTextures[step.Output.Texture]->Format;
|
||||||
|
else if (step.Output.Type == PPTextureType::SwapChain)
|
||||||
|
key.OutputFormat = GetVulkanFrameBuffer()->device->swapChain->swapChainFormat.format;
|
||||||
else
|
else
|
||||||
key.OutputFormat = VK_FORMAT_R16G16B16A16_SFLOAT;
|
key.OutputFormat = VK_FORMAT_R16G16B16A16_SFLOAT;
|
||||||
|
|
||||||
|
@ -418,6 +421,7 @@ void VkPostprocess::RenderScreenQuad(VkPPRenderPassSetup *passSetup, VulkanDescr
|
||||||
beginInfo.setRenderPass(passSetup->RenderPass.get());
|
beginInfo.setRenderPass(passSetup->RenderPass.get());
|
||||||
beginInfo.setRenderArea(x, y, width, height);
|
beginInfo.setRenderArea(x, y, width, height);
|
||||||
beginInfo.setFramebuffer(framebuffer);
|
beginInfo.setFramebuffer(framebuffer);
|
||||||
|
beginInfo.addClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
|
||||||
VkViewport viewport = { };
|
VkViewport viewport = { };
|
||||||
viewport.x = x;
|
viewport.x = x;
|
||||||
|
@ -672,7 +676,10 @@ void VkPPRenderPassSetup::CreatePipeline(const VkPPRenderPassKey &key)
|
||||||
void VkPPRenderPassSetup::CreateRenderPass(const VkPPRenderPassKey &key)
|
void VkPPRenderPassSetup::CreateRenderPass(const VkPPRenderPassKey &key)
|
||||||
{
|
{
|
||||||
RenderPassBuilder builder;
|
RenderPassBuilder builder;
|
||||||
builder.addColorAttachment(false, key.OutputFormat, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
if (key.SwapChain)
|
||||||
|
builder.addColorAttachment(true, key.OutputFormat, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
|
||||||
|
else
|
||||||
|
builder.addColorAttachment(false, key.OutputFormat, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
||||||
builder.addSubpass();
|
builder.addSubpass();
|
||||||
builder.addSubpassColorAttachmentRef(0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
builder.addSubpassColorAttachmentRef(0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
||||||
builder.addExternalSubpassDependency(
|
builder.addExternalSubpassDependency(
|
||||||
|
|
|
@ -22,6 +22,7 @@ public:
|
||||||
int InputTextures;
|
int InputTextures;
|
||||||
PPBlendMode BlendMode;
|
PPBlendMode BlendMode;
|
||||||
VkFormat OutputFormat;
|
VkFormat OutputFormat;
|
||||||
|
int SwapChain;
|
||||||
|
|
||||||
bool operator<(const VkPPRenderPassKey &other) const { return memcmp(this, &other, sizeof(VkPPRenderPassKey)) < 0; }
|
bool operator<(const VkPPRenderPassKey &other) const { return memcmp(this, &other, sizeof(VkPPRenderPassKey)) < 0; }
|
||||||
bool operator==(const VkPPRenderPassKey &other) const { return memcmp(this, &other, sizeof(VkPPRenderPassKey)) == 0; }
|
bool operator==(const VkPPRenderPassKey &other) const { return memcmp(this, &other, sizeof(VkPPRenderPassKey)) == 0; }
|
||||||
|
|
Loading…
Reference in a new issue