Dequeue error when adding lots of DrawStates
danhambleton opened this issue · 1 comments
danhambleton commented
I'm writing an app the has to render a lot of meshes. In the default Gfx config I can create up to 128 objects in the scene like this:
DrawState ds;
ds.Mesh[0] = Oryol::Gfx::CreateResource(*meshDisplayData.meshSetup.get());
ds.Pipeline = sceneTransient->phongPipeline;
This creates a new DrawState for each object. However, after 128 of these I get an error in Queue.h:
template<class TYPE> TYPE
Queue<TYPE>::Dequeue() {
o_assert_dbg(this->buffer.size() > 0);
return std::move(this->buffer.popFront());
}
I can fix this by adjusting the DefaultResourcePoolSize in GfxConfig.h. Is there another way?
floooh commented
You can pass pool sizes for all resource types in the Gfx::Setup() call, for instance see the BlendTest sample, which increases the pool size for Pipeline objects to 512:
oryol/code/Samples/BlendTest/BlendTest.cc
Lines 29 to 31 in 255de11