CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/GPU/GeConstants.cpp
Views: 1401
1
#include "GPU/ge_constants.h"
2
3
const char *GeBufferFormatToString(GEBufferFormat fmt) {
4
switch (fmt) {
5
case GE_FORMAT_4444: return "4444";
6
case GE_FORMAT_5551: return "5551";
7
case GE_FORMAT_565: return "565";
8
case GE_FORMAT_8888: return "8888";
9
case GE_FORMAT_DEPTH16: return "DEPTH16";
10
default: return "N/A";
11
}
12
}
13
14
const char *GEPaletteFormatToString(GEPaletteFormat pfmt) {
15
switch (pfmt) {
16
case GE_CMODE_16BIT_BGR5650: return "565";
17
case GE_CMODE_16BIT_ABGR5551: return "5551";
18
case GE_CMODE_16BIT_ABGR4444: return "4444";
19
case GE_CMODE_32BIT_ABGR8888: return "8888";
20
default: return "N/A";
21
}
22
}
23
24
const char *GeTextureFormatToString(GETextureFormat fmt) {
25
switch (fmt) {
26
case GE_TFMT_5650: return "565";
27
case GE_TFMT_5551: return "5551";
28
case GE_TFMT_4444: return "4444";
29
case GE_TFMT_8888: return "8888";
30
case GE_TFMT_CLUT4: return "CLUT4";
31
case GE_TFMT_CLUT8: return "CLUT8";
32
case GE_TFMT_CLUT16: return "CLUT16";
33
case GE_TFMT_CLUT32: return "CLUT32";
34
case GE_TFMT_DXT1: return "DXT1";
35
case GE_TFMT_DXT3: return "DXT3";
36
case GE_TFMT_DXT5: return "DXT5";
37
default: return "N/A";
38
}
39
}
40
41
const char *GeTextureFormatToString(GETextureFormat tfmt, GEPaletteFormat pfmt) {
42
switch (tfmt) {
43
case GE_TFMT_CLUT4:
44
switch (pfmt) {
45
case GE_CMODE_16BIT_BGR5650: return "CLUT4_565";
46
case GE_CMODE_16BIT_ABGR5551: return "CLUT4_5551";
47
case GE_CMODE_16BIT_ABGR4444: return "CLUT4_4444";
48
case GE_CMODE_32BIT_ABGR8888: return "CLUT4_8888";
49
default: return "N/A";
50
}
51
case GE_TFMT_CLUT8:
52
switch (pfmt) {
53
case GE_CMODE_16BIT_BGR5650: return "CLUT8_565";
54
case GE_CMODE_16BIT_ABGR5551: return "CLUT8_5551";
55
case GE_CMODE_16BIT_ABGR4444: return "CLUT8_4444";
56
case GE_CMODE_32BIT_ABGR8888: return "CLUT8_8888";
57
default: return "N/A";
58
}
59
case GE_TFMT_CLUT16:
60
switch (pfmt) {
61
case GE_CMODE_16BIT_BGR5650: return "CLUT16_565";
62
case GE_CMODE_16BIT_ABGR5551: return "CLUT16_5551";
63
case GE_CMODE_16BIT_ABGR4444: return "CLUT16_4444";
64
case GE_CMODE_32BIT_ABGR8888: return "CLUT16_8888";
65
default: return "N/A";
66
}
67
case GE_TFMT_CLUT32:
68
switch (pfmt) {
69
case GE_CMODE_16BIT_BGR5650: return "CLUT32_565";
70
case GE_CMODE_16BIT_ABGR5551: return "CLUT32_5551";
71
case GE_CMODE_16BIT_ABGR4444: return "CLUT32_4444";
72
case GE_CMODE_32BIT_ABGR8888: return "CLUT32_8888";
73
default: return "N/A";
74
}
75
default: return GeTextureFormatToString(tfmt);
76
}
77
}
78
79