Get the amount of graphics memory

I know about DXGI_ADAPTER_DESC , but in 32-bit strings, the Direct3Ds SIZE_T type has a length of 4 bytes, so Im gets 3 GB instead of 11.

Is there a way to get the correct value even in a 32-bit build?

PS I need a value to calculate the top size for a large array of 2D textures. Although a user cannot have 32-bit Windows with 11 GB of VRAM graphics, it is entirely possible to have 4 GB of VRAM with 32-bit OS, for example. as a result of the update. And I don't want to limit my array to 0 in this case.

+5
source share
1 answer

According to my research, there is no easy way to achieve this.

Instead, there are (in Microsoft style) several different ways to achieve this, each of which is more complex than the other.

DX9 used the convenient pd3dDevice->GetAvailableTextureMem() , but that was in DX11.

In this MSDN code example, you can find several ways to request available video memory (with source code). I hope one of them suits you.

+2
source

Source: https://habr.com/ru/post/1274911/


All Articles