Commit Graph
67 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
adrien 14def5d555 Updated example in README 2026-05-21 23:38:22 +02:00
adrien e61c5f775d Prevent building example when use as module 2026-05-21 23:33:54 +02:00
adrien 69f9cad2c1 Updated README ref 2026-05-20 15:45:02 +02:00
adrien c5d7fd927d Updated README and build.zon version 2026-05-20 14:04:25 +02:00
adrien 17977cc718 Merge branch 'render' 2026-05-20 13:47:43 +02:00
adrien 5104d61ef6 Synthax for compute example 2026-05-20 13:41:04 +02:00
adrien 7d5331aed7 Circle example use device allocator directly 2026-05-20 13:39: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
adrien 523a9b69ac .Synthax 2026-05-18 23:21:26 +02:00
adrien 571a9db71f Started to add a mnist Deep Learning example
No reason why, that for the love of the game
2026-05-18 23:11:58 +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 6b933465b0 Better example 2026-05-18 17:00:44 +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 9dbd668de9 . 2026-05-18 16:33:26 +02:00
adrien 50bf436fa5 Update README 2026-05-18 16:33:07 +02:00
adrien df4eb36bc8 Added README 2026-05-18 16:30:27 +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
adrien cfc1069309 Removed GpuBuffer limits 2026-05-16 00:26:07 +02:00
adrien 90a7cf946f Changed main to be a benchmark of different size 2026-05-15 18:46:07 +02:00
adrien 0da02f60c4 Created a GpuBuffer + an arry in GpuAlloc to deinit all when deinit the alloc 2026-05-15 16:03:40 +02:00
adrien 4725723d42 REleted gpu.zig and created a lib.zig to output a module 2026-05-15 10:27:45 +02:00
adrien 6018b5f0ff Splited gpu.zig into multiple files 2026-05-15 10:25:12 +02:00
adrien 67f35eed34 Removed tmp file and added gitattributes 2026-05-15 10:07:23 +02:00
adrien 8ff91d35ec Basic GpuAlloc + Mat 2026-05-15 09:44:53 +02:00
adrien 8050bab969 Started to understand how it work and implemented chained operation 2026-04-28 23:30:21 +02:00
adrien 532e8c1897 Basic working matrix addition 2026-04-28 10:22:22 +02:00