Blender V5.0
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
9
10# ifdef WITH_CUDA_DYNLOAD
11# include "cuew.h"
12# else
13# include <cuda.h>
14# endif
15
17
18class CUDADevice;
19class CUDADeviceQueue;
20
21class CUDADeviceGraphicsInterop : public DeviceGraphicsInterop {
22 public:
23 explicit CUDADeviceGraphicsInterop(CUDADeviceQueue *queue);
24
25 CUDADeviceGraphicsInterop(const CUDADeviceGraphicsInterop &other) = delete;
26 CUDADeviceGraphicsInterop(CUDADeviceGraphicsInterop &&other) noexcept = delete;
27
28 ~CUDADeviceGraphicsInterop() override;
29
30 CUDADeviceGraphicsInterop &operator=(const CUDADeviceGraphicsInterop &other) = delete;
31 CUDADeviceGraphicsInterop &operator=(CUDADeviceGraphicsInterop &&other) = delete;
32
33 void set_buffer(GraphicsInteropBuffer &interop_buffer) override;
34
35 device_ptr map() override;
36 void unmap() override;
37
38 protected:
39 CUDADeviceQueue *queue_ = nullptr;
40 CUDADevice *device_ = nullptr;
41
42 /* Size of the buffer in bytes. */
43 size_t buffer_size_ = 0;
44
45 /* The destination was requested to be cleared. */
46 bool need_zero_ = false;
47
48 /* CUDA resources. */
49 CUgraphicsResource cu_graphics_resource_ = nullptr;
50 CUexternalMemory cu_external_memory_ = nullptr;
51 CUdeviceptr cu_external_memory_ptr_ = 0;
52
53 /* Vulkan handle to free. */
54# ifdef _WIN32
55 int64_t vulkan_windows_handle_ = 0;
56# endif
57
58 void free();
59};
60
62
63#endif
void BLI_kdtree_nd_ free(KDTree *tree)
long long int int64_t
btGeneric6DofConstraint & operator=(btGeneric6DofConstraint &other)
#define CCL_NAMESPACE_END
uint64_t device_ptr
Definition types_base.h:44