summaryrefslogtreecommitdiff
path: root/src/effects/hybrid3_d_effect.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-17 11:00:51 +0100
committerskal <pascal.massimino@gmail.com>2026-02-17 11:00:51 +0100
commita30a9878fe083240dbd98ae4ca93339cd8a8d667 (patch)
tree169632773d7570f8847629d9177844b809cb4566 /src/effects/hybrid3_d_effect.cc
parenta5e3e1bdb104555394e9f3aad6d1cf07e93998bf (diff)
fix(build): Resolve Windows cross-compilation failures
This commit fixes several issues that caused the Windows cross-compilation build (`scripts/build_win.sh`) to fail. The root causes were platform-specific API differences in the wgpu-native library and incorrect dependency tracking in the CMake build system for generated code. Changes: - **`tools/seq_compiler.py`**: The timeline generator now wraps `depthSlice` assignments in `#if !defined(DEMO_CROSS_COMPILE_WIN32)` directives to handle API differences in `WGPURenderPassColorAttachment`. - **`src/gpu/gpu.h`**: The `gpu_init_color_attachment` helper is now platform-aware, using a preprocessor guard for the `depthSlice` member. - **`src/effects/*.cc`**: All effects are updated to use the new platform-aware helper or have explicit guards for `depthSlice`. Also, replaced `WGPUTexelCopyTextureInfo` with the cross-platform alias `GpuTextureCopyInfo` in `rotating_cube_effect.cc`. - **`cmake`**: Added `tools/seq_compiler.py` as an explicit dependency to the `generate_timeline` and `generate_test_demo_timeline` custom commands. This ensures that changes to the generator script correctly trigger a rebuild of the generated C++ files. - **`scripts/build_win.sh`**: Removed the erroneous attempt to build the `seq_compiler.py` script as a native executable. With these changes, the Windows cross-compilation build now completes successfully.
Diffstat (limited to 'src/effects/hybrid3_d_effect.cc')
-rw-r--r--src/effects/hybrid3_d_effect.cc7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/effects/hybrid3_d_effect.cc b/src/effects/hybrid3_d_effect.cc
index 1dd1c05..5832b57 100644
--- a/src/effects/hybrid3_d_effect.cc
+++ b/src/effects/hybrid3_d_effect.cc
@@ -106,12 +106,7 @@ void Hybrid3D::render(WGPUCommandEncoder encoder,
// Render 3D scene using sequence encoder
WGPURenderPassColorAttachment color_attachment = {};
-#if !defined(DEMO_CROSS_COMPILE_WIN32)
- color_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED;
-#endif
- color_attachment.view = color_view;
- color_attachment.loadOp = WGPULoadOp_Clear;
- color_attachment.storeOp = WGPUStoreOp_Store;
+ gpu_init_color_attachment(color_attachment, color_view);
color_attachment.clearValue = {0.05f, 0.05f, 0.05f, 1.0f};
WGPURenderPassDepthStencilAttachment depth_attachment = {};