lots of updates
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
#include "vulkan_state.h"
|
||||
#include "commands.h"
|
||||
|
||||
CVkRenderCommandList::~CVkRenderCommandList()
|
||||
{
|
||||
ResetRendering();
|
||||
}
|
||||
|
||||
|
||||
void CVkRenderCommandList::ResetRendering()
|
||||
{
|
||||
/*
|
||||
for ( auto m: m_materials)
|
||||
for ( auto m: m_materials )
|
||||
{
|
||||
delete m.m_pCommandBuffer;
|
||||
m_pCommandBufferManager->FreeCommandBufferWithCommands(m.m_pCommandBuffer);
|
||||
}
|
||||
*/
|
||||
m_materials = {};
|
||||
}
|
||||
|
||||
@@ -33,7 +37,15 @@ void CVkRenderCommandList::SetClearColor( uint32_t uIndex, float r, float g, flo
|
||||
void CVkRenderCommandList::SetDepthTarget( IImage *pDepth )
|
||||
{
|
||||
SwitchRenderingStage(RENDERING_STAGE_SETUP_RASTER);
|
||||
m_depth.m_stImage.m_pSingle = pDepth;
|
||||
if (pDepth)
|
||||
{
|
||||
m_bDepthEnabled = true;
|
||||
m_depth.m_stImage.m_pSingle = pDepth;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bDepthEnabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
void CVkRenderCommandList::SetClearDepth( float fVal)
|
||||
@@ -76,11 +88,17 @@ void CVkRenderCommandList::SetMaterial( IMaterial *pMaterial )
|
||||
pBeginCommand->images = m_pOutput;
|
||||
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);
|
||||
}
|
||||
if ( m_bDepthEnabled )
|
||||
{
|
||||
pBeginCommand->AddDependency(m_depth.m_stImage.m_pSingle, DEPENDENCY_MODE_DRAWCALL_OUTPUT_DEPTH_IMAGE);
|
||||
pBeginCommand->bDepthEnabled = m_bDepthEnabled;
|
||||
pBeginCommand->stDepthImage = m_depth;
|
||||
|
||||
}
|
||||
m_pCurrentMaterialBuffer->AddCommand(pBeginCommand);
|
||||
|
||||
CVkSetShaderCommand *pSetShader = CREATE_COMMAND(SetShader);
|
||||
@@ -207,5 +225,5 @@ IVkCommandBuffer *CVkRenderCommandList::FindOrCreateMaterialCommandBuffer( IMate
|
||||
m_materials.AppendTail(mat);
|
||||
if (pbWasCreated)
|
||||
*pbWasCreated = true;
|
||||
return m_materials.GetLast().m_pCommandBuffer;
|
||||
return m_materials[m_materials.GetSize()-1].m_pCommandBuffer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user