Fix Mali GPU Performance issues on OpenGL

Co-authored-by: zhang wei <zwdreams@gmail.com>
This commit is contained in:
OpenSauce 2024-04-18 18:47:53 +01:00 committed by GitHub
parent d9f2d771ce
commit cdd70e1f0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -73,6 +73,11 @@ GLenum MakeAttributeType(Pica::PipelineRegs::VertexAttributeFormat format) {
} // 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,
VideoCore::CustomTexManager& custom_tex_manager,
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},
uniform_buffer{driver, GL_UNIFORM_BUFFER, UNIFORM_BUFFER_SIZE},
index_buffer{driver, GL_ELEMENT_ARRAY_BUFFER, INDEX_BUFFER_SIZE},
texture_buffer{driver, GL_TEXTURE_BUFFER, texture_buffer_size},
texture_lf_buffer{driver, GL_TEXTURE_BUFFER, texture_buffer_size} {
texture_buffer{driver, GL_TEXTURE_BUFFER,
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
state.clip_distance[0] = true;