Skip to content

Commit

Permalink
Fix SceneLinearDepth texture using wrong size
Browse files Browse the repository at this point in the history
  • Loading branch information
dpjudas committed Sep 8, 2024
1 parent f8f4ef5 commit f41e7f0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/common/rendering/vulkan/textures/vk_renderbuffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ void VkRenderBuffers::BeginFrame(int width, int height, int sceneWidth, int scen
if (width != mWidth || height != mHeight || mSamples != samples)
CreateScene(width, height, samples);

if (sceneWidth != mSceneWidth || sceneHeight != mSceneHeight)
{
SceneLinearDepth.Reset(fb);
CreateSceneLinearDepth(std::max(sceneWidth, 1), std::max(sceneHeight, 1));
}

mWidth = width;
mHeight = height;
mSamples = samples;
Expand Down Expand Up @@ -174,13 +180,11 @@ void VkRenderBuffers::CreateScene(int width, int height, VkSampleCountFlagBits s
SceneDepthStencil.Reset(fb);
SceneNormal.Reset(fb);
SceneFog.Reset(fb);
SceneLinearDepth.Reset(fb);

CreateSceneColor(width, height, samples);
CreateSceneDepthStencil(width, height, samples);
CreateSceneNormal(width, height, samples);
CreateSceneFog(width, height, samples);
CreateSceneLinearDepth(width, height);

VkImageTransition()
.AddImage(&SceneColor, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, true)
Expand Down

0 comments on commit f41e7f0

Please sign in to comment.