WebGPU.rocks Logo

GPUBuffer

  • GPUDevice.createBuffer(descriptor: GPUBufferDescriptor): GPUBuffer

    GPUBufferDescriptor

    • label: USVString
    • size: GPUSize64required
    • usage: GPUBufferUsageFlagsrequired
    • mappedAtCreation: boolean= 'false'

    GPUSize64

    typedef GPUSize64 = unsigned long long

    GPUBufferUsageFlags

    typedef GPUBufferUsageFlags = unsigned long
    • GPUBufferUsage.MAP_READ = 0x0001
    • GPUBufferUsage.MAP_WRITE = 0x0002
    • GPUBufferUsage.COPY_SRC = 0x0004
    • GPUBufferUsage.COPY_DST = 0x0008
    • GPUBufferUsage.INDEX = 0x0010
    • GPUBufferUsage.VERTEX = 0x0020
    • GPUBufferUsage.UNIFORM = 0x0040
    • GPUBufferUsage.STORAGE = 0x0080
    • GPUBufferUsage.INDIRECT = 0x0100
    • GPUBufferUsage.QUERY_RESOLVE = 0x0200
  • label: USVString
  • size: GPUSize64
  • usage: GPUBufferUsageFlags
  • mapState: GPUBufferMapState
  • mapAsync(mode: GPUMapModeFlags, offset: GPUSize64, size: GPUSize64): Promise<void>

    GPUMapModeFlags

    typedef GPUMapModeFlags = unsigned long
    • GPUMapMode.READ = 0x0001
    • GPUMapMode.WRITE = 0x0002

    GPUSize64

    typedef GPUSize64 = unsigned long long
  • getMappedRange(offset: GPUSize64, size: GPUSize64): ArrayBuffer

    GPUSize64

    typedef GPUSize64 = unsigned long long
  • unmap(): void
  • destroy(): void