Skip to content

GC always called in background #24

@abc013

Description

@abc013

This is due to the changes in the rendering system, which is discarding, allocating and saving huge amounts of data per render. This whole thing is happening here:

public virtual void PushToBatchRenderer()
{
if (!Visible)
return;
if (MatrixChanged)
{
var t2 = Matrix4.CreateTranslation(Position.X, Position.Y, Position.Z);
var r1 = Matrix4.CreateRotationX(Rotation.X);
var r2 = Matrix4.CreateRotationY(Rotation.Y);
var r3 = Matrix4.CreateRotationZ(Rotation.Z);
var s1 = Matrix4.CreateScale(Scale);
var matrix = r1 * r2 * r3 * s1 * t2;
Calculated = new Vertex[Vertices.Length];
for (int i = 0; i < Vertices.Length; i++)
Calculated[i] = Vertices[i].Apply(matrix, Color);
MatrixChanged = false;
}
MasterRenderer.BatchRenderer.Add(Calculated);
}

Calculated is the reference that is causing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions