Advertisement

nullptr SRV

Started by February 25, 2018 10:01 AM
1 comment, last by Hodgman 6 years, 11 months ago

Is it ok to bind nullptr shader resource views and sample them in some shader? I.e. is the resulting behavior deterministic and consistent across GPU drivers? Or should one rather bind an SRV to a texture having just a single black texel?

🧙

In D3D11, yes it's well defined behavior. Reads from null resources return 0, and writes (to UAV/RTV/DSV) become no-ops.
In D3D12, it can be undefined behavior depending on how the SRV was bound to the shader... SRVs supplied as root-descriptors must be valid if they're used from the shader or you might crash the GPU!

This topic is closed to new replies.

Advertisement