VTK  9.5.20250802
vtkWebGPUTextureView.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 vtkWebGPUTextureView_h
5#define vtkWebGPUTextureView_h
6
7#include "vtkObject.h"
8#include "vtkRenderingWebGPUModule.h" // For export macro
9#include "vtkWebGPUTexture.h" // for TextureFormat, TextureDimension, ...
10#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
11
12VTK_ABI_NAMESPACE_BEGIN
13
18class VTKRENDERINGWEBGPU_EXPORT VTK_MARSHALAUTO vtkWebGPUTextureView : public vtkObject
19{
20public:
23
24 void PrintSelf(ostream& os, vtkIndent indent) override;
25
38 {
39 ASPECT_ALL = 0,
41 ASPECT_STENCIL
42 };
43
57 {
58 UNDEFINED = 0,
62 READ_WRITE_STORAGE
63 };
64
66
69 vtkGetMacro(BaseMipLevel, int);
70 vtkSetMacro(BaseMipLevel, int);
72
74
78 vtkGetMacro(MipLevelCount, int);
79 vtkSetMacro(MipLevelCount, int);
81
83
86 vtkGetMacro(Group, vtkIdType);
87 vtkSetMacro(Group, vtkIdType);
89
91
94 vtkGetMacro(Binding, vtkIdType);
95 vtkSetMacro(Binding, vtkIdType);
97
99
105
107
110 vtkGetMacro(Dimension, vtkWebGPUTexture::TextureDimension);
111 vtkSetMacro(Dimension, vtkWebGPUTexture::TextureDimension);
113
115
121
123
129
131
135 vtkGetMacro(Label, std::string&);
136 vtkSetMacro(Label, std::string);
138
139protected:
142
143private:
145 void operator=(const vtkWebGPUTextureView&) = delete;
146
147 // Mip level of the base texture that this texture view gives a view on
148 int BaseMipLevel = 0;
149 // How many mip levels this texture view give the shader access to
150 int MipLevelCount = 1;
151
152 // Bind group of the texture view
153 vtkIdType Group = -1;
154
155 // Binding of the texture view
156 vtkIdType Binding = -1;
157
158 // What aspect of the texture is going to be sampled by the samplers in the shaders sampling this
159 // texture
160 vtkWebGPUTextureView::TextureViewAspect Aspect = TextureViewAspect::ASPECT_ALL;
161
162 // Dimension of the texture view
164
165 // Format of the texture view
167
168 // Mode of the texture view
170
171 // Label used for debugging if something goes wrong
172 std::string Label = "Texture view";
173};
174
175VTK_ABI_NAMESPACE_END
176
177#endif
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Abstraction class for WebGPU texture views.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkWebGPUTextureView * New()
~vtkWebGPUTextureView() override
TextureViewAspect
What will the shader sample from the texture when calling a sampling function.
TextureViewMode
The mode of the texture view to define what operations will be doable on the texture in the shader.
TextureDimension
How the texture data is arranged.
TextureFormat
RGBA8_UNORM: Uses RGB + alpha.
int vtkIdType
Definition vtkType.h:332
#define VTK_MARSHALAUTO