supportsTextureFormat method

bool supportsTextureFormat(
  1. PixelFormat format, {
  2. bool renderTarget = false,
  3. bool shaderRead = true,
  4. bool shaderWrite = false,
})

Whether this device can allocate a texture of the given format with the requested usage flags.

For block-compressed formats this returns false if either renderTarget or shaderWrite is true, since compressed formats are sample-only. For uncompressed formats this currently returns true: today the underlying capability surface does not vary by per-format usage.

Implementation

bool supportsTextureFormat(
  PixelFormat format, {
  bool renderTarget = false,
  bool shaderRead = true,
  bool shaderWrite = false,
}) {
  return _supportsTextureFormat(
    format.index,
    renderTarget,
    shaderRead,
    shaderWrite,
  );
}