VTK  9.4.20241109
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
11VTK_ABI_NAMESPACE_BEGIN
12
17class VTKRENDERINGWEBGPU_EXPORT vtkWebGPUTextureView : public vtkObject
18{
19public:
22
23 void PrintSelf(ostream& os, vtkIndent indent) override;
24
37 {
38 ASPECT_ALL = 0,
40 ASPECT_STENCIL
41 };
42
56 {
57 UNDEFINED = 0,
61 READ_WRITE_STORAGE
62 };
63
65
68 vtkGetMacro(BaseMipLevel, int);
69 vtkSetMacro(BaseMipLevel, int);
71
73
77 vtkGetMacro(MipLevelCount, int);
78 vtkSetMacro(MipLevelCount, int);
80
82
85 vtkGetMacro(Group, vtkIdType);
86 vtkSetMacro(Group, vtkIdType);
88
90
93 vtkGetMacro(Binding, vtkIdType);
94 vtkSetMacro(Binding, vtkIdType);
96
98
104
106
109 vtkGetMacro(Dimension, vtkWebGPUTexture::TextureDimension);
110 vtkSetMacro(Dimension, vtkWebGPUTexture::TextureDimension);
112
114
120
122
128
130
134 vtkGetMacro(Label, std::string&);
135 vtkSetMacro(Label, std::string);
137
138protected:
141
142private:
144 void operator=(const vtkWebGPUTextureView&) = delete;
145
146 // Mip level of the base texture that this texture view gives a view on
147 int BaseMipLevel = 0;
148 // How many mip levels this texture view give the shader access to
149 int MipLevelCount = 1;
150
151 // Bind group of the texture view
152 vtkIdType Group = -1;
153
154 // Binding of the texture view
155 vtkIdType Binding = -1;
156
157 // What aspect of the texture is going to be sampled by the samplers in the shaders sampling this
158 // texture
159 vtkWebGPUTextureView::TextureViewAspect Aspect = TextureViewAspect::ASPECT_ALL;
160
161 // Dimension of the texture view
163
164 // Format of the texture view
166
167 // Mode of the texture view
169
170 // Label used for debugging if something goes wrong
171 std::string Label = "Texture view";
172};
173
174VTK_ABI_NAMESPACE_END
175
176#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:315