From 8bdc4754647c9c6691130fa91d51fee93c5fc88f Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 1 Feb 2026 10:51:15 +0100 Subject: feat: Implement 3D system and procedural texture manager - Extended mini_math.h with mat4 multiplication and affine transforms. - Implemented TextureManager for runtime procedural texture generation and GPU upload. - Added 3D system components: Camera, Object, Scene, and Renderer3D. - Created test_3d_render mini-demo for interactive 3D verification. - Fixed WebGPU validation errors regarding depthSlice and unimplemented WaitAny. --- src/gpu/gpu.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gpu/gpu.h') diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h index 8814cbc..b71e144 100644 --- a/src/gpu/gpu.h +++ b/src/gpu/gpu.h @@ -110,6 +110,16 @@ struct ResourceBinding { // WGPUBufferBindingType_Storage }; +// Cross-platform helper for color attachment initialization +inline void gpu_init_color_attachment(WGPURenderPassColorAttachment& attachment, WGPUTextureView view) { + attachment.view = view; + attachment.loadOp = WGPULoadOp_Clear; + attachment.storeOp = WGPUStoreOp_Store; +#if !defined(DEMO_CROSS_COMPILE_WIN32) + attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; +#endif +} + GpuBuffer gpu_create_buffer(WGPUDevice device, size_t size, uint32_t usage, const void* data = nullptr); ComputePass gpu_create_compute_pass(WGPUDevice device, const char* shader_code, -- cgit v1.2.3