Skip to content

Commit b1c0f56

Browse files
author
devsh
committed
fix dependant reporting in ICPUGraphicsPipeline
1 parent 08b8a38 commit b1c0f56

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

include/nbl/asset/ICPUGraphicsPipeline.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ICPUGraphicsPipeline final : public ICPUPipeline<IGraphicsPipeline<ICPUPip
4646

4747
inline size_t getDependantCount() const override
4848
{
49-
auto stageCount = 1; // the layout
49+
auto stageCount = 2; // the layout and renderpass
5050
for (const auto& stage : m_stages)
5151
if (stage.shader)
5252
stageCount++;
@@ -79,12 +79,16 @@ class ICPUGraphicsPipeline final : public ICPUPipeline<IGraphicsPipeline<ICPUPip
7979
}
8080
inline IAsset* getDependant_impl(const size_t ix) override
8181
{
82+
if (ix==0)
83+
return m_layout.get();
84+
if (ix==1)
85+
return m_renderpass.get();
8286
size_t stageCount = 0;
8387
for (auto& stage : m_stages)
8488
if (stage.shader)
85-
if ((stageCount++)==ix)
89+
if ((stageCount++)==ix-2)
8690
return stage.shader.get();
87-
return m_layout.get();
91+
return nullptr;
8892
}
8993

9094
inline int8_t stageToIndex(const ICPUShader::E_SHADER_STAGE stage) const override

0 commit comments

Comments
 (0)