VTK  9.7.1
vtkWebGPUCommandEncoderDebugGroup.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
18 #ifndef vtkWebGPUCommandEncoderDebugGroup_h
19 #define vtkWebGPUCommandEncoderDebugGroup_h
20 
21 #include "vtkABINamespace.h" // for VTK_ABI_NAMESPACE macros
22 #include "vtkRenderingWebGPUModule.h" // for export macro
23 #include "vtk_wgpu.h" // for wgpu::RenderPassEncoder
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 
27 class VTKRENDERINGWEBGPU_EXPORT vtkWebGPUCommandEncoderDebugGroup
28 {
29 public:
31  const wgpu::RenderPassEncoder& passEncoder, const char* groupLabel);
33  const wgpu::RenderBundleEncoder& passEncoder, const char* groupLabel);
35  const wgpu::CommandEncoder& commandEncoder, const char* groupLabel);
37 
39 
40  // make this class non-copyable and non-movable.
42  void operator=(const vtkWebGPUCommandEncoderDebugGroup&) = delete;
44  void operator=(vtkWebGPUCommandEncoderDebugGroup&&) = delete;
45 
46 private:
47  const wgpu::RenderPassEncoder* PassEncoder = nullptr;
48  const wgpu::RenderBundleEncoder* BundleEncoder = nullptr;
49  const wgpu::CommandEncoder* CommandEncoder = nullptr;
50 };
51 
52 #define vtkScopedEncoderDebugGroupConcatImpl(s1, s2) s1##s2
53 #define vtkScopedEncoderDebugGroupConcat(s1, s2) vtkScopedEncoderDebugGroupConcatImpl(s1, s2)
54 #define vtkScopedEncoderDebugGroupAnonymousVariable(x) vtkScopedEncoderDebugGroupConcat(x, __LINE__)
55 // Use this macro to annotate a group of commands in an renderpass/bundle encoder.
56 #define vtkScopedEncoderDebugGroup(encoder, name) \
57  ::vtkWebGPUCommandEncoderDebugGroup vtkScopedEncoderDebugGroupAnonymousVariable( \
58  encoderDebugGroup)(encoder, name)
59 
60 VTK_ABI_NAMESPACE_END
61 #endif
Convenient class that inserts annotations around draw commands within a render pass/bundle.