You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove temp buffer alloc get data when reading full texture (MonoGame#8590)
When GetData is called on an OpenGL Texture2D a temporary buffer is
allocated which causes heap allocations.
In scenarios where you request the entire texture (rect param is not
given, or rect param is of full extend (0,0,width,height). We do not
have to allocate a temporary buffer, and we can also skip Array.Copy in
this case.
### Description of Change
The proposed implementation checks for this specific condition, and then
proceeds to fill the given T[]Data directly with GetTexImage results.
---------
Co-authored-by: Tom Spilman <[email protected]>
Co-authored-by: Thomas Altenburger <[email protected]>
Co-authored-by: Harry <[email protected]>
0 commit comments