2
\$\begingroup\$

Is it somehow possible to get the count of all texture objects on a device?

\$\endgroup\$
2
\$\begingroup\$

No, not really.

If the debug layer is enabled, you can utilize ID3D11Debug::ReportLiveObjects. But this will produce a debug-output report of all live objects, it's not easily accessible your code for parsing. It's also going to require the debug layer, which means you're not going to be able to use it on shipping applications to make meaningful decisions within your program.

You can consider using PIX, or the VS 2012 graphics debugger, which can provide information about allocated resource counts. But again, that's not something you can utilize in your own code on shipping products.

If you need this information to make an actual, important decision at runtime within your game (and I'd be curious what that decision is), you will need to track it yourself by wrapping the creation of all resources (like textures) you want to count.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.