summaryrefslogtreecommitdiff
path: root/src/render/Framebuffer.cpp
diff options
context:
space:
mode:
authorpastalian <28638872+pastalian@users.noreply.github.com>2023-11-04 00:47:20 +0900
committerGitHub <noreply@github.com>2023-11-03 15:47:20 +0000
commit49fdffacea92bc99391da0a9347b34c27d1b4525 (patch)
treeb7875e8da2dff1d4bad8983d98ccc7a154f1aac6 /src/render/Framebuffer.cpp
parent0f6e53079864d411aa2de3262ba4c01eeeec4f5b (diff)
renderer: fix legacy_renderer build (#3732)
In GLES2, `GL_RGB10_A2` and `GL_UNSIGNED_INT_2_10_10_10_REV` are defined as `GL_RGB10_A2_EXT` and `GL_UNSIGNED_INT_2_10_10_10_REV_EXT` respectively.
Diffstat (limited to 'src/render/Framebuffer.cpp')
-rw-r--r--src/render/Framebuffer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/render/Framebuffer.cpp b/src/render/Framebuffer.cpp
index e1f815ce..1ebbc585 100644
--- a/src/render/Framebuffer.cpp
+++ b/src/render/Framebuffer.cpp
@@ -6,7 +6,13 @@ bool CFramebuffer::alloc(int w, int h, uint32_t drmFormat) {
RASSERT((w > 1 && h > 1), "cannot alloc a FB with negative / zero size! (attempted {}x{})", w, h);
uint32_t glFormat = drmFormatToGL(drmFormat);
- uint32_t glType = glFormat != GL_RGBA ? GL_UNSIGNED_INT_2_10_10_10_REV : GL_UNSIGNED_BYTE;
+ uint32_t glType = glFormat != GL_RGBA ?
+#ifdef GLES2
+ GL_UNSIGNED_INT_2_10_10_10_REV_EXT :
+#else
+ GL_UNSIGNED_INT_2_10_10_10_REV :
+#endif
+ GL_UNSIGNED_BYTE;
if (m_iFb == (uint32_t)-1) {
firstAlloc = true;