diff options
Diffstat (limited to 'src/effects')
| -rw-r--r-- | src/effects/hybrid3_d_effect.cc | 6 | ||||
| -rw-r--r-- | src/effects/rotating_cube_effect.cc | 13 |
2 files changed, 6 insertions, 13 deletions
diff --git a/src/effects/hybrid3_d_effect.cc b/src/effects/hybrid3_d_effect.cc index 37d4158..33a2d73 100644 --- a/src/effects/hybrid3_d_effect.cc +++ b/src/effects/hybrid3_d_effect.cc @@ -33,15 +33,9 @@ Hybrid3D::Hybrid3D(const GpuContext& ctx, // Write white pixel uint32_t white_pixel = 0xFFFFFFFF; -#if defined(DEMO_CROSS_COMPILE_WIN32) - WGPUImageCopyTexture dst = { - .texture = dummy_texture_, .mipLevel = 0, .origin = {0, 0, 0}}; - WGPUTextureDataLayout data_layout = {.bytesPerRow = 4, .rowsPerImage = 1}; -#else WGPUTexelCopyTextureInfo dst = { .texture = dummy_texture_, .mipLevel = 0, .origin = {0, 0, 0}}; WGPUTexelCopyBufferLayout data_layout = {.bytesPerRow = 4, .rowsPerImage = 1}; -#endif WGPUExtent3D size = {1, 1, 1}; wgpuQueueWriteTexture(ctx_.queue, &dst, &white_pixel, 4, &data_layout, &size); 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, |
