Skip to main content

Module device

Module device 

Source
Expand description

Pipeline / buffer / texture creation helpers (render-thread only).

Every creator here hands its RID straight to an Owned handle bound to the caller’s RidSink, so the resource is released by Drop alone — see gpu::owned for the drop-order contract. Nothing in this module frees a RID explicitly.

Functions§

atlas_texture
RGBA8-UNORM storage texture (compute writes, material samples). Used for the Phase-4 per-chunk colour/normal detail atlases: STORAGE_BIT so the bake compute pass can write it, SAMPLING_BIT so terrain_chunk.gdshader can texelFetch it. Normals are encoded *0.5+0.5 into [0,1] to fit unorm.
attribute_texture
RGBA16F storage texture (compute writes, material samples).
compute_pipeline
Compute shader + pipeline from SPIR-V bytes produced by build.rs.
compute_pipeline_from_glsl
Compute shader + pipeline from GLSL source compiled at runtime by Godot’s own shader compiler (no slangc, nothing extra shipped). Used for the user-authored custom-surface terrain (crate::custom_surface): a compile error is logged with Godot’s message and returns None so the caller can fall back to the built-in path instead of crashing.
position_texture
RGBA32F storage texture (compute writes world positions, material samples). One texel per vertex: the surface material reads VERTEX from here because a spatial shader cannot sample the verts storage buffer the readback uses.
storage_buffer
Storage buffer pre-filled with bytes.
storage_buffer_empty
Uninitialized storage buffer of size bytes.
uniform