mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-04-25 00:41:15 +00:00
Remove framebuffer double buffer, will never be needed
This commit is contained in:
parent
4f608996c9
commit
ebaa16fbcd
3 changed files with 13 additions and 33 deletions
|
@ -62,11 +62,8 @@ namespace OpenGLESRenderer
|
|||
|
||||
void FGLRenderBuffers::ClearScene()
|
||||
{
|
||||
for (int n = 0; n < NBR_BUFF; n++)
|
||||
{
|
||||
DeleteFrameBuffer(mSceneFB[n]);
|
||||
DeleteRenderBuffer(mSceneDepthStencilBuf[n]);
|
||||
}
|
||||
DeleteFrameBuffer(mSceneFB);
|
||||
DeleteRenderBuffer(mSceneDepthStencilBuf);
|
||||
}
|
||||
|
||||
void FGLRenderBuffers::DeleteTexture(PPGLTexture& tex)
|
||||
|
@ -102,9 +99,6 @@ namespace OpenGLESRenderer
|
|||
if (width <= 0 || height <= 0)
|
||||
I_FatalError("Requested invalid render buffer sizes: screen = %dx%d", width, height);
|
||||
|
||||
mBuffPos++;
|
||||
mBuffPos = mBuffPos % NBR_BUFF;
|
||||
|
||||
GLint activeTex;
|
||||
GLint textureBinding;
|
||||
glGetIntegerv(GL_ACTIVE_TEXTURE, &activeTex);
|
||||
|
@ -147,11 +141,8 @@ namespace OpenGLESRenderer
|
|||
void FGLRenderBuffers::CreateScene(int width, int height)
|
||||
{
|
||||
ClearScene();
|
||||
for (int n = 0; n < NBR_BUFF; n++)
|
||||
{
|
||||
mSceneDepthStencilBuf[n] = CreateRenderBuffer("SceneDepthStencil", GL_DEPTH24_STENCIL8, width, height);
|
||||
mSceneFB[n] = CreateFrameBuffer("SceneFB", mSceneTex[n], mSceneDepthStencilBuf[n]);
|
||||
}
|
||||
mSceneDepthStencilBuf = CreateRenderBuffer("SceneDepthStencil", GL_DEPTH24_STENCIL8, width, height);
|
||||
mSceneFB= CreateFrameBuffer("SceneFB", mSceneTex, mSceneDepthStencilBuf);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -162,10 +153,7 @@ namespace OpenGLESRenderer
|
|||
|
||||
void FGLRenderBuffers::CreatePipeline(int width, int height)
|
||||
{
|
||||
for (int n = 0; n < NBR_BUFF; n++)
|
||||
{
|
||||
mSceneTex[n] = Create2DTexture("PipelineTexture", GL_RGBA, width, height);
|
||||
}
|
||||
mSceneTex = Create2DTexture("PipelineTexture", GL_RGBA, width, height);
|
||||
}
|
||||
|
||||
|
||||
|
@ -387,7 +375,7 @@ namespace OpenGLESRenderer
|
|||
|
||||
void FGLRenderBuffers::BindSceneFB(bool sceneData)
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, mSceneFB[mBuffPos].handle);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, mSceneFB.handle);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -398,7 +386,7 @@ namespace OpenGLESRenderer
|
|||
|
||||
void FGLRenderBuffers::BindCurrentTexture(int index, int filter, int wrap)
|
||||
{
|
||||
mSceneTex[mBuffPos].Bind(index, filter, wrap);
|
||||
mSceneTex.Bind(index, filter, wrap);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -410,7 +398,7 @@ namespace OpenGLESRenderer
|
|||
void FGLRenderBuffers::BindCurrentFB()
|
||||
{
|
||||
#ifndef NO_RENDER_BUFFER
|
||||
mSceneFB[mBuffPos].Bind();
|
||||
mSceneFB.Bind();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -134,15 +134,11 @@ private:
|
|||
int mSceneWidth = 0;
|
||||
int mSceneHeight = 0;
|
||||
|
||||
static const int NBR_BUFF = 1;
|
||||
|
||||
int mBuffPos = 0;
|
||||
|
||||
// Buffers for the scene
|
||||
PPGLTexture mSceneDepthStencilTex[NBR_BUFF];
|
||||
PPGLTexture mSceneTex[NBR_BUFF];
|
||||
PPGLRenderBuffer mSceneDepthStencilBuf[NBR_BUFF];
|
||||
PPGLFrameBuffer mSceneFB[NBR_BUFF];
|
||||
PPGLTexture mSceneDepthStencilTex;
|
||||
PPGLTexture mSceneTex;
|
||||
PPGLRenderBuffer mSceneDepthStencilBuf;
|
||||
PPGLFrameBuffer mSceneFB;
|
||||
bool mSceneUsesTextures = false;
|
||||
|
||||
PPGLTexture mDitherTexture;
|
||||
|
|
|
@ -43,11 +43,6 @@ GLAPI PFNGLUNMAPBUFFEROESPROC glUnmapBuffer;
|
|||
|
||||
#else
|
||||
#include "gl_load/gl_load.h"
|
||||
#define GL_DEPTH24_STENCIL8_OES GL_DEPTH24_STENCIL8
|
||||
//#define glClearDepthf glClearDepth
|
||||
#define GL_WRITE_ONLY_OES GL_WRITE_ONLY
|
||||
#define glUnmapBufferOES glUnmapBuffer
|
||||
#define glMapBufferOES glMapBuffer
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
|
@ -70,6 +65,7 @@ namespace OpenGLESRenderer
|
|||
unsigned int maxlights;
|
||||
unsigned int numlightvectors;
|
||||
bool useMappedBuffers;
|
||||
bool depthStencilAvailable;
|
||||
float glslversion;
|
||||
int max_texturesize;
|
||||
char* vendorstring;
|
||||
|
|
Loading…
Reference in a new issue