mirror of https://github.com/AxioDL/boo.git
OpenGL deferred delete fix
This commit is contained in:
parent
b579e20bc6
commit
3e4ed5ad1f
|
@ -29,7 +29,7 @@ class IApplication
|
|||
public:
|
||||
virtual ~IApplication() {}
|
||||
|
||||
enum class EPlatformType : uint8_t
|
||||
enum class EPlatformType
|
||||
{
|
||||
Auto = 0,
|
||||
Wayland = 1,
|
||||
|
|
|
@ -793,7 +793,7 @@ struct GLCommandQueue : IGraphicsCommandQueue
|
|||
if (self->m_pendingFmtAdds.size())
|
||||
{
|
||||
for (GLVertexFormat* fmt : self->m_pendingFmtAdds)
|
||||
ConfigureVertexFormat(fmt);
|
||||
if (fmt) ConfigureVertexFormat(fmt);
|
||||
self->m_pendingFmtAdds.clear();
|
||||
}
|
||||
|
||||
|
@ -1028,6 +1028,15 @@ struct GLCommandQueue : IGraphicsCommandQueue
|
|||
void delVertexFormat(GLVertexFormat* fmt)
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(m_mt);
|
||||
bool foundAdd = false;
|
||||
for (GLVertexFormat*& afmt : m_pendingFmtAdds)
|
||||
if (afmt == fmt)
|
||||
{
|
||||
foundAdd = true;
|
||||
afmt = nullptr;
|
||||
break;
|
||||
}
|
||||
if (!foundAdd)
|
||||
m_pendingFmtDels.push_back({fmt->m_vao[0], fmt->m_vao[1], fmt->m_vao[2]});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue