VTK  9.4.2
vtkWebGPUBufferInternals.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3#ifndef vtkWebGPUBufferInternals_h
4#define vtkWebGPUBufferInternals_h
5
6#include "vtkDataArray.h"
7#include "vtkRenderingWebGPUModule.h"
8#include "vtk_wgpu.h"
9
10VTK_ABI_NAMESPACE_BEGIN
11class VTKRENDERINGWEBGPU_NO_EXPORT vtkWebGPUBufferInternals
12{
13public:
14 static wgpu::Buffer Upload(const wgpu::Device& device, unsigned long offset, void* data,
15 unsigned long sizeBytes, wgpu::BufferUsage usage, const char* label = nullptr);
16
21 wgpu::Device device, wgpu::Buffer wgpuBuffer, vtkDataArray* dataArray);
22
27 wgpu::Device device, wgpu::Buffer wgpuBuffer, vtkIdType byteOffset, vtkDataArray* dataArray);
28
29 static wgpu::Buffer CreateBuffer(const wgpu::Device& device, unsigned long sizeBytes,
30 wgpu::BufferUsage usage, bool mappedAtCreation = false, const char* label = nullptr);
31
32 // Check whether the given device can create a buffer that is sizeBytes big.
33 static bool CheckBufferSize(const wgpu::Device& device, unsigned long sizeBytes);
34};
35VTK_ABI_NAMESPACE_END
36
37#endif
38// VTK-HeaderTest-Exclude: vtkWebGPUBufferInternals.h
abstract superclass for arrays of numeric data
static wgpu::Buffer Upload(const wgpu::Device &device, unsigned long offset, void *data, unsigned long sizeBytes, wgpu::BufferUsage usage, const char *label=nullptr)
static void UploadFromDataArray(wgpu::Device device, wgpu::Buffer wgpuBuffer, vtkIdType byteOffset, vtkDataArray *dataArray)
Uploads a vtkDataArray with offset to the given wgpuBuffer.
static wgpu::Buffer CreateBuffer(const wgpu::Device &device, unsigned long sizeBytes, wgpu::BufferUsage usage, bool mappedAtCreation=false, const char *label=nullptr)
static bool CheckBufferSize(const wgpu::Device &device, unsigned long sizeBytes)
static void UploadFromDataArray(wgpu::Device device, wgpu::Buffer wgpuBuffer, vtkDataArray *dataArray)
Uploads a vtkDataArray to the given wgpuBuffer.
int vtkIdType
Definition vtkType.h:315