1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Revert "PowerVR performance improvement"

This reverts commit 93be54a54d.
This commit is contained in:
Sergey Lipskiy 2016-06-29 12:16:01 +06:00
parent c52cc68fbf
commit 83ba9b5741
4 changed files with 12 additions and 32 deletions

View File

@ -31,8 +31,7 @@ const char * strLightUniforms[UniformBlock::luTotal] = {
"uLightColor"
};
UniformBlock::UniformBlock() : m_currentBuffer(0),
m_isBufferSubDataSupported(video().getRender().isBufferSubDataSupported())
UniformBlock::UniformBlock() : m_currentBuffer(0), m_renderer(video().getRender().getRenderer())
{
}
@ -149,7 +148,7 @@ void UniformBlock::setColorData(ColorUniforms _index, u32 _dataSize, const void
glBindBuffer(GL_UNIFORM_BUFFER, m_colorsBlock.m_buffer);
}
if (m_isBufferSubDataSupported)
if (m_renderer != OGLRender::glrAdreno)
glBufferSubData(GL_UNIFORM_BUFFER, m_colorsBlock.m_offsets[_index], _dataSize, _data);
else
glBufferData(GL_UNIFORM_BUFFER, m_colorsBlockData.size(), m_colorsBlockData.data(), GL_STATIC_DRAW);
@ -160,8 +159,7 @@ void UniformBlock::updateTextureParameters()
if (m_textureBlock.m_buffer == 0)
return;
std::vector<GLbyte> temp(m_textureBlockData.size(), 0);
GLbyte * pData = temp.data();
GLbyte * pData = m_textureBlockData.data();
f32 texScale[4] = { gSP.texture.scales, gSP.texture.scalet, 0, 0 };
memcpy(pData + m_textureBlock.m_offsets[tuTexScale], texScale, m_textureBlock.m_offsets[tuTexOffset] - m_textureBlock.m_offsets[tuTexScale]);
@ -232,14 +230,11 @@ void UniformBlock::updateTextureParameters()
m_currentBuffer = m_textureBlock.m_buffer;
glBindBuffer(GL_UNIFORM_BUFFER, m_textureBlock.m_buffer);
}
if(temp != m_textureBlockData) {
m_textureBlockData = temp;
if (m_isBufferSubDataSupported)
glBufferSubData(GL_UNIFORM_BUFFER, m_textureBlock.m_offsets[tuTexScale], m_textureBlockData.size(), pData);
else
glBufferData(GL_UNIFORM_BUFFER, m_textureBlockData.size(), m_textureBlockData.data(), GL_STATIC_DRAW);
}
if (m_renderer != OGLRender::glrAdreno)
glBufferSubData(GL_UNIFORM_BUFFER, m_textureBlock.m_offsets[tuTexScale], m_textureBlockData.size(), pData);
else
glBufferData(GL_UNIFORM_BUFFER, m_textureBlockData.size(), m_textureBlockData.data(), GL_STATIC_DRAW);
}
void UniformBlock::updateLightParameters()
@ -258,7 +253,7 @@ void UniformBlock::updateLightParameters()
glBindBuffer(GL_UNIFORM_BUFFER, m_lightBlock.m_buffer);
}
if (m_isBufferSubDataSupported)
if (m_renderer != OGLRender::glrAdreno)
glBufferSubData(GL_UNIFORM_BUFFER, m_lightBlock.m_offsets[luLightDirection], m_lightBlockData.size(), pData);
else
glBufferData(GL_UNIFORM_BUFFER, m_lightBlockData.size(), m_lightBlockData.data(), GL_STATIC_DRAW);

View File

@ -63,7 +63,7 @@ private:
};
GLuint m_currentBuffer;
bool m_isBufferSubDataSupported;
OGLRender::OGL_RENDERER m_renderer;
UniformBlockData<tuTotal, 1> m_textureBlock;
UniformBlockData<cuTotal, 2> m_colorsBlock;

View File

@ -1723,16 +1723,8 @@ void OGLRender::_initExtensions()
const GLubyte * strRenderer = glGetString(GL_RENDERER);
if (strstr((const char*)strRenderer, "Adreno") != nullptr)
m_oglRenderer = glrAdreno;
else if (strstr((const char*)strRenderer, "PowerVR") != nullptr)
m_oglRenderer = glrPowerVR;
else if (strstr((const char*)strRenderer, "Mali") != nullptr)
m_oglRenderer = glrMali;
LOG(LOG_VERBOSE, "OpenGL renderer: %s\n", strRenderer);
m_isBufferSubDataSupported = m_oglRenderer != OGLRender::glrAdreno &&
m_oglRenderer != OGLRender::glrPowerVR &&
m_oglRenderer != OGLRender::glrMali;
fboFormats.init();
#ifndef GLES2

View File

@ -166,14 +166,10 @@ public:
enum OGL_RENDERER {
glrOther,
glrAdreno,
glrPowerVR,
glrMali
glrAdreno
};
OGL_RENDERER getRenderer() const { return m_oglRenderer; }
bool isBufferSubDataSupported() const {return m_isBufferSubDataSupported;}
void dropRenderState() {m_renderState = rsNone;}
private:
@ -181,8 +177,7 @@ private:
: m_oglRenderer(glrOther)
, m_modifyVertices(0)
, m_bImageTexture(false)
, m_bFlatColors(false)
, m_isBufferSubDataSupported(true){
, m_bFlatColors(false) {
}
OGLRender(const OGLRender &);
friend class OGLVideo;
@ -265,8 +260,6 @@ private:
TexrectDrawer m_texrectDrawer;
GLuint m_programCopyTex;
bool m_isBufferSubDataSupported;
};
class OGLVideo