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