58 Commits

Author SHA1 Message Date
adrien
5f8da0940d GpuBuffer read no longer allocate an staging buffer itself. Instead need to manually do it and use new copy function to move data from a buffer to a mapable one 2026-05-22 00:41:28 +02:00
adrien
4901dc654d GpuBuffer now hold its def and not values directly 2026-05-22 00:30:29 +02:00
adrien
e03cb3f285 Added back VRAM budget check for GpuBuffer, must be forgotten when refactoring it 2026-05-22 00:17:54 +02:00
AdrienBouvais
d503ce7dea Added optional label in definitions and added logs when alloc, free and device info 2026-05-21 10:26:20 +02:00
adrien
7d425e4061 Changed how Allocator work to be more Zig like
Now GpuArena doesn't do everything.

- Created GpuDeviceAllocator that allocate to the device
- GpuArena become GpuArenaAllocator and use a child_allocator like
std.heap.ArenaAllocator
2026-05-20 13:32:37 +02:00
adrien
a06b040a29 Render and COmpute Pipelines now use a gloc and is tracked by Arena 2026-05-20 12:29:41 +02:00
adrien
af210e2fb2 Working self contained rendering (simple circle) 2026-05-20 11:46:06 +02:00
adrien
545c4b98e9 Create a GpuTextureView 2026-05-20 10:56:35 +02:00
adrien
45c0f3180e Created a GpuTextureDef 2026-05-20 09:55:34 +02:00
adrien
fc57bee3af Created GpuPrimitiveTolopogy to replace c.WGPUPrimitiveTopology 2026-05-20 09:37:46 +02:00
adrien
bcb1b1e98b GpuRender now take a GpuTextureFormat and not a c.WGPUTextureFormat 2026-05-20 09:24:37 +02:00
adrien
32f5d2b828 Added GpuTexture tied to arena like buffer 2026-05-20 09:14:54 +02:00
adrien
ad3fcf2592 Basic working circle render pipeline 2026-05-19 21:58:14 +02:00
adrien
83ef8bcd12 Renamed ProcessDef to COmputeDef 2026-05-19 21:35:52 +02:00
adrien
e467539f6e Renamed GpuProcess to GpuCompute 2026-05-19 21:15:31 +02:00
AdrienBouvais
fb2f454c1c Removed unused import 2026-05-19 09:18:26 +02:00
AdrienBouvais
7e1bc387ca Synthax 2026-05-19 09:15:32 +02:00
AdrienBouvais
09e62cf667 Update README and comment for new GpuProcess 2026-05-19 08:00:42 +02:00
AdrienBouvais
62b5224e6e Changed GpuProcess to use a definition
Now GpuProcess isnt limited to 2 in, 1 out but to anything.
2026-05-19 07:54:16 +02:00
adrien
6ec53bb909 Moved add and bench into an examples directory so src is just the library 2026-05-18 22:57:13 +02:00
adrien
3d9cb4df04 Removed TensorInfo from example shader 2026-05-18 16:45:55 +02:00
adrien
c62bead6e9 Better example (no Vec) 2026-05-18 16:38:30 +02:00
adrien
c7afe28cc6 GpuBuffer align with size 4 as required by WebGPU
Otherwise a GpuBuffer of a single f16 is too small (only 2) and a eneven
f16 wouldn't work either
2026-05-18 16:24:43 +02:00
adrien
d9cb4c4672 Better example comments 2026-05-18 16:18:58 +02:00
adrien
3a09e11f54 Deleted Vec.zig 2026-05-18 16:05:50 +02:00
adrien
e608681ce1 Added preference power in DeviceCOnf 2026-05-18 16:05:42 +02:00
adrien
d2b0735540 Moved all f32 out of GpuXxxx to all be in Vec 2026-05-18 15:35:38 +02:00
adrien
8e137c8f33 Vec no longer need import c 2026-05-18 15:28:28 +02:00
adrien
97d5f9001f Removed GpuPipeline for a GpuProcess 2026-05-18 15:28:02 +02:00
adrien
d5e7f60926 Moved read stuff to GpuBuffer directly 2026-05-18 14:27:11 +02:00
adrien
2673aef0fd Moved c.gpuQueuWriteBuffer to GpuBuffer 2026-05-18 14:16:01 +02:00
adrien
7ce6b9cd1d Better example 2026-05-18 14:11:17 +02:00
adrien
f5daf66784 Changed GpuAllocator to be like std.mem.Allocator
Now it is 2 ptr and I created a GpuArena. Point is to be like Zig, a
const allocator and a var arena that track everything.
2026-05-18 14:07:28 +02:00
adrien
c3166e552b GpuBuffer init now take a EnumSet of BufferUsage and not a c.WGPUBufferUsage 2026-05-18 10:49:11 +02:00
adrien
d42c521a96 Added f16 capability 2026-05-18 10:12:36 +02:00
adrien
0fc5f5dbb8 GpuBuffer can be for any float and init now 2026-05-18 09:31:58 +02:00
adrien
545e67d72f Added a example.zig 2026-05-18 00:19:37 +02:00
adrien
0fcb9ee351 Synthax improv + GpuDeviceConfig 2026-05-18 00:10:09 +02:00
adrien
6a2cbe2734 Removed const x = @This() to just use @This() 2026-05-17 23:54:58 +02:00
adrien
1c8e12b1e6 Added a VRAM limit to GpuAllocator 2026-05-17 23:51:51 +02:00
adrien
38538fcd80 Removed waiting for each run and moved it in bench directly 2026-05-17 23:18:49 +02:00
adrien
f56dfe7ecc Removed main.zig to become bench.zig + better benchmark + wait for calcul to be done in Vec.submitPass 2026-05-17 21:35:16 +02:00
adrien
01bc0954b0 Update lib.zig 2026-05-17 21:20:35 +02:00
adrien
cb19cd8e30 Mat to Vec + changed how its API work 2026-05-17 21:19:24 +02:00
adrien
7b9a7fe7a9 Created a GpuPipeline 2026-05-17 21:05:30 +02:00
adrien
cef6155f41 Splited GpuAllocator into GpuAllocator and GpuDevice 2026-05-17 20:55:49 +02:00
adrien
d57968d6df Removed unused GpuConfig 2026-05-17 20:47:08 +02:00
adrien
2c52c202fe Changed MAt.read to take an allocator 2026-05-17 20:39:03 +02:00
adrien
915c5cea65 Removed _pip_add and scale to a pipelines struct 2026-05-17 20:16:19 +02:00
adrien
a381c71550 Fixed binding size limit error by chunking to max 1GB binding 2026-05-17 17:52:07 +02:00