mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
Increase command queue memory pool to 16 MB and make it flush if its exhausted
This commit is contained in:
parent
db4cba239a
commit
ca9d8e580e
1 changed files with 8 additions and 3 deletions
|
@ -193,7 +193,7 @@ EXTERN_CVAR(Bool, r_mipmap)
|
||||||
// Manages queueing up commands and executing them on worker threads
|
// Manages queueing up commands and executing them on worker threads
|
||||||
class DrawerCommandQueue
|
class DrawerCommandQueue
|
||||||
{
|
{
|
||||||
enum { memorypool_size = 4 * 1024 * 1024 };
|
enum { memorypool_size = 16 * 1024 * 1024 };
|
||||||
char memorypool[memorypool_size];
|
char memorypool[memorypool_size];
|
||||||
size_t memorypool_pos = 0;
|
size_t memorypool_pos = 0;
|
||||||
|
|
||||||
|
@ -241,8 +241,13 @@ public:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
void *ptr = AllocMemory(sizeof(T));
|
void *ptr = AllocMemory(sizeof(T));
|
||||||
if (!ptr)
|
if (!ptr) // Out of memory - render what we got
|
||||||
return;
|
{
|
||||||
|
queue->Finish();
|
||||||
|
ptr = AllocMemory(sizeof(T));
|
||||||
|
if (!ptr)
|
||||||
|
return;
|
||||||
|
}
|
||||||
T *command = new (ptr)T(std::forward<Types>(args)...);
|
T *command = new (ptr)T(std::forward<Types>(args)...);
|
||||||
queue->commands.push_back(command);
|
queue->commands.push_back(command);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue