mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-29 05:17:58 +03:00
fix threading issue when dispatching frame dependent data
This commit is contained in:
parent
c7449dc272
commit
acc209c294
6 changed files with 34 additions and 34 deletions
|
@ -59,9 +59,11 @@ namespace fx
|
|||
osg::ref_ptr<osg::StateSet> mStateSet = new osg::StateSet;
|
||||
osg::ref_ptr<osg::FrameBufferObject> mRenderTarget;
|
||||
osg::ref_ptr<osg::Texture2D> mRenderTexture;
|
||||
bool mResolve = false;
|
||||
|
||||
SubPass(const SubPass& other, const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY)
|
||||
: mStateSet(new osg::StateSet(*other.mStateSet, copyOp))
|
||||
, mResolve(other.mResolve)
|
||||
{
|
||||
if (other.mRenderTarget)
|
||||
mRenderTarget = new osg::FrameBufferObject(*other.mRenderTarget, copyOp);
|
||||
|
@ -70,6 +72,18 @@ namespace fx
|
|||
}
|
||||
};
|
||||
|
||||
void compile()
|
||||
{
|
||||
for (auto rit = mPasses.rbegin(); rit != mPasses.rend(); ++rit)
|
||||
{
|
||||
if (!rit->mRenderTarget)
|
||||
{
|
||||
rit->mResolve = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// not safe to read/write in draw thread
|
||||
std::shared_ptr<fx::Technique> mHandle = nullptr;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue