diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-16 16:27:24 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-16 16:27:24 +0100 |
| commit | b3924e3d3ec304d76ea8ad21efa7c73163282018 (patch) | |
| tree | fa097b0d3010b9b1db81202766cab3b5197f9195 | |
| parent | faea2bebb6d04806018f0f60634d9989832b9a38 (diff) | |
refactor(gpu): remove depthSlice conditionals, use platform.h abstraction
WGPU_DEPTH_SLICE_UNDEFINED is defined unconditionally via platform.h
(native headers or Win32 macro). Remove redundant conditional compilation
from 7 effects and gpu.h helper.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
| -rw-r--r-- | src/effects/flash_effect.cc | 2 | ||||
| -rw-r--r-- | src/effects/gaussian_blur_effect.cc | 2 | ||||
| -rw-r--r-- | src/effects/heptagon_effect.cc | 2 | ||||
| -rw-r--r-- | src/effects/particles_effect.cc | 2 | ||||
| -rw-r--r-- | src/effects/passthrough_effect.cc | 2 | ||||
| -rw-r--r-- | src/effects/placeholder_effect.cc | 2 | ||||
| -rw-r--r-- | src/effects/rotating_cube_effect.cc | 2 | ||||
| -rw-r--r-- | src/gpu/gpu.h | 5 |
8 files changed, 0 insertions, 19 deletions
diff --git a/src/effects/flash_effect.cc b/src/effects/flash_effect.cc index f0566bb..1d0e629 100644 --- a/src/effects/flash_effect.cc +++ b/src/effects/flash_effect.cc @@ -63,9 +63,7 @@ void FlashEffect::render(WGPUCommandEncoder encoder, // Render pass WGPURenderPassColorAttachment color_attachment = {}; color_attachment.view = output_view; -#if !defined(DEMO_CROSS_COMPILE_WIN32) color_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; -#endif color_attachment.loadOp = WGPULoadOp_Clear; color_attachment.storeOp = WGPUStoreOp_Store; color_attachment.clearValue = {0.0, 0.0, 0.0, 1.0}; diff --git a/src/effects/gaussian_blur_effect.cc b/src/effects/gaussian_blur_effect.cc index 657c283..adb094c 100644 --- a/src/effects/gaussian_blur_effect.cc +++ b/src/effects/gaussian_blur_effect.cc @@ -68,9 +68,7 @@ void GaussianBlurEffect::render(WGPUCommandEncoder encoder, // Render pass WGPURenderPassColorAttachment color_attachment = {}; color_attachment.view = output_view; -#if !defined(DEMO_CROSS_COMPILE_WIN32) color_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; -#endif color_attachment.loadOp = WGPULoadOp_Clear; color_attachment.storeOp = WGPUStoreOp_Store; color_attachment.clearValue = {0.0, 0.0, 0.0, 1.0}; diff --git a/src/effects/heptagon_effect.cc b/src/effects/heptagon_effect.cc index 31e94e7..303ab2a 100644 --- a/src/effects/heptagon_effect.cc +++ b/src/effects/heptagon_effect.cc @@ -65,9 +65,7 @@ void HeptagonEffect::render(WGPUCommandEncoder encoder, // Render pass WGPURenderPassColorAttachment color_attachment = {}; color_attachment.view = output_view; -#if !defined(DEMO_CROSS_COMPILE_WIN32) color_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; -#endif color_attachment.loadOp = WGPULoadOp_Clear; color_attachment.storeOp = WGPUStoreOp_Store; color_attachment.clearValue = {0.0, 0.0, 0.0, 1.0}; diff --git a/src/effects/particles_effect.cc b/src/effects/particles_effect.cc index a98d7e5..b9e2b9c 100644 --- a/src/effects/particles_effect.cc +++ b/src/effects/particles_effect.cc @@ -81,9 +81,7 @@ void ParticlesEffect::render(WGPUCommandEncoder encoder, WGPURenderPassColorAttachment color_attachment = { .view = output_view, -#if !defined(DEMO_CROSS_COMPILE_WIN32) .depthSlice = WGPU_DEPTH_SLICE_UNDEFINED, -#endif .loadOp = WGPULoadOp_Clear, .storeOp = WGPUStoreOp_Store, .clearValue = {0.0, 0.0, 0.0, 1.0}}; diff --git a/src/effects/passthrough_effect.cc b/src/effects/passthrough_effect.cc index 8cbd425..56e3711 100644 --- a/src/effects/passthrough_effect.cc +++ b/src/effects/passthrough_effect.cc @@ -64,9 +64,7 @@ void PassthroughEffect::render(WGPUCommandEncoder encoder, // Render pass WGPURenderPassColorAttachment color_attachment = { .view = output_view, -#if !defined(DEMO_CROSS_COMPILE_WIN32) .depthSlice = WGPU_DEPTH_SLICE_UNDEFINED, -#endif .loadOp = WGPULoadOp_Clear, .storeOp = WGPUStoreOp_Store, .clearValue = {0.0, 0.0, 0.0, 1.0} diff --git a/src/effects/placeholder_effect.cc b/src/effects/placeholder_effect.cc index a014a71..d8852da 100644 --- a/src/effects/placeholder_effect.cc +++ b/src/effects/placeholder_effect.cc @@ -46,9 +46,7 @@ void PlaceholderEffect::render(WGPUCommandEncoder encoder, WGPURenderPassColorAttachment color_attachment = { .view = output_view, -#if !defined(DEMO_CROSS_COMPILE_WIN32) .depthSlice = WGPU_DEPTH_SLICE_UNDEFINED, -#endif .loadOp = WGPULoadOp_Clear, .storeOp = WGPUStoreOp_Store, .clearValue = {0.0, 0.0, 0.0, 1.0} diff --git a/src/effects/rotating_cube_effect.cc b/src/effects/rotating_cube_effect.cc index 4bd79fe..57f0a83 100644 --- a/src/effects/rotating_cube_effect.cc +++ b/src/effects/rotating_cube_effect.cc @@ -163,9 +163,7 @@ void RotatingCubeEffect::render(WGPUCommandEncoder encoder, // Render pass with depth WGPURenderPassColorAttachment color_attachment = { .view = color_view, -#if !defined(DEMO_CROSS_COMPILE_WIN32) .depthSlice = WGPU_DEPTH_SLICE_UNDEFINED, -#endif .loadOp = WGPULoadOp_Clear, .storeOp = WGPUStoreOp_Store, .clearValue = {0.0, 0.0, 0.0, 1.0}}; diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h index 876aa84..41eeb29 100644 --- a/src/gpu/gpu.h +++ b/src/gpu/gpu.h @@ -66,12 +66,7 @@ inline void gpu_init_color_attachment(WGPURenderPassColorAttachment& attachment, attachment.loadOp = WGPULoadOp_Clear; attachment.storeOp = WGPUStoreOp_Store; attachment.clearValue = {0.0f, 0.0f, 0.0f, 1.0f}; -#if defined(DEMO_CROSS_COMPILE_WIN32) - // depthSlice is handled via macro in platform.h if needed, - // but usually it's better to just avoid setting it on older wgpu-native -#else attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; -#endif } // Texture creation helper |
