summaryrefslogtreecommitdiff
path: root/src/gpu/gpu.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-01 10:51:15 +0100
committerskal <pascal.massimino@gmail.com>2026-02-01 10:51:15 +0100
commit8bdc4754647c9c6691130fa91d51fee93c5fc88f (patch)
tree2cfd7f72a21541c488ea48629eef47a6774fc2c4 /src/gpu/gpu.h
parent7905abd9f7ad35231289e729b42e3ad57a943ff5 (diff)
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.
Diffstat (limited to 'src/gpu/gpu.h')
-rw-r--r--src/gpu/gpu.h10
1 files changed, 10 insertions, 0 deletions
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,