Skip to main content
torch.js has not been released yet.
torch.js logotorch.js logotorch.js
PlaygroundContact
Login
Documentation
IntroductionType SafetyTensor ExpressionsTensor IndexingEinsumEinopsAutogradTraining a ModelProfiling & MemoryPyTorch MigrationBest PracticesRuntimesPerformancePyTorch CompatibilityBenchmarksDType Coverage
Introduction
createBufferUsageMapModeWGPUBufferWGPUShaderModuleWGPUBindGroupLayoutWGPUBindGroupWGPUComputePipelineWGPUQuerySetWGPUComputePassEncoderWGPUCommandBufferWGPUCommandEncoderWGPUQueueWGPULimitsBufferDescriptorShaderModuleDescriptorComputePipelineDescriptorBufferBindingBindGroupEntryBindGroupDescriptorQuerySetDescriptorWGPUDeviceWGPUSupportedFeaturesWGPUAdapterWGPU
torch.js· 2026
LegalTerms of UsePrivacy Policy
/
/
  1. docs
  2. wgpu-native
  3. wgpu-native
  4. MapMode

wgpu-native.MapMode

Bit flags for GPU buffer mapping modes.

Specifies the access mode when mapping a buffer for CPU access.

MapMode = {
  /**
   * Map buffer for reading (GPU → CPU transfer).
   * Buffer must have MAP_READ usage flag.
   */
  READ: native.MapMode.READ,

  /**
   * Map buffer for writing (CPU → GPU transfer).
   * Buffer must have MAP_WRITE usage flag.
   */
  WRITE: native.MapMode.WRITE,
} as const
READ(native.MapMode.READ)
– Map buffer for reading (GPU → CPU transfer). Buffer must have MAP_READ usage flag.
WRITE(native.MapMode.WRITE)
– Map buffer for writing (CPU → GPU transfer). Buffer must have MAP_WRITE usage flag.
Previous
create
Next
QuerySetDescriptor