Skip to content

Commit

Permalink
OpenGL Renderer: Oops! Roll back some internal test code that acciden…
Browse files Browse the repository at this point in the history
…tally slipped into commit 0c7cb99.
  • Loading branch information
rogerman committed Jul 18, 2024
1 parent 3e650f2 commit 811e1de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 61 deletions.
5 changes: 0 additions & 5 deletions desmume/src/OGLRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4834,11 +4834,6 @@ Render3DError OpenGLRenderer_1_2::EndRender()
texCache.Evict();

this->ReadBackPixels();
GLenum oglerror = glGetError();
if (oglerror != GL_NO_ERROR)
{
INFO("OpenGL: error = %i\n", (int)oglerror);
}

ENDGL();

Expand Down
58 changes: 2 additions & 56 deletions desmume/src/OGLRender.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "types.h"

// OPENGL PLATFORM-SPECIFIC INCLUDES
#if defined(__ANGLE__) || defined(__ANDROID__) || defined(__linux__)
#if defined(__ANGLE__) || defined(__ANDROID__)
#define OPENGL_VARIANT_ES
#define _NO_SDL_TYPES
#include <GLES3/gl3.h>
Expand Down Expand Up @@ -332,11 +332,8 @@ EXTERNOGLEXT(PFNGLDELETERENDERBUFFERSEXTPROC, glDeleteRenderbuffersEXT)
// modification. In other words, these are one-to-one drop-in replacements.
typedef GLclampf GLclampd;
#define glClearDepth(depth) glClearDepthf(depth)

#ifndef OPENGL_VARIANT_ES
#define glDrawBuffer(x) glDrawBuffers(1, ((GLenum[]){x}))
#endif


// 1D textures may not exist for a particular OpenGL variant, so they will be promoted to
// 2D textures instead. Implementations need to modify their GLSL shaders accordingly to
// treat any 1D textures as 2D textures instead.
Expand Down Expand Up @@ -631,16 +628,8 @@ struct OGLRenderRef

GLuint fboClearImageID;
GLuint fboRenderID;
GLuint fboRenderColor0ID[8];
GLuint fboRenderWorking0ID[8];
GLuint fboPolyID;
GLuint fboFogAttrID;
GLuint fboFramebufferFlipID;
GLuint fboColorOutMainID;
GLuint fboColorOutWorkingID;
GLuint fboMSIntermediateRenderID;
GLuint fboMSIntermediateRenderColor0ID[8];
GLuint fboMSFogAttrID;
GLuint selectedRenderingFBO;

// Shader states
Expand Down Expand Up @@ -1041,47 +1030,4 @@ class OpenGLRenderer_2_1 : public OpenGLRenderer_2_0
virtual Render3DError RenderFlush(bool willFlushBuffer32, bool willFlushBuffer16);
};

#ifdef OPENGL_VARIANT_ES

#define glDrawBuffer my_glDrawBuffer
/*
static inline void my_glDrawBuffer(GLenum attach) {
switch(attach) {
case GL_NONE: {
GLenum bufs[1] = {GL_NONE };
glDrawBuffers(1, bufs);
break;
}
case GL_COLOR_ATTACHMENT0: {
GLenum bufs[1] = { attach };
glDrawBuffers(1, bufs);
break;
}
case GL_COLOR_ATTACHMENT1: {
GLenum bufs[2] = {GL_NONE, attach };
glDrawBuffers(2, bufs);
break;
}
case GL_COLOR_ATTACHMENT2: {
GLenum bufs[3] = {GL_NONE, GL_NONE, attach };
glDrawBuffers(3, bufs);
break;
}
case GL_COLOR_ATTACHMENT3: {
GLenum bufs[4] = {GL_NONE, GL_NONE, GL_NONE, attach };
glDrawBuffers(4, bufs);
break;
}
}
}
*/

static inline void my_glDrawBuffer(GLenum attach)
{
GLenum bufs[] = {attach};
glDrawBuffers(1, bufs);
}

#endif

#endif // OGLRENDER_H

0 comments on commit 811e1de

Please sign in to comment.