VTK  9.3.20240919
vtkWebGPUComputeRenderTexture.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 vtkWebGPUComputeRenderTexture_h
5#define vtkWebGPUComputeRenderTexture_h
6
7#include "vtkRenderingWebGPUModule.h" // For export macro
8#include "vtkWeakPointer.h" // for weak pointer on the associated compute pass
9#include "vtkWebGPUComputePass.h" // For compute pass
11#include "vtkWebGPUComputeTextureView.h" // For the texture view aspect attribute
12
13VTK_ABI_NAMESPACE_BEGIN
14
20class VTKRENDERINGWEBGPU_EXPORT vtkWebGPUComputeRenderTexture : public vtkWebGPUComputeTexture
21{
22public:
25
26 void PrintSelf(ostream& os, vtkIndent indent) override;
27
36 {
37 UNDEFINED = 0,
39 COLOR_BUFFER
40 };
41
43
49
51
58
60
64 void SetWebGPUTexture(wgpu::Texture texture) { this->WebGPUTexture = texture; };
65 wgpu::Texture GetWebGPUTexture() { return this->WebGPUTexture; };
67
69
79
80protected:
85
86private:
87 // Aspect for the future texture view of this texture in a compute pass
90
91 // We may want vtkWebGPUComputePipeline::AddTexture() not to create a new device texture for this
92 // vtkWebGPUComputeBuffer but rather use an exisiting one that has been created elsewhere (by a
93 // webGPUPolyDataMapper for example). This is the attribute that points to this 'already existing'
94 // buffer.
95 wgpu::Texture WebGPUTexture = nullptr;
96
104 vtkWeakPointer<vtkWebGPUComputePass> AssociatedComputePass = nullptr;
105
110};
111
112VTK_ABI_NAMESPACE_END
113
114#endif
a simple class to control print indentation
Definition vtkIndent.h:108
a weak reference to a vtkObject.
Render textures are returned by calls to vtkWebGPUPolyDataMapper::AcquireXXXXRenderTexture() and repr...
static vtkWebGPUComputeRenderTexture * New()
vtkGetEnumMacro(Type, RenderTextureType)
Get/set the render texture type.
void operator=(const vtkWebGPUComputeRenderTexture &)=delete
wgpu::Texture GetWebGPUTexture()
Get/set the WebGPU texture (used when this ComputeTexture points to an already existing device buffer...
vtkSetEnumMacro(Aspect, vtkWebGPUComputeTextureView::TextureViewAspect)
Get/set the texture aspect that is going to be passed to the texture view created for this render tex...
vtkSetEnumMacro(Type, RenderTextureType)
Get/set the render texture type.
void SetWebGPUTexture(wgpu::Texture texture)
Get/set the WebGPU texture (used when this ComputeTexture points to an already existing device buffer...
void SetAssociatedComputePass(vtkWeakPointer< vtkWebGPUComputePass > computePass)
Get/set the associated compute pass.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
RenderTextureType
What type of texture of the vtk render pipeline is this ComputeRenderTexture refering to.
vtkWebGPUComputeRenderTexture(const vtkWebGPUComputeRenderTexture &)=delete
vtkGetEnumMacro(Aspect, vtkWebGPUComputeTextureView::TextureViewAspect)
Get/set the texture aspect that is going to be passed to the texture view created for this render tex...
~vtkWebGPUComputeRenderTexture() override
vtkWeakPointer< vtkWebGPUComputePass > GetAssociatedComputePass()
Get/set the associated compute pass.
Represents the set of parameters that will be used to create a compute shader texture on the device w...
TextureViewAspect
What will the shader sample from the texture when calling a sampling function.