Skip to content

Commit

Permalink
Traktor: Fixed Vulkan validation issues, one with gbuffer format and …
Browse files Browse the repository at this point in the history
…one in terrain culling.
  • Loading branch information
apistol78 committed Jun 11, 2024
1 parent ad7ba26 commit 1f38651
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions code/Terrain/TerrainComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ bool TerrainComponent::createPatches()
safeDestroy(m_indexBuffer);
safeDestroy(m_vertexBuffer);
safeDestroy(m_drawBuffer);
safeDestroy(m_culledDrawBuffer);
safeDestroy(m_dataBuffer);

const uint32_t heightfieldSize = m_heightfield->getSize();
Expand Down Expand Up @@ -844,15 +845,15 @@ bool TerrainComponent::createPatches()
const uint32_t alignedPatchCount = alignUp((uint32_t)m_patches.size(), 16);

m_drawBuffer = m_renderSystem->createBuffer(
render::BuIndirect,
render::BuStructured | render::BuIndirect,
alignedPatchCount * sizeof(render::IndexedIndirectDraw),
true
);
if (!m_drawBuffer)
return false;

m_culledDrawBuffer = m_renderSystem->createBuffer(
render::BuIndirect,
render::BuStructured | render::BuIndirect,
alignedPatchCount * sizeof(render::IndexedIndirectDraw),
false
);
Expand Down
2 changes: 1 addition & 1 deletion code/World/Shared/Passes/GBufferPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ render::handle_t GBufferPass::setup(
rgtd.targets[0].colorFormat = render::TfR16G16B16A16F; // (GBufferA) Depth (R), Normal (GBA)
rgtd.targets[1].colorFormat = render::TfR8G8B8A8; // (GBufferB) Albedo (RGB)
rgtd.targets[2].colorFormat = render::TfR8G8B8A8; // (GBufferC) Roughness (R), Metalness (G), Specular (B), Decal Response (A)
rgtd.targets[3].colorFormat = render::TfR10G10B10A2; // (GBufferD) Irradiance (RGB)
rgtd.targets[3].colorFormat = render::TfR8G8B8A8; // (GBufferD) Irradiance (RGB)

auto gbufferTargetSetId = renderGraph.addTransientTargetSet(L"GBuffer", rgtd, outputTargetSetId, outputTargetSetId);

Expand Down

0 comments on commit 1f38651

Please sign in to comment.