Blender V4.5
GPU_context.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2016 by Mike Erwin. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#pragma once
12
13#include "GPU_platform.hh"
14
15/* GPU back-ends abstract the differences between different APIs. #GPU_context_create
16 * automatically initializes the back-end, and #GPU_context_discard frees it when there
17 * are no more contexts. */
18
23
37
42
47
49struct GPUContext;
50
51GPUContext *GPU_context_create(void *ghost_window, void *ghost_context);
55void GPU_context_discard(GPUContext *);
56
60void GPU_context_active_set(GPUContext *);
61GPUContext *GPU_context_active_get();
62
69void GPU_context_begin_frame(GPUContext *ctx);
70void GPU_context_end_frame(GPUContext *ctx);
71
81
83void GPU_render_begin();
84void GPU_render_end();
85
89void GPU_render_step(bool force_resource_release = false);
90
92void GPU_backend_ghost_system_set(void *ghost_system_handle);
94
95namespace blender::gpu {
96
103 private:
104 void *ghost_context_;
105 GPUContext *gpu_context_;
106
107 public:
110
112 void activate();
113};
114
115} // namespace blender::gpu
void GPU_render_end()
void GPU_render_step(bool force_resource_release=false)
GPUContext * GPU_context_create(void *ghost_window, void *ghost_context)
void GPU_context_main_lock()
void GPU_backend_type_selection_set(const eGPUBackendType backend)
bool GPU_backend_supported()
void * GPU_backend_ghost_system_get()
void GPU_context_begin_frame(GPUContext *ctx)
void GPU_render_begin()
bool GPU_backend_type_selection_is_overridden()
GPUContext * GPU_context_active_get()
eGPUBackendType GPU_backend_type_selection_get()
void GPU_context_main_unlock()
void GPU_context_discard(GPUContext *)
bool GPU_backend_type_selection_detect()
void GPU_context_end_frame(GPUContext *ctx)
void GPU_context_active_set(GPUContext *)
eGPUBackendType GPU_backend_get_type()
void GPU_backend_ghost_system_set(void *ghost_system_handle)
void GPU_backend_type_selection_set_override(eGPUBackendType backend_type)