mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-25 08:32:48 -06:00
Fix Mali GPU Performance issues on OpenGL
Co-authored-by: zhang wei <zwdreams@gmail.com>
This commit is contained in:
parent
d9f2d771ce
commit
cdd70e1f0c
1 changed files with 13 additions and 2 deletions
|
@ -73,6 +73,11 @@ GLenum MakeAttributeType(Pica::PipelineRegs::VertexAttributeFormat format) {
|
||||||
|
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
||||||
|
static bool IsVendorMali() {
|
||||||
|
std::string gpu_vendor{reinterpret_cast<char const*>(glGetString(GL_VENDOR))};
|
||||||
|
return gpu_vendor.find("ARM") != std::string::npos;
|
||||||
|
}
|
||||||
|
|
||||||
RasterizerOpenGL::RasterizerOpenGL(Memory::MemorySystem& memory, Pica::PicaCore& pica,
|
RasterizerOpenGL::RasterizerOpenGL(Memory::MemorySystem& memory, Pica::PicaCore& pica,
|
||||||
VideoCore::CustomTexManager& custom_tex_manager,
|
VideoCore::CustomTexManager& custom_tex_manager,
|
||||||
VideoCore::RendererBase& renderer, Driver& driver_)
|
VideoCore::RendererBase& renderer, Driver& driver_)
|
||||||
|
@ -83,8 +88,14 @@ RasterizerOpenGL::RasterizerOpenGL(Memory::MemorySystem& memory, Pica::PicaCore&
|
||||||
vertex_buffer{driver, GL_ARRAY_BUFFER, VERTEX_BUFFER_SIZE},
|
vertex_buffer{driver, GL_ARRAY_BUFFER, VERTEX_BUFFER_SIZE},
|
||||||
uniform_buffer{driver, GL_UNIFORM_BUFFER, UNIFORM_BUFFER_SIZE},
|
uniform_buffer{driver, GL_UNIFORM_BUFFER, UNIFORM_BUFFER_SIZE},
|
||||||
index_buffer{driver, GL_ELEMENT_ARRAY_BUFFER, INDEX_BUFFER_SIZE},
|
index_buffer{driver, GL_ELEMENT_ARRAY_BUFFER, INDEX_BUFFER_SIZE},
|
||||||
texture_buffer{driver, GL_TEXTURE_BUFFER, texture_buffer_size},
|
texture_buffer{driver, GL_TEXTURE_BUFFER,
|
||||||
texture_lf_buffer{driver, GL_TEXTURE_BUFFER, texture_buffer_size} {
|
IsVendorMali()
|
||||||
|
? (GL_MAX_TEXTURE_BUFFER_SIZE == 65536 ? 11264 : texture_buffer_size)
|
||||||
|
: texture_buffer_size},
|
||||||
|
texture_lf_buffer{driver, GL_TEXTURE_BUFFER,
|
||||||
|
IsVendorMali()
|
||||||
|
? (GL_MAX_TEXTURE_BUFFER_SIZE == 65536 ? 525312 : texture_buffer_size)
|
||||||
|
: texture_buffer_size} {
|
||||||
|
|
||||||
// Clipping plane 0 is always enabled for PICA fixed clip plane z <= 0
|
// Clipping plane 0 is always enabled for PICA fixed clip plane z <= 0
|
||||||
state.clip_distance[0] = true;
|
state.clip_distance[0] = true;
|
||||||
|
|
Loading…
Reference in a new issue