From 1481b0a6313b725eec3e3ebeea085e98703df00f Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 1 Feb 2026 14:58:05 +0100 Subject: feat(assets): Implement robust procedural asset generation pipeline - Updated asset_packer to correctly parse PROC(...) syntax using regex, handling nested commas. - Implemented runtime dispatch in AssetManager for procedural generation with dynamic memory management. - Added procedural generator functions (noise, grid, periodic). - Added comprehensive tests for procedural asset lifecycle (generation, caching, invalidation). - Fixed C++ string literal escaping in asset_packer. --- src/3d/renderer.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/3d/renderer.h') diff --git a/src/3d/renderer.h b/src/3d/renderer.h index dda6229..e87d47a 100644 --- a/src/3d/renderer.h +++ b/src/3d/renderer.h @@ -28,12 +28,25 @@ class Renderer3D { void init(WGPUDevice device, WGPUQueue queue, WGPUTextureFormat format); void shutdown(); - // Renders the scene to the given texture view - void render(const Scene& scene, const Camera& camera, float time, - WGPUTextureView target_view, - WGPUTextureView depth_view_opt = nullptr); + // Renders the scene to the given texture view (Convenience: creates a pass) - void set_noise_texture(WGPUTextureView noise_view); + void render(const Scene& scene, const Camera& camera, float time, + + WGPUTextureView target_view, WGPUTextureView depth_view_opt = nullptr); + + + + // Records draw commands to an existing pass. + + // Assumes the pass has a compatible pipeline (or we set it here). + + // Note: Caller must ensure depth/color attachments are set up correctly in the pass. + + void draw(WGPURenderPassEncoder pass, const Scene& scene, const Camera& camera, float time); + + + + void set_noise_texture(WGPUTextureView noise_view); // Resize handler (if needed for internal buffers) void resize(int width, int height); -- cgit v1.2.3