mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-02 06:44:45 +00:00
Use AllocateMemoryPages() for the texcache buffers.
This commit is contained in:
parent
de79941ef4
commit
74dbd2b44c
@ -43,7 +43,6 @@ u32 RoundUpToPowerOf2(u32 v)
|
|||||||
|
|
||||||
TextureCache::TextureCache() {
|
TextureCache::TextureCache() {
|
||||||
lastBoundTexture = -1;
|
lastBoundTexture = -1;
|
||||||
// TODO: Switch to aligned allocations for alignment. AllocateMemoryPages would do the trick.
|
|
||||||
// This is 5MB of temporary storage. Might be possible to shrink it.
|
// This is 5MB of temporary storage. Might be possible to shrink it.
|
||||||
tmpTexBuf32.resize(1024 * 512); // 2MB
|
tmpTexBuf32.resize(1024 * 512); // 2MB
|
||||||
tmpTexBuf16.resize(1024 * 512); // 1MB
|
tmpTexBuf16.resize(1024 * 512); // 1MB
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../Globals.h"
|
#include "../Globals.h"
|
||||||
|
#include "Common/MemoryUtil.h"
|
||||||
#include "gfx_es2/fbo.h"
|
#include "gfx_es2/fbo.h"
|
||||||
#include "GPU/GPUState.h"
|
#include "GPU/GPUState.h"
|
||||||
|
|
||||||
@ -108,7 +109,7 @@ private:
|
|||||||
|
|
||||||
~SimpleBuf() {
|
~SimpleBuf() {
|
||||||
if (buf_ != NULL) {
|
if (buf_ != NULL) {
|
||||||
delete [] buf_;
|
FreeMemoryPages(buf_, size_ * sizeof(T));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,9 +121,9 @@ private:
|
|||||||
void resize(size_t size) {
|
void resize(size_t size) {
|
||||||
if (size_ < size) {
|
if (size_ < size) {
|
||||||
if (buf_ != NULL) {
|
if (buf_ != NULL) {
|
||||||
delete [] buf_;
|
FreeMemoryPages(buf_, size_ * sizeof(T));
|
||||||
}
|
}
|
||||||
buf_ = new T[size];
|
buf_ = (T *)AllocateMemoryPages(size * sizeof(T));
|
||||||
size_ = size;
|
size_ = size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user