OGL: Get rid of some explicit deletes in Render
This commit is contained in:
parent
ca7fe09f1a
commit
eeb0f0b7c4
|
@ -6,6 +6,7 @@
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -1017,14 +1018,12 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
|
||||||
g_renderer->RestoreAPIState();
|
g_renderer->RestoreAPIState();
|
||||||
}
|
}
|
||||||
|
|
||||||
float* depthMap = new float[targetPixelRcWidth * targetPixelRcHeight];
|
std::unique_ptr<float> depthMap(new float[targetPixelRcWidth * targetPixelRcHeight]);
|
||||||
|
|
||||||
glReadPixels(targetPixelRc.left, targetPixelRc.bottom, targetPixelRcWidth, targetPixelRcHeight,
|
glReadPixels(targetPixelRc.left, targetPixelRc.bottom, targetPixelRcWidth, targetPixelRcHeight,
|
||||||
GL_DEPTH_COMPONENT, GL_FLOAT, depthMap);
|
GL_DEPTH_COMPONENT, GL_FLOAT, depthMap.get());
|
||||||
|
|
||||||
UpdateEFBCache(type, cacheRectIdx, efbPixelRc, targetPixelRc, depthMap);
|
UpdateEFBCache(type, cacheRectIdx, efbPixelRc, targetPixelRc, depthMap.get());
|
||||||
|
|
||||||
delete[] depthMap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 xRect = x % EFB_CACHE_RECT_SIZE;
|
u32 xRect = x % EFB_CACHE_RECT_SIZE;
|
||||||
|
@ -1061,19 +1060,17 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
|
||||||
g_renderer->RestoreAPIState();
|
g_renderer->RestoreAPIState();
|
||||||
}
|
}
|
||||||
|
|
||||||
u32* colorMap = new u32[targetPixelRcWidth * targetPixelRcHeight];
|
std::unique_ptr<u32> colorMap(new u32[targetPixelRcWidth * targetPixelRcHeight]);
|
||||||
|
|
||||||
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3)
|
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGLES3)
|
||||||
// XXX: Swap colours
|
// XXX: Swap colours
|
||||||
glReadPixels(targetPixelRc.left, targetPixelRc.bottom, targetPixelRcWidth, targetPixelRcHeight,
|
glReadPixels(targetPixelRc.left, targetPixelRc.bottom, targetPixelRcWidth, targetPixelRcHeight,
|
||||||
GL_RGBA, GL_UNSIGNED_BYTE, colorMap);
|
GL_RGBA, GL_UNSIGNED_BYTE, colorMap.get());
|
||||||
else
|
else
|
||||||
glReadPixels(targetPixelRc.left, targetPixelRc.bottom, targetPixelRcWidth, targetPixelRcHeight,
|
glReadPixels(targetPixelRc.left, targetPixelRc.bottom, targetPixelRcWidth, targetPixelRcHeight,
|
||||||
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, colorMap);
|
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, colorMap.get());
|
||||||
|
|
||||||
UpdateEFBCache(type, cacheRectIdx, efbPixelRc, targetPixelRc, colorMap);
|
UpdateEFBCache(type, cacheRectIdx, efbPixelRc, targetPixelRc, colorMap.get());
|
||||||
|
|
||||||
delete[] colorMap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 xRect = x % EFB_CACHE_RECT_SIZE;
|
u32 xRect = x % EFB_CACHE_RECT_SIZE;
|
||||||
|
|
Loading…
Reference in New Issue