GpuStorageTexture¶
Import: import system.gpu;
This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation. Shader-only declarations can be used only inside shader entry points and helpers reached from them; using them elsewhere is a compile error.
GpuStorageTexture¶
A 2D texture that shaders write texel by texel, such as the image a ray tracer renders. Create one with GpuDevice.storage_texture. Inside a shader, texture[coordinate] reads and writes the texel at an integer pixel coordinate. On the CPU, read downloads every texel after the GPU finished.
width¶
Width in texels.
height¶
Height in texels.
format¶
The storage format chosen from T.
read¶
Downloads every texel, row by row from the top. It waits for submitted GPU work that writes the texture.
destroy¶
Releases the GPU memory once submitted work that uses it has finished.
this¶
Reads the texel at coordinate inside a shader.
this¶
Writes the texel at coordinate inside a shader. Writes outside the texture are dropped.