Skip to main content

Module gpu_utils

Module gpu_utils 

Source
Expand description

Common GPU utilities for texture and sampler creation.

This module provides reusable helper functions for common wgpu operations to reduce code duplication across renderer modules.

Functionsยง

create_linear_sampler
Create a linear sampler with ClampToEdge address mode.
create_render_texture
Create an RGBA texture with render target usage.
create_repeat_sampler
Create a linear sampler with Repeat address mode.
create_rgba_texture
Create an RGBA texture with the specified dimensions.
create_sampler_with_filter
Create a sampler with the specified filter mode and ClampToEdge address mode.
write_rgba_texture
Write RGBA pixel data to a texture.
write_rgba_texture_region
Write RGBA pixel data to a specific region of a texture.