#include <modkit/gpu_inspector.h>2 functions · 6 structs · 1 enums · 7 typedefs · 2 macros
Functions
mk_gpu_inspector_get_snapshotfunction
const mk_gpu_inspector_snapshot_t * mk_gpu_inspector_get_snapshot(void)
Build and return the current inspector snapshot.
Returns NULL when graphics is not initialized or MK_DEBUG_GPU_INSPECTOR is disabled. No pool enumeration or snapshot allocation occurs in that case. Build and return the current inspector snapshot.
Returns A borrowed pointer, or NULL when unavailable.
mk_gpu_resource_kind_namefunction
const char * mk_gpu_resource_kind_name(mk_gpu_resource_kind_t kind)
Return a stable human-readable resource-kind name.
Return a stable human-readable resource-kind name.
| Parameter | Type | Description |
|---|
kind | mk_gpu_resource_kind_t | Value for kind. |
Returns A borrowed pointer, or NULL when unavailable.
Structs
mk_gpu_buffer_infostruct
Data for GPU buffer info.
| Field | Type | Description |
|---|
size_bytes | uint64_t | The size bytes. |
element_count | uint32_t | The element count. |
stride | uint16_t | The stride. |
flags | uint16_t | The flags. |
index_size | uint8_t | The index size. |
mk_gpu_inspector_snapshotstruct
A copied diagnostic snapshot.
submitted_frame_number is Modkit's latest submitted frame at request time. Pass rows describe the latest renderer-completed views available from the backend; each row carries its own gpu_frame_number because GPU timings can arrive after the corresponding submission. The returned pointer and all nested arrays remain valid until the next snapshot request, inspector disable, or graphics shutdown. Only resources created through Modkit's texture, render-target, shader and buffer pools are enumerated. Raw bgfx resources and low-level framebuffer wrappers are visible only in the aggregate mk_stats_t backend totals. Borrowed render-target attachment texture views are omitted as standalone texture rows and are described by their owning render-target row instead.
| Field | Type | Description |
|---|
submitted_frame_number | uint32_t | The submitted frame number. |
stats | mk_stats_t | The stats. |
num_passes | uint32_t | The num passes. |
passes | const mk_view_stats_t * | The passes. |
num_resources | uint32_t | The num resources. |
resources | const mk_gpu_resource_info_t * | The resources. |
mk_gpu_render_target_infostruct
Data for GPU render target info.
| Field | Type | Description |
|---|
width | uint16_t | The width. |
height | uint16_t | The height. |
type | mk_render_target_type_t | The type. |
color_attachment_count | uint8_t | The color attachment count. |
color_formats | mk_texture_format_t | The color formats. |
has_depth | bool | The has depth. |
depth_format | mk_texture_format_t | The depth format. |
samples | uint8_t | The samples. |
readable | bool | The readable. |
mk_gpu_resource_infostruct
One live Modkit GPU resource.
diagnostic_id is stable for the lifetime of the pool entry and is unique within its resource kind. estimated_size is an allocation estimate for textures and buffers; shaders use MK_GPU_RESOURCE_SIZE_UNKNOWN.
| Field | Type | Description |
|---|
diagnostic_id | uint32_t | The diagnostic ID. |
name | char | The name. |
kind | mk_gpu_resource_kind_t | The kind. |
pending_destroy | bool | The pending destroy. |
estimated_size | uint64_t | The estimated size. |
metadata | union mk_gpu_resource_info::@301073342264161256224023030173306370306255346141 | The metadata. |
metadata.texture | mk_gpu_texture_info_t | The texture. |
metadata.render_target | mk_gpu_render_target_info_t | The render target. |
metadata.shader | mk_gpu_shader_info_t | The shader. |
metadata.buffer | mk_gpu_buffer_info_t | The buffer. |
mk_gpu_shader_infostruct
Data for GPU shader info.
| Field | Type | Description |
|---|
compute | bool | The compute. |
uniform_count | uint8_t | The uniform count. |
mk_gpu_texture_infostruct
Data for GPU texture info.
| Field | Type | Description |
|---|
width | uint16_t | The width. |
height | uint16_t | The height. |
depth | uint16_t | The depth. |
layers | uint16_t | The layers. |
mip_count | uint8_t | The mip count. |
format | mk_texture_format_t | The format. |
cube | bool | The cube. |
Enums
mk_gpu_resource_kindenum
Resource kinds represented by the inspector.
| Value | Description |
|---|
MK_GPU_RESOURCE_TEXTURE | Selects texture. |
MK_GPU_RESOURCE_RENDER_TARGET | Selects render target. |
MK_GPU_RESOURCE_SHADER | Selects shader. |
MK_GPU_RESOURCE_VERTEX_BUFFER | Selects vertex buffer. |
MK_GPU_RESOURCE_INDEX_BUFFER | Selects index buffer. |
MK_GPU_RESOURCE_DYNAMIC_VERTEX_BUFFER | Selects dynamic vertex buffer. |
MK_GPU_RESOURCE_DYNAMIC_INDEX_BUFFER | Selects dynamic index buffer. |
MK_GPU_RESOURCE_KIND_COUNT | Selects kind count. |
Typedefs
mk_gpu_buffer_info_ttypedef
typedef struct mk_gpu_buffer_info mk_gpu_buffer_info_t
Data for GPU buffer info.
mk_gpu_inspector_snapshot_ttypedef
typedef struct mk_gpu_inspector_snapshot mk_gpu_inspector_snapshot_t
A copied diagnostic snapshot.
submitted_frame_number is Modkit's latest submitted frame at request time. Pass rows describe the latest renderer-completed views available from the backend; each row carries its own gpu_frame_number because GPU timings can arrive after the corresponding submission. The returned pointer and all nested arrays remain valid until the next snapshot request, inspector disable, or graphics shutdown. Only resources created through Modkit's texture, render-target, shader and buffer pools are enumerated. Raw bgfx resources and low-level framebuffer wrappers are visible only in the aggregate mk_stats_t backend totals. Borrowed render-target attachment texture views are omitted as standalone texture rows and are described by their owning render-target row instead.
mk_gpu_render_target_info_ttypedef
typedef struct mk_gpu_render_target_info mk_gpu_render_target_info_t
Data for GPU render target info.
mk_gpu_resource_info_ttypedef
typedef struct mk_gpu_resource_info mk_gpu_resource_info_t
One live Modkit GPU resource.
diagnostic_id is stable for the lifetime of the pool entry and is unique within its resource kind. estimated_size is an allocation estimate for textures and buffers; shaders use MK_GPU_RESOURCE_SIZE_UNKNOWN.
mk_gpu_resource_kind_ttypedef
typedef enum mk_gpu_resource_kind mk_gpu_resource_kind_t
Resource kinds represented by the inspector.
mk_gpu_shader_info_ttypedef
typedef struct mk_gpu_shader_info mk_gpu_shader_info_t
Data for GPU shader info.
mk_gpu_texture_info_ttypedef
typedef struct mk_gpu_texture_info mk_gpu_texture_info_t
Data for GPU texture info.
Macros
MK_GPU_RESOURCE_NAME_MAXdefine
Maximum supported GPU resource name max.
MK_GPU_RESOURCE_SIZE_UNKNOWNdefine
MK_GPU_RESOURCE_SIZE_UNKNOWN
Constant for GPU resource size unknown.