SDL_GPURasterizerState(3type)
π SDL_GPURasterizerState π
okay bestie, welcome to the SDL_GPURasterizerState page β it's a 3type from the SDL3 DATATYPES crew, and it's literally the glow-up your graphics pipeline's rasterizer needs. β¨
πΈ NAME πΈ
SDL_GPURasterizerState β a structure specifying the parameters of the graphics pipeline rasterizer state.
no cap, that's the whole vibe. it's the lil' bundle of settings that tells the rasterizer how to turn your triangles into actual pixels. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_gpu.h>
typedef struct SDL_GPURasterizerState
{
SDL_GPUFillMode fill_mode; /**< Whether polygons will be filled in or drawn as lines. */
SDL_GPUCullMode cull_mode; /**< The facing direction in which triangles will be culled. */
SDL_GPUFrontFace front_face; /**< The vertex winding that will cause a triangle to be determined as front-facing. */
float depth_bias_constant_factor; /**< A scalar factor controlling the depth value added to each fragment. */
float depth_bias_clamp; /**< The maximum depth bias of a fragment. */
float depth_bias_slope_factor; /**< A scalar factor applied to a fragment's slope in depth calculations. */
bool enable_depth_bias; /**< true to bias fragment depth values. */
bool enable_depth_clip; /**< true to enable depth clip, false to enable depth clamp. */
Uint8 padding1;
Uint8 padding2;
} SDL_GPURasterizerState;
look at those fields. every single one is pulling its weight. we love a struct with range. π
π¦ DESCRIPTION π¦
So here's the tea, and it's important tea:
note thatSDL_GPU_FILLMODE_LINEis not supported on many Android devices. for those devices, the fill mode will automatically fall back toFILL. so like, if you're on Android and you asked for lines, bestieβ¦ you're getting fills. it's giving "the device said no". π
Also, another thing you gotta know (this one is a whole plot twist):
the D3D12 driver will enable depth clamping even ifenable_depth_clipistrue. yes, even if. if you need this clamp+clip behavior, consider enabling depth clip and then manually clamping depth in your fragment shaders on Metal and Vulkan. iykyk. π
π AVAILABILITY π
This struct is available since SDL 3.2.0. so it's not new-new, but it's also not ancient. it's in its prime. main character era. π«Ά
π SEE ALSO π
SDL_GPUGraphicsPipelineCreateInfo(3type)β the sibling you'll be stuffing this struct into, fr fr.
and that's the whole page, bestie!! go forth and rasterize responsibly. πβ¨ππ¦πΈ
this lil' rewrite was brought to you by Simple Directmedia Layer, version SDL 3.4.18. mwah. π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms