STRUCT VC4_TEXTURE_SAMPLE_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ struct vc4_texture_sample_info(9) πŸ’œ

okay so bestie, welcome to the Kernel API Manual ✨ β€” this one's a lil struct page from the kernel docs and it's basically the receipts for where your texture setup params live inside the UBO πŸŽ€


🌸 NAME 🌸

struct vc4_texture_sample_info β€” it saves the offsets into the UBO for texture setup parameters. that's it, that's the whole job πŸ’…


✨ SYNOPSIS ✨

struct vc4_texture_sample_info {
    bool is_direct;
    uint32_t p_offset[4];
 };

(no cap, that trailing brace is indented exactly like that in the source, we don't touch it 🫢)


πŸ¦‹ Members πŸ¦‹

so the struct's got two things in it:

  • is_direct β€” a bool, sitting right there in the struct πŸ’–
  • uint32_t p_offset[4] β€” an array of four uint32_t, the actual offsets πŸ‘‘

the page doesn't hand out a separate lil blurb for each member β€” the whole vibe lives in the Description, so scroll down bestie ⬇️


πŸ’€ Description πŸ’€

okay so here's the tea πŸ”₯ this struct gets used at draw time to relocate the reference to the texture contents in p0, and to validate that the offset β€” combined with width/height/stride/etc. from p1 and p2/p3 β€” doesn't sample outside the BO. like, it's a vibe check for your memory bounds, literally 🧚

and here's the iconic part: the hardware treats unprovided config parameters as 0, so not all of them need to be set up for every texture sample. so the code just stores ~0 as the offset to mark the unused ones. clever, ate, no notes πŸ’…βœ¨

if you want the actual definitions of the texture parameters, go read the VC4 3D architecture guide page 41 ("Texture and Memory Lookup Unit Setup") β€” that's where the real lore is πŸ“–πŸŒˆ

πŸŽ€ SEE ALSO πŸŽ€

  • Kernel file ./drivers/gpu/drm/vc4/vc4_drv.h struct vc4_validated_shader_info(9)
  • __wait_for(9)

and that's the whole page bestie, you understood it, slay 🌟 this came to you from ./drivers/gpu/drm/vc4, dated October 2026, in the Kernel API Manual β€” mwah, go sample some textures responsibly πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from