Compare commits

...

1 Commits

Author SHA1 Message Date
Morph
ab3ad637ac gl_rasterizer: Avoid copying attrib
Make attrib a const reference and make VertexType() take in a const reference of attrib as its parameter.
This saves ~40 MB in memory usage in Super Mario Odyssey
2020-06-28 05:44:05 -04:00
2 changed files with 2 additions and 2 deletions

View File

@@ -200,7 +200,7 @@ void RasterizerOpenGL::SetupVertexFormat() {
}
flags[Dirty::VertexFormat0 + index] = false;
const auto attrib = gpu.regs.vertex_attrib_format[index];
const auto& attrib = gpu.regs.vertex_attrib_format[index];
const auto gl_index = static_cast<GLuint>(index);
// Disable constant attributes.

View File

@@ -24,7 +24,7 @@ namespace MaxwellToGL {
using Maxwell = Tegra::Engines::Maxwell3D::Regs;
inline GLenum VertexType(Maxwell::VertexAttribute attrib) {
inline GLenum VertexType(const Maxwell::VertexAttribute& attrib) {
switch (attrib.type) {
case Maxwell::VertexAttribute::Type::UnsignedInt:
case Maxwell::VertexAttribute::Type::UnsignedNorm: