Skip to content

Commit d435e60

Browse files
devshkeptsecret
authored andcommitted
fix bugs introduced to example 24, the overflow submit Xfer & compute strategy fot messed up
1 parent f085ccf commit d435e60

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

include/nbl/asset/ICPUImage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class NBL_API2 ICPUImage final : public IImage, public IPreHashed
202202
inline ICPUImage(const SCreationParams& _params) : IImage(_params) {}
203203
virtual ~ICPUImage() = default;
204204

205-
inline IAsset* getDependant_impl(const size_t ix) override {return buffer.get();}
205+
inline IAsset* getDependant_impl(const size_t ix) override {return nullptr;}
206206

207207
inline void discardContent_impl() override
208208
{

include/nbl/video/IDeviceMemoryAllocation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ TO COPY BETWEEN MEMORY ALLOCATIONS you need to have them bound to
2222
one or two IGPUBuffers and execute IVideoDriver::copyBuffer between them.
2323
We only support persistently mapped buffers with ARB_buffer_storage.
2424
Please don't ask us to support Buffer Orphaning. */
25-
class IDeviceMemoryAllocation : public virtual core::IReferenceCounted
25+
class NBL_API2 IDeviceMemoryAllocation : public virtual core::IReferenceCounted
2626
{
2727
public:
2828
//! Access flags for how the application plans to use mapped memory (if any)

src/nbl/video/utilities/CAssetConverter.cpp

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4003,20 +4003,27 @@ ISemaphore::future_t<IQueue::RESULT> CAssetConverter::convert_impl(SReserveResul
40034003
// there might be some QFOT releases from transfer to compute which need to happen before we execute Compute
40044004
auto drain = [&]()->bool
40054005
{
4006-
if (item.recomputeMips && transferBarriers.empty())
4007-
return drainCompute()==IQueue::RESULT::SUCCESS;
4008-
else if (pipelineBarrier(xferCmdBuf,{.memBarriers={},.bufBarriers={},.imgBarriers=transferBarriers},"Recording QFOT Release from Transfer Queue Familye after overflow failed"))
4006+
// Transfer and Compute barriers get recorded for image individually (see the TODO why its horrible)
4007+
// so we only need to worry about QFOTs for current image if they even exist
4008+
if (item.recomputeMips && !transferBarriers.empty())
40094009
{
4010-
if (drainBoth()!=IQueue::RESULT::SUCCESS)
4010+
// so now we need a immeidate QFOT Release cause we already recorded some compute mipmapping for current image
4011+
if (pipelineBarrier(xferCmdBuf,{.memBarriers={},.bufBarriers={},.imgBarriers=transferBarriers},"Recording QFOT Release from Transfer Queue Family after overflow failed"))
4012+
{
4013+
// a transfer microsubmit just for QFOT Release will need to be performed before Compute
4014+
if (drainBoth()!=IQueue::RESULT::SUCCESS)
4015+
return false;
4016+
transferBarriers.clear();
4017+
}
4018+
else
4019+
{
4020+
markFailureInStaging("Image QFOT Pipeline Barrier",item.canonical,image,pFoundHash);
40114021
return false;
4012-
transferBarriers.clear();
4013-
}
4014-
else
4015-
{
4016-
markFailureInStaging("Image QFOT Pipeline Barrier",item.canonical,image,pFoundHash);
4017-
return false;
4022+
}
4023+
return true;
40184024
}
4019-
return true;
4025+
else // Transfer just got submitted due to staging buffer overflow, compute has all the data required to start
4026+
return drainCompute()==IQueue::RESULT::SUCCESS;
40204027
};
40214028
//
40224029
using layout_t = IGPUImage::LAYOUT;

0 commit comments

Comments
 (0)