0

I noticed what I think is a subtle difference between SampleLevel and Sample. The observation was made using Direct3D11, and it is reproducible on different versions of Windows (Win7, Win10) and different GPUs (Intel, NVidia, AMD).

If the sampler state specifies a different filtering option for minification and magnification (like e. g. D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT) it seems that with SampleLevel we always use the filtering option for magnication (irrespective of whether the texture is minified or magnified). With Sample instead I find that the behavior is as expected - the filtering option depends on whether the texture is actually minified or magnified.

I cannot find this behavior mentioned in the documentation. Should I be seeing this behavior or am I missing something else? Is there some other way to specify the mip-level and still use different filtering options for minification/magnification?

ptahmose
  • 117
  • 3
  • Isn't that mentioned in the [D3D11_FILTER](https://msdn.microsoft.com/en-us/library/windows/desktop/ff476132.aspx) documentation: *"If you use different filter types for min versus mag filter, undefined behavior occurs in certain cases where the choice between whether magnification or minification happens is ambiguous."* – IInspectable Oct 30 '16 at 13:54
  • Yes, I noticed this comment as well - but did not find any explanation to what "ambiguous cases" it is referring to. It is at least not obvious that using SampleLevel makes it an ambiguous case. I'd think that it refers to cases where the magnication is close to 1. In any case the recommendation to use only filter-modes which are the same for minification and magnification is not really helpful to me - since I explicitly want to have those different modes. – ptahmose Oct 30 '16 at 15:08

0 Answers0