SDL_GPUPrimitiveType(3type)

πŸ’… SDL_GPUPrimitiveType πŸ’…

okay so bestie, this one's from the SDL3 DATATYPES manual β€” it's a lil enum from SDL3 and it's literally the thing that tells your graphics pipeline what shape to draw. no cap.


✨ NAME ✨

SDL_GPUPrimitiveType β€” specifies the primitive topology of a graphics pipeline. it's giving "what are we even drawing here" and honestly? iconic.


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_gpu.h>

typedef enum SDL_GPUPrimitiveType
{
    SDL_GPU_PRIMITIVETYPE_TRIANGLELIST,  /**< A series of separate triangles. */
    SDL_GPU_PRIMITIVETYPE_TRIANGLESTRIP, /**< A series of connected triangles. */
    SDL_GPU_PRIMITIVETYPE_LINELIST,      /**< A series of separate lines. */
    SDL_GPU_PRIMITIVETYPE_LINESTRIP,     /**< A series of connected lines. */
    SDL_GPU_PRIMITIVETYPE_POINTLIST      /**< A series of separate points. */
} SDL_GPUPrimitiveType;

🌸 DESCRIPTION 🌸

so here's the tea πŸ“ β€” if you're using POINTLIST you must include a point size output in the vertex shader. like, mandatory. no skipping. 🫢

  • for HLSL compiling to SPIRV you must decorate a float output with [[vk::builtin("PointSize")]].
  • for GLSL you must set the gl_PointSize builtin.
  • for MSL you must include a float output with the [[point_size]] decorator.
⚠️ also bestie, sized point topology is totally unsupported on D3D12. any size other than 1 will be ignored. and in general? you should avoid using point topology for both compatibility and performance reasons. you WILL regret using it. that's not me being dramatic, that's the manpage being dramatic. πŸ’€

🌈 AVAILABILITY 🌈

this enum has been available since SDL 3.2.0. she's new-ish, she's fresh, she ate. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€


mwah πŸ’œ that's the whole page! brought to you by the lovely folks at Simple Directmedia Layer, running SDL 3.4.18 β€” this is SDL_GPUPrimitiveType(3type), signing off. stay hydrated, draw your triangles, and please don't use point topology. πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from