createCubeRenderTarget method

  1. @override
TextureHandle createCubeRenderTarget({
  1. required int size,
  2. required TextureFormat format,
  3. int mipLevels = 1,
})

A cube a pass may aim at one face and one level of.

This used to be null, and the conformance suite is what said it could not stay null — and since 1.0 nothing here answers null: a format with no renderable spelling is refused with a DeviceResourceException. The argument for the null was that a cube a probe can draw into is only useful beside a chain it can filter into, so the two should arrive together — but DeviceFeature.cubeTextures answering true is a promise about more than sampling: the suite reads it as "a pass can name a face of a cube", clears three of them and reads them back, and a backend that answered true and then handed back no cube failed that check rather than declining it. It was a gap wearing a refusal's clothes.

The chain arrived with it and went unclaimed for a while: mipLevels has been honoured here since the cube was, and DeviceFeature.renderToMipLevel went on saying no. Both halves ReflectionProbeNode.supportedOn asks for are yes now. Six array layers and a view per face and level is webgpu_resources.dart's whole answer.

Implementation

@override
TextureHandle createCubeRenderTarget({
  required int size,
  required TextureFormat format,
  int mipLevels = 1,
}) =>
    _guard(
      'a ${size}x$size ${format.name} cube target',
      () => webgpuCreateCubeRenderTarget(
        _gpuDevice,
        _textures,
        size: size,
        format: format,
        mipLevels: mipLevels,
      ),
    ) ??
    (throw refuseResource(
      'createCubeRenderTarget',
      'this device has no renderable spelling for ${format.name}',
    ));