SDL_GetGPUDeviceProperties(3)

πŸ“¦
version 3.4.18 Β· 5 versions
, in fedora 43, fedora 44

πŸ’– SDL_GetGPUDeviceProperties πŸ’–

bestie. you're in the SDL3 FUNCTIONS section of the manual and this page is all about peeking at the ✨properties✨ hanging off a GPU device. it's giving backstage pass energy. let's go. πŸŽ€


🌸 NAME 🌸

SDL_GetGPUDeviceProperties β€” get the properties associated with a GPU device. periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_gpu.h>

SDL_PropertiesID SDL_GetGPUDeviceProperties(SDL_GPUDevice *device);

✨ DESCRIPTION ✨

okay so every single one of these properties is optional and they can literally differ between GPU backends and between SDL versions. so like, don't build your whole personality on them existing, bestie. πŸ™ˆ

Here are the properties SDL provides:

  • SDL_PROP_GPU_DEVICE_NAME_STRING β€” this one holds the name of the underlying device, exactly as the system driver reported it. and listen: this string has no standardized format, it's highkey inconsistent between hardware and drivers, and it can change at literally any time. do not try to parse it. it's bound to fail at some point in the future when system drivers get updated, when new hardware drops, or when SDL adds new GPU backends or messes with the existing ones. i'm so serious. πŸ’€

Strings that have been found in the wild include:

  • GTX 970
  • GeForce GTX 970
  • NVIDIA GeForce GTX 970
  • Microsoft Direct3D12 (NVIDIA GeForce GTX 970)
  • NVIDIA Graphics Device
  • GeForce GPU
  • P106-100
  • AMD 15D8:C9
  • AMD Custom GPU 0405
  • AMD Radeon (TM) Graphics
  • ASUS Radeon RX 470 Series
  • Intel(R) Arc(tm) A380 Graphics (DG2)
  • Virtio-GPU Venus (NVIDIA TITAN V)
  • SwiftShader Device (LLVM 16.0.0)
  • llvmpipe (LLVM 15.0.4, 256 bits)
  • Microsoft Basic Render Driver
  • unknown device

and the way that list just exposed everything 😭 it shows that the same device can come in different formats, that the vendor name may or may not even show up in the string, that the vendor name included might not be the vendor of the chipset on the device at all, that some manufacturers slap pseudo-legal marks in there while others don't, that some devices don't use a marketing name in the string, that the device string may be wrapped by the name of a translation interface, that the device may be emulated in software, or that the string might just be generic text that doesn't identify the device at all. no cap.

  • SDL_PROP_GPU_DEVICE_DRIVER_NAME_STRING β€” the self-reported name of the underlying system driver. lowkey iconic, highkey unstandardized.

Strings that have been found in the wild include:

  • Intel Corporation
  • Intel open-source Mesa driver
  • Qualcomm Technologies Inc. Adreno Vulkan Driver
  • MoltenVK
  • Mali-G715
  • venus
  • SDL_PROP_GPU_DEVICE_DRIVER_VERSION_STRING β€” the self-reported version of the underlying system driver. it's a relatively short version string in an unspecified format. if SDL_PROP_GPU_DEVICE_DRIVER_INFO_STRING is available, then that one should be preferred over this one, because it may contain extra info that's useful for identifying the exact driver version in use. πŸ‘‘

Strings that have been found in the wild include:

  • 53.0.0
  • 0.405.2463
  • 32.0.15.6614
  • SDL_PROP_GPU_DEVICE_DRIVER_INFO_STRING β€” the detailed version info of the underlying system driver, as reported by the driver itself. it's an arbitrary string with no standardized format and it may contain newlines. this property should be preferred over SDL_PROP_GPU_DEVICE_DRIVER_VERSION_STRING if it's available, since it usually contains the same info but in a format that's easier to read. slay.

Strings that have been found in the wild include:

  • 101.6559
  • 1.2.11
  • Mesa 21.2.2 (LLVM 12.0.1)
  • Mesa 22.2.0-devel (git-f226222 2022-04-14 impish-oibaf-ppa)
  • v1.r53p0-00eac0.824c4f31403fb1fbf8ee1042422c2129

this string has also been observed being a multiline string (which has a trailing newline):

Driver Build: 85da404, I46ff5fc46f, 1606794520
Date: 11/30/20
Compiler Version: EV031.31.04.01
Driver Branch: promo490_3_Google

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • device β€” a GPU context to query. that's the whole assignment bestie. 🫢

πŸ’œ RETURN VALUE πŸ’œ

Returns a valid property ID on success, or 0 on failure. and if it fails, call SDL_GetError() for more info β€” she'll tell you what went wrong, i promise. 😭


🌈 THREAD SAFETY 🌈

it is safe to call this function from any thread. go off, multithreaded queen. πŸ’…


⭐ AVAILABILITY ⭐

This function is available since SDL 3.4.0.


and that's the whole page, bestie, you ate it. πŸ’– this came to you from Simple Directmedia Layer, version SDL 3.4.18, and it's the SDL_GetGPUDeviceProperties(3) page β€” so go get those device properties, stay unparseable, and don't ever try to parse that name string. mwah. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from