More GPU cleaning, removing uses of GPUState.h where not needed.

Want to get rid of direct accesses to GPUState in modules that may be reused in
my future next-gen backends, that will reformat display lists into command lists that will
then be optimized and executed, out of sync with the real GPUState.

Candidate modules that may be reused in full are Framebuffer and Depal, possibly TextureCache to some degree.
This commit is contained in:
Henrik Rydgard committed 2015-07-29 12:37:49 +02:00
1 parent 33246ffc8d
commit 2430c283a5
34 files changed
+343 -306

No files matched your search

+36
View File
@@ -18,6 +18,9 @@
#include "ext/xxhash.h"
#include "Common/CPUDetect.h"
#include "Common/ColorConv.h"
#include "GPU/GPU.h"
#include "GPU/GPUState.h"
#include "GPU/Common/TextureDecoder.h"
// NEON is in a separate file so that it can be compiled with a runtime check.
#include "GPU/Common/TextureDecoderNEON.h"
@@ -64,6 +67,39 @@ u32 QuickTexHashSSE2(const void *checkp, u32 size) {
}
#endif
// Masks to downalign bufw to 16 bytes, and wrap at 2048.
static const u32 textureAlignMask16[16] = {
0x7FF & ~(((8 * 16) / 16) - 1), //GE_TFMT_5650,
0x7FF & ~(((8 * 16) / 16) - 1), //GE_TFMT_5551,
0x7FF & ~(((8 * 16) / 16) - 1), //GE_TFMT_4444,
0x7FF & ~(((8 * 16) / 32) - 1), //GE_TFMT_8888,
0x7FF & ~(((8 * 16) / 4) - 1), //GE_TFMT_CLUT4,
0x7FF & ~(((8 * 16) / 8) - 1), //GE_TFMT_CLUT8,
0x7FF & ~(((8 * 16) / 16) - 1), //GE_TFMT_CLUT16,
0x7FF & ~(((8 * 16) / 32) - 1), //GE_TFMT_CLUT32,
0x7FF, //GE_TFMT_DXT1,
0x7FF, //GE_TFMT_DXT3,
0x7FF, //GE_TFMT_DXT5,
0, // INVALID,
0, // INVALID,
0, // INVALID,
0, // INVALID,
0, // INVALID,
};
u32 GetTextureBufw(int level, u32 texaddr, GETextureFormat format) {
// This is a hack to allow for us to draw the huge PPGe texture, which is always in kernel ram.
if (texaddr < PSP_GetKernelMemoryEnd())
return gstate.texbufwidth[level] & 0x1FFF;
u32 bufw = gstate.texbufwidth[level] & textureAlignMask16[format];
if (bufw == 0) {
// If it's less than 16 bytes, use 16 bytes.
bufw = (8 * 16) / textureBitsPerPixel[format];
}
return bufw;
}
u32 QuickTexHashNonSSE(const void *checkp, u32 size) {
u32 check = 0;