Blender V5.3
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 <cstdint>
14#include <cstdio>
15
16#include "GPU_platform.hh"
17
18struct GHOST_GPUDevice;
19
20class GHOST_IContext;
21class GHOST_ISystem;
22class GHOST_IWindow;
23
24namespace blender {
25
26struct GPUContext;
27
28/* GPU back-ends abstract the differences between different APIs. #GPU_context_create
29 * automatically initializes the back-end, and #GPU_context_discard frees it when there
30 * are no more contexts. */
31
36const char *GPU_backend_get_name();
37
51
56
61
75GHOST_GPUDevice GPU_backend_preferred_device_get();
76
77#ifdef WITH_VULKAN_BACKEND
83void GPU_vulkan_supported_devices_print(FILE *fp);
84#endif
85
95void GPU_backend_vsync_set_override(int vsync);
97
99GPUContext *GPU_context_create(GHOST_IWindow *ghost_window, GHOST_IContext *ghost_context);
103void GPU_context_discard(GPUContext *);
104
108void GPU_context_active_set(GPUContext *);
109GPUContext *GPU_context_active_get();
110
117void GPU_context_begin_frame(GPUContext *ctx);
118void GPU_context_end_frame(GPUContext *ctx);
119
129
144void GPU_context_debug_pipeline_creation(GPUContext *ctx, bool enable);
145
147void GPU_render_begin();
148void GPU_render_end();
149
153void GPU_render_step(bool force_resource_release = false);
154
156void GPU_backend_ghost_system_set(GHOST_ISystem *ghost_system_handle);
157GHOST_ISystem *GPU_backend_ghost_system_get();
158
159namespace gpu {
160
163 GPUContext *gpu_context = nullptr;
164};
165
168
171
174
177
184 private:
186
187 public:
190
192 void activate();
193};
194
199 private:
200 GPUContext *context_ = nullptr;
201
202 public:
203 DebugScopePipelineCreation(GPUContext *context) : context_(context)
204 {
206 }
211};
212
213} // namespace gpu
214} // namespace blender
void GPU_activate_secondary_context(const GPUSecondaryContextData &data)
GPUSecondaryContextData GPU_create_secondary_context()
void GPU_deactivate_secondary_context(const GPUSecondaryContextData &data)
void GPU_destroy_secondary_context(GPUSecondaryContextData &data)
BMesh Iterators.
GPUContext * GPU_context_create(GHOST_IWindow *ghost_window, GHOST_IContext *ghost_context)
void GPU_context_main_unlock()
GPUBackendType GPU_backend_get_type()
void GPU_context_end_frame(GPUContext *ctx)
void GPU_render_step(bool force_resource_release=false)
bool GPU_backend_supported()
GHOST_ISystem * GPU_backend_ghost_system_get()
bool GPU_backend_type_selection_detect()
int GPU_backend_vsync_get()
void GPU_render_begin()
void GPU_context_active_set(GPUContext *)
bool GPU_backend_type_selection_is_overridden()
void GPU_context_begin_frame(GPUContext *ctx)
unsigned int uint32_t
Definition BKE_text.h:81
void GPU_render_end()
GPUBackendType GPU_backend_type_selection_get()
BMesh const char void * data
void GPU_backend_vsync_set_override(int vsync)
void GPU_backend_type_selection_set_override(GPUBackendType backend_type)
const char * GPU_backend_get_name()
bool GPU_backend_vsync_is_overridden()
void GPU_backend_ghost_system_set(GHOST_ISystem *ghost_system_handle)
void GPU_context_debug_pipeline_creation(GPUContext *ctx, bool enable)
Enable shader create info pipeline state assert.
GHOST_GPUDevice GPU_backend_preferred_device_get()
void GPU_backend_preferred_device_set_override(int index, uint32_t vendor_id, uint32_t device_id)
void GPU_backend_type_selection_set(const GPUBackendType backend)
void GPU_context_main_lock()
GPUContext * GPU_context_active_get()
void GPU_context_discard(GPUContext *)
DebugScopePipelineCreation(GPUContext *context)