VTK  9.3.20241006
vtkWebGPUTextureInternals.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
4#ifndef vtkWebGPUTextureInternals_h
5#define vtkWebGPUTextureInternals_h
6
7#include "vtkDataArray.h"
8#include "vtkRenderingWebGPUModule.h"
9#include "vtk_wgpu.h"
10
11VTK_ABI_NAMESPACE_BEGIN
12
13class VTKRENDERINGWEBGPU_NO_EXPORT vtkWebGPUTextureInternals
14{
15public:
19 static wgpu::Texture CreateATexture(const wgpu::Device& device, wgpu::Extent3D extents,
20 wgpu::TextureDimension dimension, wgpu::TextureFormat format, wgpu::TextureUsage usage,
21 int mipLevelCount = 1, std::string label = "");
22
26 static wgpu::TextureView CreateATextureView(const wgpu::Device& device, wgpu::Texture texture,
27 wgpu::TextureViewDimension dimension, wgpu::TextureAspect aspect, wgpu::TextureFormat format,
28 int baseMipLevel, int mipLevelCount, std::string label);
29
34 static void Upload(const wgpu::Device& device, wgpu::Texture texture, uint32_t bytesPerRow,
35 uint32_t byteSize, const void* data);
36
41 static void UploadFromDataArray(const wgpu::Device& device, wgpu::Texture texture,
42 uint32_t bytesPerRow, vtkDataArray* dataArray);
43
47 static wgpu::ImageCopyTexture GetImageCopyTexture(wgpu::Texture texture);
48
53 static wgpu::TextureDataLayout GetDataLayout(wgpu::Texture texture, uint32_t bytesPerRow);
54};
55
56VTK_ABI_NAMESPACE_END
57
58#endif
abstract superclass for arrays of numeric data
static wgpu::Texture CreateATexture(const wgpu::Device &device, wgpu::Extent3D extents, wgpu::TextureDimension dimension, wgpu::TextureFormat format, wgpu::TextureUsage usage, int mipLevelCount=1, std::string label="")
Creates a WebGPU texture with the given device and returns it.
static wgpu::TextureDataLayout GetDataLayout(wgpu::Texture texture, uint32_t bytesPerRow)
Get the texture data layout from the given texture and bytes per row for use in uploading data to the...
static wgpu::ImageCopyTexture GetImageCopyTexture(wgpu::Texture texture)
Get the image copy texture from the given texture for use in uploading data to the texture.
static wgpu::TextureView CreateATextureView(const wgpu::Device &device, wgpu::Texture texture, wgpu::TextureViewDimension dimension, wgpu::TextureAspect aspect, wgpu::TextureFormat format, int baseMipLevel, int mipLevelCount, std::string label)
Creates a texture view of a texture.
static void Upload(const wgpu::Device &device, wgpu::Texture texture, uint32_t bytesPerRow, uint32_t byteSize, const void *data)
Upload byteSize of data from the data pointer to the given texture using the given device and assumin...
static void UploadFromDataArray(const wgpu::Device &device, wgpu::Texture texture, uint32_t bytesPerRow, vtkDataArray *dataArray)
Uploads a maximum of bytesToUpload from a vtkDataArray to a texure assuming bytesPerRow bytes of data...