• Advertisement
Sign in to follow this  

[D3D10] NULL Render Target

This topic is 3629 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to have a NULL render target in D3D10? I'm trying to write a shader that does nothing but render the scene's depth to a depth stencil view. I don't care about the render target in this shader. I looked up the documentation for OMSetRenderTargets and it says: ppRenderTargetViews [in] Pointer to an array of render targets (see ID3D10RenderTargetView) to bind to the device. If this parameter is NULL, no render targets are bound. See Remarks. I looked at the remarks, but it mentions nothing about NULL render targets. But when I trying doing this: device->OMSetRenderTargets(1, NULL, dsv); It throws an "Access violation reading location 0x00000000" error on that line. Does this mean the documentation is wrong? Or am I doing something wrong?

Share this post


Link to post
Share on other sites
Advertisement
Try

ID3D10RenderTargetView* rt[1] = {0};

then pass rt. You have to pass a valid array, but the array elements can be null.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement