enigma-dev / enigma-dev

The Extensible Non-Interpreted Game Maker Augmentation.
http://enigma-dev.org
333 stars 121 forks source link

glGetTexImage isn't compatible with GLES #1961

Open fundies opened 4 years ago

fundies commented 4 years ago

glteximage is used in gl common sources and it isn't compatible with gles. These functions are used in a few tests and prevent the harness from running gles.

RobertBColton commented 4 years ago

The solution to this is to draw the texture on a surface/fbo and then read back the data from the surface/fbo. While initially this may be slow, we could cache the surface we use to accomplish this.

The alternative to this is that we don't delete texture data after upload and always keep a system memory copy around. We discussed this problem quite a bit for Direct3D9 because like original GM things like the screen saver could destroy surfaces and textures and necessitate a device reset. However, keeping a system memory copy is also trickier to keep synchronized with what's actually on the GPU plus it decreases the total RAM available for the game to use.