Blender V5.0
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
23const char *GPU_backend_get_name();
24
38
43
48
58void GPU_backend_vsync_set_override(int vsync);
60
62struct GPUContext;
63
64GPUContext *GPU_context_create(void *ghost_window, void *ghost_context);
68void GPU_context_discard(GPUContext *);
69
73void GPU_context_active_set(GPUContext *);
74GPUContext *GPU_context_active_get();
75
82void GPU_context_begin_frame(GPUContext *ctx);
83void GPU_context_end_frame(GPUContext *ctx);
84
94
96void GPU_render_begin();
97void GPU_render_end();
98
102void GPU_render_step(bool force_resource_release = false);
103
105void GPU_backend_ghost_system_set(void *ghost_system_handle);
107
108namespace blender::gpu {
109
116 private:
117 void *ghost_context_;
118 GPUContext *gpu_context_;
119
120 public:
123
125 void activate();
126};
127
128} // namespace blender::gpu
void GPU_backend_vsync_set_override(int vsync)
bool GPU_backend_vsync_is_overridden()
int GPU_backend_vsync_get()
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()
bool GPU_backend_supported()
void * GPU_backend_ghost_system_get()
const char * GPU_backend_get_name()
void GPU_context_begin_frame(GPUContext *ctx)
void GPU_render_begin()
bool GPU_backend_type_selection_is_overridden()
GPUContext * GPU_context_active_get()
void GPU_backend_type_selection_set(const GPUBackendType backend)
void GPU_backend_type_selection_set_override(GPUBackendType backend_type)
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 *)
GPUBackendType GPU_backend_get_type()
void GPU_backend_ghost_system_set(void *ghost_system_handle)
GPUBackendType GPU_backend_type_selection_get()