Listing the "Blender Foundation" as copyright holder implied the Blender Foundation holds copyright to files which may include work from many developers. While keeping copyright on headers makes sense for isolated libraries, Blender's own code may be refactored or moved between files in a way that makes the per file copyright holders less meaningful. Copyright references to the "Blender Foundation" have been replaced with "Blender Authors", with the exception of `./extern/` since these this contains libraries which are more isolated, any changed to license headers there can be handled on a case-by-case basis. Some directories in `./intern/` have also been excluded: - `./intern/cycles/` it's own `AUTHORS` file is planned. - `./intern/opensubdiv/`. An "AUTHORS" file has been added, using the chromium projects authors file as a template. Design task: #110784 Ref !110783.
101 lines
2.7 KiB
C
101 lines
2.7 KiB
C
/* SPDX-FileCopyrightText: 2020 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*
|
|
* Helpers for GPU / drawing debugging.
|
|
*
|
|
*
|
|
** GPU debug capture usage example:
|
|
*
|
|
** Instant frame capture. **
|
|
*
|
|
* \code
|
|
* #include "GPU_debug.h"
|
|
* static void do_render_engine(Render *re)
|
|
* {
|
|
* GPU_debug_capture_begin();
|
|
* RE_engine_render(re, false);
|
|
* GPU_debug_capture_end();
|
|
* }
|
|
* \endcode
|
|
*
|
|
** Capture scopes. **
|
|
*
|
|
* \code
|
|
* #include "GPU_debug.h"
|
|
* void *capture_scope = nullptr;
|
|
* static void do_render_engine(Render *re)
|
|
* {
|
|
* if (!capture_scope) {
|
|
* // Create capture scope which will display in external tool.
|
|
* capture_scope = GPU_debug_capture_scope_create("Render Frame");
|
|
* }
|
|
*
|
|
* // Commands within scope boundary captured when requested in tool.
|
|
* GPU_debug_capture_scope_begin(capture_scope);
|
|
* RE_engine_render(re, false);
|
|
* GPU_debug_capture_scope_end(capture_scope);
|
|
* }
|
|
* \endcode
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "BLI_sys_types.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define GPU_DEBUG_SHADER_COMPILATION_GROUP "Shader Compilation"
|
|
|
|
void GPU_debug_group_begin(const char *name);
|
|
void GPU_debug_group_end(void);
|
|
/**
|
|
* Return a formatted string showing the current group hierarchy in this format:
|
|
* "Group1 > Group 2 > Group3 > ... > GroupN : "
|
|
*/
|
|
void GPU_debug_get_groups_names(int name_buf_len, char *r_name_buf);
|
|
/**
|
|
* Return true if inside a debug group with the same name.
|
|
*/
|
|
bool GPU_debug_group_match(const char *ref);
|
|
|
|
/**
|
|
* GPU Frame capture support.
|
|
*
|
|
* Allows instantaneous frame capture of GPU calls between begin/end.
|
|
*/
|
|
void GPU_debug_capture_begin(void);
|
|
void GPU_debug_capture_end(void);
|
|
|
|
/**
|
|
* GPU debug frame capture scopes.
|
|
*
|
|
* Allows creation of a GPU frame capture scope that define a region within which an external GPU
|
|
* Frame capture tool can perform a deferred capture of GPU API calls within the boundary upon user
|
|
* request.
|
|
*
|
|
* \param name: Unique name of capture scope displayed within capture tool.
|
|
* \return pointer wrapping an API-specific capture scope object.
|
|
* \note a capture scope should be created a single time and only used within one begin/end pair.
|
|
*/
|
|
void *GPU_debug_capture_scope_create(const char *name);
|
|
|
|
/**
|
|
* Used to declare the region within which GPU calls are captured when the scope is triggered.
|
|
*
|
|
* \param scope: Pointer to capture scope object created with GPU_debug_capture_scope_create.
|
|
* \return True if the capture tool is actively capturing this scope when function is executed.
|
|
* Otherwise, False.
|
|
*/
|
|
bool GPU_debug_capture_scope_begin(void *scope);
|
|
void GPU_debug_capture_scope_end(void *scope);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|