createResource method

  1. @override
Texture createResource()
override

Implementation

@override
gpu.Texture createResource() {
  return GpuContextWrapper(gpu.gpuContext).createTexture(
    gpu.StorageMode.hostVisible,
    width,
    height,
    format: switch (format) {
      PixelFormat.rgba8888 => gpu.PixelFormat.r8g8b8a8UNormInt,
      PixelFormat.bgra8888 => gpu.PixelFormat.b8g8r8a8UNormInt,
      PixelFormat.rgbaFloat32 => gpu.PixelFormat.r32g32b32a32Float,
    },
  )..overwrite(sourceData);
}