made rendering work

This commit is contained in:
2026-02-05 11:10:40 +02:00
parent faae0bdcc7
commit 4bfbcaa4a6
22 changed files with 737 additions and 483 deletions

View File

@@ -16,6 +16,7 @@ void CVkRenderCommandList::SetRenderTarget( uint32_t uIndex, IImage *pImage )
{
SwitchRenderingStage(RENDERING_STAGE_SETUP_RASTER);
VulkanRenderOutput_t *pOutput = FindOrCreateRenderOutput(uIndex);
pOutput->m_stImage.m_eObjectType = FRAME_OBJECT_TYPE_SINGLE;
pOutput->m_stImage.m_pSingle = pImage;
}
@@ -44,6 +45,8 @@ void CVkRenderCommandList::SetClearDepth( float fVal)
void CVkRenderCommandList::SetRenderResolution( uint32_t iWidth, uint32_t iHeight )
{
SwitchRenderingStage(RENDERING_STAGE_SETUP_RASTER);
m_uWidth = iWidth;
m_uHeight = iHeight;
}
@@ -71,26 +74,31 @@ void CVkRenderCommandList::SetMaterial( IMaterial *pMaterial )
m_pCurrentMaterialBuffer->Reset();
CVkBeginCommand *pBeginCommand = CREATE_COMMAND(Begin);
pBeginCommand->images = m_pOutput;
pBeginCommand->nResolutionX = 1280;
pBeginCommand->nResolutionY = 720;
pBeginCommand->nResolutionX = m_uWidth;
pBeginCommand->nResolutionY = m_uHeight;
pBeginCommand->stDepthImage = m_depth;
for ( auto &i: pBeginCommand->images)
{
pBeginCommand->AddDependency(i.m_stImage.m_pSingle, DEPENDENCY_MODE_DRAWCALL_OUTPUT_IMAGE);
}
m_pCurrentMaterialBuffer->AddCommand(pBeginCommand);
CVkSetShaderCommand *pSetShader = CREATE_COMMAND(SetShader);
pSetShader->pShader = ((CVkMaterial*)pMaterial)->m_pVkShader;
m_pCurrentMaterialBuffer->AddCommand(pSetShader);
CVkSetScissorsCommand *pScissorsCommand = CREATE_COMMAND(SetScissors);
pScissorsCommand->uWidth = 1280;
pScissorsCommand->uHeight = 720;
pScissorsCommand->uWidth = m_uWidth;
pScissorsCommand->uHeight = m_uHeight;
m_pCurrentMaterialBuffer->AddCommand(pScissorsCommand);
CVkSetViewportCommand *pViewportCommand = CREATE_COMMAND(SetViewport);
pViewportCommand->fWidth = 1280;
pViewportCommand->fHeight = 720;
pViewportCommand->fX = 0;
pViewportCommand->fY = 0;
pViewportCommand->fWidth = m_uWidth;
pViewportCommand->fHeight = m_uHeight;
pViewportCommand->fDepthMin = 0;
pViewportCommand->fDepthMax = 1;
m_pCurrentMaterialBuffer->AddCommand(pViewportCommand);
}
}
@@ -190,7 +198,7 @@ IVkCommandBuffer *CVkRenderCommandList::FindOrCreateMaterialCommandBuffer( IMate
}
VulkanMaterialCommandBuffer_t mat;
mat.m_pCommandBuffer = g_pCommandBufferManager->CreateCommandBuffer();
mat.m_pCommandBuffer = m_pCommandBufferManager->CreateCommandBuffer();
mat.m_pMaterial = pMaterial;
m_materials.AppendTail(mat);
if (pbWasCreated)