http://www.cplusplus.com/reference/list/list/erase/
cplusplus.com says that std::list::erase takes arguments
of const_iterator, but from build errors the Andriod
runtime says it takes non const iterators. gcc doesn't mind
removing the constness and it's not so important that they're
const, so I'm removing them.
I change the currently used 'map' of textures to a queue (implemented as a
list), and then remove from the end of the queue when textures need removing
from the cache, and adding to the beginning of the queue.
The other operation that is needed is moving the texture to the
front of the list whenever it is used, so that frequently used
textures are not deleted.
In order to make that last operation effecient, I created
a map of the locations of these textures, and keep that
properly updated. This makes the accessing of a texture still O(1).
Then, in order to have the iterators remain valid through insertions
and deletions, I needed to implement the queue as a list.
The map and queue implementation is a standard way to implement
an LRU cache, just FYI. Not something I thought of all on my own.
Fixes issue #744
Adreno drivers for GLES3 GPU have issues with glBufferSubData.
glBufferData works without issues, so we have to use only glBufferData
for Adreno by the cost of reallocating the data store.
Pokemon Stadium can change REG.VI_ORIGIN without call to VI_UpdateScreen(),
at least with Project64. Thus, frame buffer allocation may work with
obsolete VI info, which causes various glitches, e.g #415
The game copies current frame buffer to the area, which initially allocated for depth buffer.
Game read camera data from that area, not from normal frame buffer.
That's why 'copy color buffer to RDRAM' option does not help there.
Special code needed to process that. Looks ugly, but works.
Fix problem with Majora's Mask subscreen after Bomber's Notebook read, #698
The game switches to interlaced mode when it opens Notebook screen and background buffer is removed.
This hack prevents buffers clear on VI change.
This is actually a hack. Rect functions use vertex color and alpha set to zero.
This hack is done to fix issue #721 in Pokemon Stadium 2. The game uses
texrects to render images in the auxiliary buffer. The texrects use SHADE
for alpha combiner. Since alpha is zero, the rendered image in the auxiliary buffer
has zero alpha. When the auxiliary buffer is used as texture, it is blended with
background, and zero alpha makes it invisible. I set vertex alpha to 1 to avoid it.
When N64 saves pixel to 16bit frame buffer, it uses pixel coverage for alpha value to store,
not calculated pixel's alpha. Thus, on real N64 the auxiliary buffer will have
full alpha and blending will not make it invisible. Thus, true emulation will
require pixel coverage calculation and shader-based blending.
We were calling glTexStorage2DMultisample with a 'samples' parameter of 0.
Reading the GL 4.4 spec, this is specifically forbidden, but the
documentation pages from Chronos were incorrectly stating that it was
allowed, so many implementations probably accept it. Mesa, the graphics
driver for many Linux cards has recently been corrected so that it emits
a warning and fails when glTexStorage2DMultisample is called with
samples=0. The current release works, but the next one will fail when
multisampling is turned off in this plugin (with multisampling turned
on, it will work the same as before).
The documentation pages from Kronos have since been updated to reflect
the GL spec (I put in a bug to them). You can see the proper
changes at this address
(https://www.opengl.org/wiki/GLAPI/glTexStorage2DMultisample).
I called getRevision.sh from a directory other than src and I ended
up with an unexpected Revision.h in my current directory without
placing one in src. This modifies the script to place the header
file in the same directory as the script.
This reverts commit de32176303.
This commit causes regressions:
In Pokemon Stadium when starting a battle one portrait can be missing
failed assertion in framebuffer.cpp Line:580 Expression checkFBO()