Home -> ITextureBuffer -> IsSampleCountSupported
Description
The IsSampleCountSupported method returns true if the current renderer and graphics device can create a two dimensional multisampled texture using the supplied image format, data format, and sample count. This is intended for testing multisample anti-aliasing (MSAA) framebuffer attachment support before calling SetSampleCount and AllocateMemory.
The query uses the supplied arguments directly, rather than inspecting the texture object's current format, dimensions, sample count, or allocation state. It can therefore be called before any texture format has been set, or on a texture object that has already been created and used. The check assumes a two dimensional texture with a single mipmap level.
Renderer backends evaluate support through their native graphics API. If the renderer would select a compatible fallback allocation format for the requested image and data format combination, support is checked against the native format that would actually be used.
Important
This method is only available on ITextureBuffer2D objects. A false return value is not an error; it means the requested MSAA texture configuration is not available on the current renderer and graphics device.
Usage
bool IsSampleCountSupported(ImageFormat imageFormat, DataFormat dataFormat, SampleCount sampleCount) const;
Argument list
- imageFormat [ImageFormat]
- The image format to test for the multisampled two dimensional texture.
- dataFormat [DataFormat]
- The data format to test for the multisampled two dimensional texture.
- sampleCount [SampleCount]
- The number of samples to test for each pixel of the two dimensional texture.
Return value
Returns true if the current renderer and graphics device report support for the requested texture configuration, or false if that combination cannot be used.