createRenderTarget function

RenderTarget createRenderTarget(
  1. int width,
  2. int height
)

Creates a GPU Render target with specified dimensions.

Implementation

gpu.RenderTarget createRenderTarget(int width, int height) {
  final texture = gpu.gpuContext
      .createTexture(gpu.StorageMode.devicePrivate, width, height);

  final renderTarget = gpu.RenderTarget.singleColor(gpu.ColorAttachment(
      texture: texture, clearValue: vm.Vector4(0, 0, 1, 1)));

  return renderTarget;
}