diff options
Diffstat (limited to 'src/effects/rotating_cube_effect.cc')
| -rw-r--r-- | src/effects/rotating_cube_effect.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/effects/rotating_cube_effect.cc b/src/effects/rotating_cube_effect.cc index 6ee3e85..82f90c5 100644 --- a/src/effects/rotating_cube_effect.cc +++ b/src/effects/rotating_cube_effect.cc @@ -59,11 +59,12 @@ RotatingCube::RotatingCube(const GpuContext& ctx, .writeMask = WGPUColorWriteMask_All, }; - const WGPUDepthStencilState depth_stencil = { - .format = WGPUTextureFormat_Depth24Plus, - .depthWriteEnabled = WGPUOptionalBool_True, - .depthCompare = WGPUCompareFunction_Less, - }; + WGPUDepthStencilState depth_stencil = {}; + depth_stencil.format = WGPUTextureFormat_Depth24Plus; + depth_stencil.depthWriteEnabled = WGPUOptionalBool_True; + depth_stencil.depthCompare = WGPUCompareFunction_Less; + depth_stencil.stencilFront.compare = WGPUCompareFunction_Always; + depth_stencil.stencilBack.compare = WGPUCompareFunction_Always; WGPUFragmentState fragment = {}; fragment.module = shader_module; @@ -181,9 +182,7 @@ void RotatingCube::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, .loadOp = WGPULoadOp_Load, .storeOp = WGPUStoreOp_Store, |
