Add commitPendingTransaction

This commit is contained in:
Henrique Gemignani Passos Lima 2021-07-01 18:30:50 +03:00
parent c7c1162bd3
commit c6aed360e6
2 changed files with 11 additions and 4 deletions

View File

@ -280,6 +280,7 @@ struct IGraphicsDataFactory {
virtual void lazyCommitTransaction(const std::function<bool(Context& ctx)>& f __BooTraceArgs) {
commitTransaction(f __BooTraceArgsUse);
}
virtual void commitPendingTransaction() {}
virtual ObjToken<IGraphicsBufferD> newPoolBuffer(BufferUse use, size_t stride, size_t count __BooTraceArgs) = 0;
virtual void setDisplayGamma(float gamma) = 0;
virtual bool isTessellationSupported(uint32_t& maxPatchSizeOut) = 0;

View File

@ -136,6 +136,7 @@ public:
void commitTransaction(const FactoryCommitFunc& __BooTraceArgs) override;
void lazyCommitTransaction(const FactoryCommitFunc& __BooTraceArgs) override;
void commitPendingTransaction() override;
boo::ObjToken<IGraphicsBufferD> newPoolBuffer(BufferUse use, size_t stride, size_t count __BooTraceArgs) override;
@ -3800,10 +3801,7 @@ void VulkanDataFactoryImpl::commitTransaction(
if (!trans(ctx)) {
return;
}
if (m_lazyContext) {
flushContext(*m_lazyContext);
m_lazyContext.reset();
}
commitPendingTransaction();
flushContext(ctx);
}
@ -3816,7 +3814,15 @@ void VulkanDataFactoryImpl::lazyCommitTransaction(
trans(*m_lazyContext);
}
void VulkanDataFactoryImpl::commitPendingTransaction() {
if (m_lazyContext) {
flushContext(*m_lazyContext);
m_lazyContext.reset();
}
}
void VulkanDataFactoryImpl::flushContext(Context& ctx) {
OPTICK_EVENT();
VulkanData* data = ctx.m_data.cast<VulkanData>();
/* Start asynchronous shader compiles */