Skip to content

Commit 7d6fb23

Browse files
committed
ppsspp - fix building on Raspberry Pi with proprietary drivers
GL_COMPRESSED_RGBA_ASTC_4x4_KHR isn't available in the videocore iv gles2 includes, and documentation suggests this is an opengles 3 extension. Add ifdefs to not include this if it isn't defined.
1 parent 7baf48b commit 7d6fb23

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

scriptmodules/emulators/ppsspp.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ function sources_ppsspp() {
5353
# ensure Pi vendor libraries are available for linking of shared library
5454
sed -n -i "p; s/^set(CMAKE_EXE_LINKER_FLAGS/set(CMAKE_SHARED_LINKER_FLAGS/p" cmake/Toolchains/raspberry.armv?.cmake
5555

56+
# fix missing defines on opengles2
57+
applyPatch "$md_data/gles2_fix.diff"
58+
5659
if hasPackage cmake 3.6 lt; then
5760
cd ..
5861
mkdir -p cmake
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
diff --git a/Common/GPU/OpenGL/DataFormatGL.cpp b/Common/GPU/OpenGL/DataFormatGL.cpp
2+
index 425f247..ea690d8 100644
3+
--- a/Common/GPU/OpenGL/DataFormatGL.cpp
4+
+++ b/Common/GPU/OpenGL/DataFormatGL.cpp
5+
@@ -146,12 +146,14 @@ bool Thin3DFormatToGLFormatAndType(DataFormat fmt, GLuint &internalFormat, GLuin
6+
alignment = 16;
7+
break;
8+
9+
+#ifdef GL_COMPRESSED_RGBA_ASTC_4x4_KHR
10+
case DataFormat::ASTC_4x4_UNORM_BLOCK:
11+
internalFormat = GL_COMPRESSED_RGBA_ASTC_4x4_KHR;
12+
format = GL_RGBA;
13+
type = GL_FLOAT;
14+
alignment = 16;
15+
break;
16+
+#endif
17+
18+
default:
19+
return false;
20+
diff --git a/Common/GPU/OpenGL/GLFeatures.cpp b/Common/GPU/OpenGL/GLFeatures.cpp
21+
index c17f1d1..fa3463e 100644
22+
--- a/Common/GPU/OpenGL/GLFeatures.cpp
23+
+++ b/Common/GPU/OpenGL/GLFeatures.cpp
24+
@@ -592,7 +592,9 @@ bool CheckGLExtensions() {
25+
for (int i = 0; i < numCompressedFormats; i++) {
26+
switch (compressedFormats[i]) {
27+
case GL_COMPRESSED_RGB8_ETC2: gl_extensions.supportsETC2 = true; break;
28+
+#ifdef GL_COMPRESSED_RGBA_ASTC_4x4_KHR
29+
case GL_COMPRESSED_RGBA_ASTC_4x4_KHR: gl_extensions.supportsASTC = true; break;
30+
+#endif
31+
#ifndef USING_GLES2
32+
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: gl_extensions.supportsBC123 = true; break;
33+
case GL_COMPRESSED_RGBA_BPTC_UNORM: gl_extensions.supportsBC7 = true; break;

0 commit comments

Comments
 (0)