mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-09 23:55:40 +12:00
[GPU] Converted Depth/Color Surfaces to a ring buffer
Additionally made the surface cache search hit for any address that lies in the surface. This should allow multiple races to be done in Mario Kart and fixes the intro video.
This commit is contained in:
parent
255947b2fc
commit
17b08a25fa
3 changed files with 10 additions and 6 deletions
|
@ -43,8 +43,8 @@ class Renderer {
|
||||||
float oldDepthOffset = 0.0;
|
float oldDepthOffset = 0.0;
|
||||||
bool oldDepthmapEnable = false;
|
bool oldDepthmapEnable = false;
|
||||||
|
|
||||||
SurfaceCache<DepthBuffer, 10> depthBufferCache;
|
SurfaceCache<DepthBuffer, 10, true> depthBufferCache;
|
||||||
SurfaceCache<ColourBuffer, 10> colourBufferCache;
|
SurfaceCache<ColourBuffer, 10, true> colourBufferCache;
|
||||||
SurfaceCache<Texture, 256, true> textureCache;
|
SurfaceCache<Texture, 256, true> textureCache;
|
||||||
|
|
||||||
OpenGL::uvec2 fbSize; // The size of the framebuffer (ie both the colour and depth buffer)'
|
OpenGL::uvec2 fbSize; // The size of the framebuffer (ie both the colour and depth buffer)'
|
||||||
|
|
|
@ -46,7 +46,7 @@ public:
|
||||||
|
|
||||||
OptionalRef findFromAddress(u32 address) {
|
OptionalRef findFromAddress(u32 address) {
|
||||||
for (auto& e : buffer) {
|
for (auto& e : buffer) {
|
||||||
if (e.location == address && e.valid)
|
if (e.location <= address && e.location+e.sizeInBytes() > address && e.valid)
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,10 @@ struct ColourBuffer {
|
||||||
void free() {
|
void free() {
|
||||||
valid = false;
|
valid = false;
|
||||||
|
|
||||||
if (texture.exists() || fbo.exists())
|
if (texture.exists() || fbo.exists()){
|
||||||
Helpers::panic("Make this buffer free itself");
|
texture.free();
|
||||||
|
fbo.free();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool matches(ColourBuffer& other) {
|
bool matches(ColourBuffer& other) {
|
||||||
|
@ -128,8 +130,10 @@ struct DepthBuffer {
|
||||||
}
|
}
|
||||||
|
|
||||||
void free() {
|
void free() {
|
||||||
|
if(texture.exists()){
|
||||||
|
texture.free();
|
||||||
|
}
|
||||||
valid = false;
|
valid = false;
|
||||||
printf("Make this depth buffer free itself\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool matches(DepthBuffer& other) {
|
bool matches(DepthBuffer& other) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue