From efad11008616d30f685752fc70aa05be524c1a78 Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 12 Mar 2026 17:14:57 +0100 Subject: fix(win): update wgpu-native to v27, unify Windows/macOS API paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fetch_win_deps.sh: update wgpu-native v0.19.4.1 → v27.0.4.0 (same as macOS) - platform.h: remove v0.19 compat shims, Windows now uses WGPUStringView API - gpu.cc/gpu.h: remove DEMO_CROSS_COMPILE_WIN32 old-API branches - texture_readback.cc, visual_debug.cc, hybrid3d_effect.cc: same cleanup - rotating_cube_effect.cc: remove #ifdef guard for depthSlice - glfw3webgpu.c: remove old WGPUSurfaceDescriptorFromWindowsHWND branch - asset_manager.cc: fix DEMO_STRIP_ALL→STRIP_ALL guard (vs_main was missing in STRIP_ALL Windows builds because disk-loading path ran on embedded data) - tracker.cc: skip MP3 assets gracefully in STRIP_ALL builds instead of fatal handoff(Gemini): Windows .exe now runs under Wine. demo64k.exe renders frames and progresses through audio timeline. Pre-existing test failures unchanged. Co-Authored-By: Claude Sonnet 4.6 --- src/effects/hybrid3_d_effect.cc | 6 ------ src/effects/rotating_cube_effect.cc | 13 ++++++------- 2 files changed, 6 insertions(+), 13 deletions(-) (limited to 'src/effects') 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, -- cgit v1.2.3