sdlInsertGpuDebugLabel function gpu

void sdlInsertGpuDebugLabel(
  1. Pointer<SdlGpuCommandBuffer> commandBuffer,
  2. String? text
)

Inserts an arbitrary string label into the command buffer callstream.

Useful for debugging.

\param command_buffer a command buffer. \param text a UTF-8 string constant to insert as the label.

\since This function is available since SDL 3.2.0.

extern SDL_DECLSPEC void SDLCALL SDL_InsertGPUDebugLabel( SDL_GPUCommandBuffer *command_buffer, const char *text)

Implementation

void sdlInsertGpuDebugLabel(
  Pointer<SdlGpuCommandBuffer> commandBuffer,
  String? text,
) {
  final sdlInsertGpuDebugLabelLookupFunction = _libSdl
      .lookupFunction<
        Void Function(
          Pointer<SdlGpuCommandBuffer> commandBuffer,
          Pointer<Utf8> text,
        ),
        void Function(
          Pointer<SdlGpuCommandBuffer> commandBuffer,
          Pointer<Utf8> text,
        )
      >('SDL_InsertGPUDebugLabel');
  final textPointer = text != null ? text.toNativeUtf8() : nullptr;
  final result = sdlInsertGpuDebugLabelLookupFunction(
    commandBuffer,
    textPointer,
  );
  calloc.free(textPointer);
  return result;
}