[Scummvm-git-logs] scummvm master -> bbd955faeea6e07873e759b55a88d332fe276593
aquadran
noreply at scummvm.org
Sun Feb 12 16:08:38 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
bbd955faee TINYGL: Allow parametrize DrawCallMemory size while creating context
Commit: bbd955faeea6e07873e759b55a88d332fe276593
https://github.com/scummvm/scummvm/commit/bbd955faeea6e07873e759b55a88d332fe276593
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2023-02-12T17:08:32+01:00
Commit Message:
TINYGL: Allow parametrize DrawCallMemory size while creating context
Changed paths:
engines/hpl1/engine/impl/low_level_graphics_tgl.cpp
graphics/tinygl/init.cpp
graphics/tinygl/tinygl.h
graphics/tinygl/zgl.h
diff --git a/engines/hpl1/engine/impl/low_level_graphics_tgl.cpp b/engines/hpl1/engine/impl/low_level_graphics_tgl.cpp
index e2a9a226973..13c78a0bc7e 100644
--- a/engines/hpl1/engine/impl/low_level_graphics_tgl.cpp
+++ b/engines/hpl1/engine/impl/low_level_graphics_tgl.cpp
@@ -354,7 +354,7 @@ bool LowLevelGraphicsTGL::Init(int alWidth, int alHeight, int alBpp, int abFulls
mlMultisampling = alMultisampling;
initGraphics(alWidth, alHeight, nullptr);
- TinyGL::createContext(alWidth, alHeight, mpPixelFormat, 256, false);
+ TinyGL::createContext(alWidth, alHeight, mpPixelFormat, 256, false, 60 * 1024 * 1024);
SetupGL();
ShowCursor(false);
g_system->updateScreen();
diff --git a/graphics/tinygl/init.cpp b/graphics/tinygl/init.cpp
index dafcb8f5156..d26f97fbc47 100644
--- a/graphics/tinygl/init.cpp
+++ b/graphics/tinygl/init.cpp
@@ -50,13 +50,15 @@ void GLContext::endSharedState() {
gl_free(s->texture_hash_table);
}
-void createContext(int screenW, int screenH, Graphics::PixelFormat pixelFormat, int textureSize, bool enableStencilBuffer, bool dirtyRectsEnable) {
+void createContext(int screenW, int screenH, Graphics::PixelFormat pixelFormat, int textureSize,
+ bool enableStencilBuffer, bool dirtyRectsEnable, uint32 drawCallMemorySize) {
assert(gl_ctx == nullptr);
gl_ctx = new GLContext();
- gl_ctx->init(screenW, screenH, pixelFormat, textureSize, enableStencilBuffer, dirtyRectsEnable);
+ gl_ctx->init(screenW, screenH, pixelFormat, textureSize, enableStencilBuffer, dirtyRectsEnable, drawCallMemorySize);
}
-void GLContext::init(int screenW, int screenH, Graphics::PixelFormat pixelFormat, int textureSize, bool enableStencilBuffer, bool dirtyRectsEnable) {
+void GLContext::init(int screenW, int screenH, Graphics::PixelFormat pixelFormat, int textureSize,
+ bool enableStencilBuffer, bool dirtyRectsEnable, uint32 drawCallMemorySize) {
GLViewport *v;
_enableDirtyRectangles = dirtyRectsEnable;
@@ -257,11 +259,9 @@ void GLContext::init(int screenW, int screenH, Graphics::PixelFormat pixelFormat
// color mask
color_mask_red = color_mask_green = color_mask_blue = color_mask_alpha = true;
- const size_t kDrawCallMemory = 60ULL * 1024ULL * 1024ULL;
-
_currentAllocatorIndex = 0;
- _drawCallAllocator[0].initialize(kDrawCallMemory);
- _drawCallAllocator[1].initialize(kDrawCallMemory);
+ _drawCallAllocator[0].initialize(drawCallMemorySize);
+ _drawCallAllocator[1].initialize(drawCallMemorySize);
_debugRectsEnabled = false;
_profilingEnabled = false;
diff --git a/graphics/tinygl/tinygl.h b/graphics/tinygl/tinygl.h
index 40729c13206..02a835e1a47 100644
--- a/graphics/tinygl/tinygl.h
+++ b/graphics/tinygl/tinygl.h
@@ -30,7 +30,8 @@
namespace TinyGL {
void createContext(int screenW, int screenH, Graphics::PixelFormat pixelFormat,
- int textureSize, bool enableStencilBuffer, bool dirtyRectsEnable = true);
+ int textureSize, bool enableStencilBuffer, bool dirtyRectsEnable,
+ uint32 drawCallMemorySize = 6 * 1024 * 1024);
void destroyContext();
void presentBuffer();
void presentBuffer(Common::List<Common::Rect> &dirtyAreas);
diff --git a/graphics/tinygl/zgl.h b/graphics/tinygl/zgl.h
index 055e4d8a46d..972f00d0b12 100644
--- a/graphics/tinygl/zgl.h
+++ b/graphics/tinygl/zgl.h
@@ -507,7 +507,8 @@ public:
void initSharedState();
void endSharedState();
- void init(int screenW, int screenH, Graphics::PixelFormat pixelFormat, int textureSize, bool enableStencilBuffer, bool dirtyRectsEnable = true);
+ void init(int screenW, int screenH, Graphics::PixelFormat pixelFormat, int textureSize,
+ bool enableStencilBuffer, bool dirtyRectsEnable, uint32 drawCallMemorySize);
void deinit();
void gl_print_matrix(const float *m);
More information about the Scummvm-git-logs
mailing list