how much dedicated memory the PC GPU has

Started by
0 comments, last by Yourself 11 years ago

Is there any code that lets me see how much memory the PC has?

My application changes radically the more memory it can has.

Advertisement

you can query the amount of GPU memory using DXGI.

something like this :


IDXGIFactory *factory;
uint32 index = 0: 
if( SUCCEEDED(CreateDXGIFactory(__uuidof(IDXGIFactory), (void**)&factory)) ) 
{
	IDXGIAdapter* adapter = NULL; 
	while (factory->EnumAdapters(index, &adapter) != DXGI_ERROR_NOT_FOUND) 
	{ 
		DXGI_ADAPTER_DESC desc; 
		if (SUCCEEDED(adapter->GetDesc(&desc))) 
		{ 
			std::cout << desc.DedicatedVideoMemory << std::endl;
		}
		
		++index;
	}
}

This topic is closed to new replies.

Advertisement