Skip to main content
gamedev.net
🔒 Locked

Computing allocated shader memory

Started by fboivin Jan 24, 2006 at 11:54 AM 0 replies 1.1k views
Original Post
fboivin
fboivin
How would I go about computing the amount of memory all my shaders use? I have a lot of shader combinations generated at runtime and I want to check how much this takes. I guess the memory is allocated in Create[Vertex|Pixel]Shader(...)? Global new/delete overload? Thanks for any info
circlesoft
circlesoft
Quote:
Original post by fboivin
How would I go about computing the amount of memory all my shaders use? I have a lot of shader combinations generated at runtime and I want to check how much this takes.

I guess the memory is allocated in Create[Vertex|Pixel]Shader(...)? Global new/delete overload?

Thanks for any info

This is definitely not simple at all, if even possible. Shaders could allocate all kinds of resources, whether they be in system or video memory. And if you overload new, it wouldn't be called by any D3D stuff, since that has already been compiled with its own operators.

The same problem applies to calculating how much video memory you have available. There is just no reliable way to do it, unfortunately. You can try GetAvailableTextureMem() though.

You could try the IDirect3DQuery9 interface with D3DQUERYTYPE_ResourceManager - that may or may not give you some useful info.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.