您需要遍历所有可能的样本计数,并检查是否支持至少一个质量级别(您需要按格式执行此操作):
SlimDX.Direct3D11.Device device; //your created device
SlimDX.DXGI.Format format = SlimDX.DXGI.Format.R8G8B8A8_Unorm; //Replace by the format you want to test, this one is very common still
for (int samplecount = 1; samplecount < SlimDX.Device.MultisampleCountMaximum ; samplecount *= 2)
{
int levels = device.CheckMultisampleQualityLevels(format, samplecount );
if (levels > 0)
{
//you can use a sampledescription of
new SampleDescription(samplecount, /* value between 0 and levels -1 */
}
else
{
// samplecount is not supported for this format
}
}