Blender  V3.3
cuda/graphics_interop.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #ifdef WITH_CUDA
5 
7 
8 # ifdef WITH_CUDA_DYNLOAD
9 # include "cuew.h"
10 # else
11 # include <cuda.h>
12 # endif
13 
15 
16 class CUDADevice;
17 class CUDADeviceQueue;
18 
19 class CUDADeviceGraphicsInterop : public DeviceGraphicsInterop {
20  public:
21  explicit CUDADeviceGraphicsInterop(CUDADeviceQueue *queue);
22 
23  CUDADeviceGraphicsInterop(const CUDADeviceGraphicsInterop &other) = delete;
24  CUDADeviceGraphicsInterop(CUDADeviceGraphicsInterop &&other) noexcept = delete;
25 
26  ~CUDADeviceGraphicsInterop();
27 
28  CUDADeviceGraphicsInterop &operator=(const CUDADeviceGraphicsInterop &other) = delete;
29  CUDADeviceGraphicsInterop &operator=(CUDADeviceGraphicsInterop &&other) = delete;
30 
31  virtual void set_display_interop(const DisplayDriver::GraphicsInterop &display_interop) override;
32 
33  virtual device_ptr map() override;
34  virtual void unmap() override;
35 
36  protected:
37  CUDADeviceQueue *queue_ = nullptr;
38  CUDADevice *device_ = nullptr;
39 
40  /* OpenGL PBO which is currently registered as the destination for the CUDA buffer. */
41  uint opengl_pbo_id_ = 0;
42  /* Buffer area in pixels of the corresponding PBO. */
43  int64_t buffer_area_ = 0;
44 
45  /* The destination was requested to be cleared. */
46  bool need_clear_ = false;
47 
48  CUgraphicsResource cu_graphics_resource_ = nullptr;
49 };
50 
52 
53 #endif
unsigned int uint
Definition: BLI_sys_types.h:67
btGeneric6DofConstraint & operator=(btGeneric6DofConstraint &other)
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
SyclQueue * queue
SocketIndexByIdentifierMap * map
__int64 int64_t
Definition: stdint.h:89
uint64_t device_ptr
Definition: util/types.h:43