YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
24 stars 8 forks source link

In-Game: Allow matrix functions to accept existing arrays for output instead of allocating new arrays #4205

Open iampremo opened 1 year ago

iampremo commented 1 year ago

Description

In the world of GameMaker 3D, people sometimes hit a performance wall caused the functions like matrix_mutliply and matrix_transform_vertex returning a new array every time they're used, giving the garbage collector a lot more work.

To get around this, it would be nice if the functions could accept an extra argument as an output array which the results could be passed into, instead of having to allocate a new one.

For example: new_matrix = matrix_multiply(mat1, mat2) becomes matrix_multiply_ext(mat1, mat2, mat_output)

This could be an optional argument, or a separate _ext version of the functions.

JujuAdams commented 12 months ago

Also matrix_get()