Why does a Texture2D description require a sample description?

Started by
1 comment, last by NathanRidley 8 years, 9 months ago
Using SharpDX, I'm writing some code to learn how to create a dynamic texture and one of the Texture2DDescription object's properties is SampleDescription. I was under the impression that sampling was an external thing that is used to determine how to sample an arbitrary texture. i.e. You set a sampler state and the sampling is then performed according to those settings. Why would you attach sampler settings directly to a texture? And how would you even determine what these should be in advance? How do I know that I should have quality 1, 2 or 4? How would I know to take 1 sample, or 2, 4 or 8?
Advertisement

It's for multi-sampled textures, like a render-target, not the sampler-state. If you don't have 1 for the sample-count and want to sample the texture in a shader, you need to use a Texture2DMS instead of a Texture2D in the shader.

EDIT: (And D3D11_TEX2DMS_SRV in the view-dimension when creating the shader resource view. Similar for the render target view.)

Ah right, thanks. Was getting my wires crossed a bit.

This topic is closed to new replies.

Advertisement