Legacy GM [SOLVED] Image size in memory, performance: draw_background_part

G'day!

When using the draw_background_part function, is the entire image loaded into memory first, or is only the part specified loaded into memory? I'm assuming in either case, a texture page swap is necessary.

Finally, how much performance increase is gained by drawing, say, only 1024x1024 pixels from a 2048x2048 image, instead of the full 2048x2048? Obviously, the amount of drawing 'time' is halved, but can this be measured in a meaningful way, assuming graphics cards produced in the last 5 years or so are being used to do the drawing?

Nathan
 

Ricardo

Member
When using the draw_background_part function, is the entire image loaded into memory first, or is only the part specified loaded into memory? I'm assuming in either case, a texture page swap is necessary.
It doesn't mater if you're drawing only a part of a sprite. The entire texture-page is gonna be loaded into VRAM. Take into account GMS uses 32-bit RGBA for graphics, so: width * height * 4 bytes of VRAM no matter how much the source file is taking up in disk.

About the performance question, I bet (obviously) is quicker to draw 1024x1024 than 2048x2048, but I'm not sure how much fast it is and how you could measure it in a precise way...
In terms of memory, though, a 1024x1024 texture-page will take only 4,194304 MB of VRAM, and a 2048x2048 page will allocate 16.777216 MB of VRAM (which is a lot more, but not necessary a problem in modern systems).
 
Top