Home > other >  O know the details of DX9 loading texture memory ups and downs
O know the details of DX9 loading texture memory ups and downs

Time:09-17

Use D3DXCreateTextureFromFileEx loading a 10000 x 7000 pixel image, did the application memory 1 g left after finished loading then fall back to about 100 m, this is what ah=-=, do a 32-bit game, if a background image can be up to 1 gb of memory is really scared

CodePudding user response:

10000 * 7000 is too big, too

CodePudding user response:

10000 * 1024=67 m/7000/1024
In view of the pitch may be greater than the pixel wide, so should be around 100 m normal
Memory, up to 1 g if you exclude program reason, image format might be the problem, the process of decompression room for temporary
Generally no big problem, if you want to control, can read image data to a file, first to create texture, then lock pixels to
Have you so big of texture should be static, memory pool had better not use managed, don't keep a copy in memory

CodePudding user response:

refer to the second floor ten response: the fox
10000 * 1024=67 m/7000/1024
In view of the pitch may be greater than the pixel wide, so should be around 100 m normal
Memory, up to 1 g if you exclude program reason, image format might be the problem, the process of decompression room for temporary
Generally no big problem, if you want to control, can read image data to a file, first to create texture, then lock pixels to
Have you so big of texture should be static, had better not use managed memory pool, don't keep in memory copy


What do you calculate less color channel,,,
10000 * 7000 * 1024=2.086162567138671875 GB/32/1024
Even 3 channel also many
10000 * 7000 * 1024=1.56462192535400390625 GB/24/1024

CodePudding user response:

reference WJN92 reply: 3/f
Quote: refer to the second floor ten response: the fox

10000 * 1024=67 m/7000/1024
In view of the pitch may be greater than the pixel wide, so should be around 100 m normal
Memory, up to 1 g if you exclude program reason, image format might be the problem, the process of decompression room for temporary
Generally no big problem, if you want to control, can read image data to a file, first to create texture, then lock pixels to
Have you so big of texture should be static, had better not use managed memory pool, don't keep in memory copy


What do you calculate less color channel,,,
10000 * 7000 * 1024=2.086162567138671875 GB/32/1024
Even 3 channel also many
10000 * 7000 * 1024=1.56462192535400390625 GB/24/1024

Generally the larger image are DXT format, namely FMT_BC in dx, 2-4 channel, bpp4 or 8
Even if usually 4 channel 32 bit you is wrong, should take 4 than 32
  • Related