sdlPushGpuDebugGroup function gpu

void sdlPushGpuDebugGroup(
  1. Pointer<SdlGpuCommandBuffer> commandBuffer,
  2. String? name
)

Begins a debug group with an arbitrary name.

Used for denoting groups of calls when viewing the command buffer callstream in a graphics debugging tool.

Each call to SDL_PushGPUDebugGroup must have a corresponding call to SDL_PopGPUDebugGroup.

On Direct3D 12, using SDL_PushGPUDebugGroup requires WinPixEventRuntime.dll to be in your PATH or in the same directory as your executable. See here for instructions on how to obtain it.

On some backends (e.g. Metal), pushing a debug group during a render/blit/compute pass will create a group that is scoped to the native pass rather than the command buffer. For best results, if you push a debug group during a pass, always pop it in the same pass.

\param command_buffer a command buffer. \param name a UTF-8 string constant that names the group.

\since This function is available since SDL 3.2.0.

\sa SDL_PopGPUDebugGroup

extern SDL_DECLSPEC void SDLCALL SDL_PushGPUDebugGroup( SDL_GPUCommandBuffer *command_buffer, const char *name)

Implementation

void sdlPushGpuDebugGroup(
  Pointer<SdlGpuCommandBuffer> commandBuffer,
  String? name,
) {
  final sdlPushGpuDebugGroupLookupFunction = _libSdl
      .lookupFunction<
        Void Function(
          Pointer<SdlGpuCommandBuffer> commandBuffer,
          Pointer<Utf8> name,
        ),
        void Function(
          Pointer<SdlGpuCommandBuffer> commandBuffer,
          Pointer<Utf8> name,
        )
      >('SDL_PushGPUDebugGroup');
  final namePointer = name != null ? name.toNativeUtf8() : nullptr;
  final result = sdlPushGpuDebugGroupLookupFunction(commandBuffer, namePointer);
  calloc.free(namePointer);
  return result;
}