Viewing in memory textures in VS 2012

Started by
5 comments, last by mbradber 10 years, 12 months ago

Hey guys, I'm writing a shadow mapping app and I'd like to see the shadow map that was generated on the first render pass before I sample it later. Is there a way I can see this shader resource view using the graphics debugger in VS 2012?

Advertisement

You can view all resources from within the graphics debugger. It seems that textures are accessed by an ID number (i.e. obj:21) and I am not aware of a way to actually watch or name a texture. You can click on Object Table view and scan for the texture that has the right format, height, and width, or, if you create or bind it a specific point, you can locate the the link to the texture in the Event List. Once you find the texture, just click on the ID number (i.e. obj:21) and the texture will open up as a *.dds image.

Untitled.png

You can name your objects this way. That makes it even easier to find them. (Disclaimer: I can't confirm this for the VS2012 debugger, but it works in PIX).

Thanks for the tip unbird!

You can view all resources from within the graphics debugger. It seems that textures are accessed by an ID number (i.e. obj:21) and I am not aware of a way to actually watch or name a texture. You can click on Object Table view and scan for the texture that has the right format, height, and width, or, if you create or bind it a specific point, you can locate the the link to the texture in the Event List. Once you find the texture, just click on the ID number (i.e. obj:21) and the texture will open up as a *.dds image.

Untitled.png

Thanks for the reply, when I click on the object that corresponds to the shadow map texture, it throws an error and says it cannot open the file. I'm thinking it's because the format I'm using to create the Texture2D resource it not supported by the image viewer.

For the time being I'm just projecting the shadow map texture onto some geometry and viewing while the app runs, while this works, it would be nice to not have to change my app code in order to debug in memory textures.

TYPELESS format, no ? Yeah, PIX can't do that either, unfortunately. Although you will have to change your code too, you could try the following: Use ID3D11DeviceContext::CopyResource to copy your depth to a viewable and compatible format. Not sure if that actually works, though.

Edit: Yep, works: Tried with a R32_TYPELESS shadowmap copied to a D32_FLOAT depth stencil texture. Drawback being you probably wanna do this when your shadow map creation is finished.

TYPELESS format, no ? Yeah, PIX can't do that either, unfortunately. Although you will have to change your code too, you could try the following: Use ID3D11DeviceContext::CopyResource to copy your depth to a viewable and compatible format. Not sure if that actually works, though.

Edit: Yep, works: Tried with a R32_TYPELESS shadowmap copied to a D32_FLOAT depth stencil texture. Drawback being you probably wanna do this when your shadow map creation is finished.

Thanks for the tip, I'll give it a shot.

This topic is closed to new replies.

Advertisement