Browse Source

Backends: WebGPU: fix webgpu changes for Dawn. (#6602, #6188)

williamhCode 2 năm trước cách đây
mục cha
commit
3dc3aef8a4
2 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 3 2
      backends/imgui_impl_wgpu.cpp
  2. 1 0
      docs/CHANGELOG.txt

+ 3 - 2
backends/imgui_impl_wgpu.cpp

@@ -13,6 +13,7 @@
 
 // CHANGELOG
 // (minor and older changes stripped away, please see git history for details)
+//  2023-07-13: Use WGPUShaderModuleWGSLDescriptor's code instead of source. use WGPUMipmapFilterMode_Linear instead of WGPUFilterMode_Linear. (#6602)
 //  2023-04-11: Align buffer sizes. Use WGSL shaders instead of precompiled SPIR-V.
 //  2023-04-11: Reorganized backend to pull data from a single structure to facilitate usage with multiple-contexts (all g_XXXX access changed to bd->XXXX).
 //  2023-01-25: Revert automatic pipeline layout generation (see https://github.com/gpuweb/gpuweb/issues/2470)
@@ -231,7 +232,7 @@ static WGPUProgrammableStageDescriptor ImGui_ImplWGPU_CreateShaderModule(const c
 
     WGPUShaderModuleWGSLDescriptor wgsl_desc = {};
     wgsl_desc.chain.sType = WGPUSType_ShaderModuleWGSLDescriptor;
-    wgsl_desc.source = wgsl_source;
+    wgsl_desc.code = wgsl_source;
 
     WGPUShaderModuleDescriptor desc = {};
     desc.nextInChain = reinterpret_cast<WGPUChainedStruct*>(&wgsl_desc);
@@ -512,7 +513,7 @@ static void ImGui_ImplWGPU_CreateFontsTexture()
         WGPUSamplerDescriptor sampler_desc = {};
         sampler_desc.minFilter = WGPUFilterMode_Linear;
         sampler_desc.magFilter = WGPUFilterMode_Linear;
-        sampler_desc.mipmapFilter = WGPUFilterMode_Linear;
+        sampler_desc.mipmapFilter = WGPUMipmapFilterMode_Linear;
         sampler_desc.addressModeU = WGPUAddressMode_Repeat;
         sampler_desc.addressModeV = WGPUAddressMode_Repeat;
         sampler_desc.addressModeW = WGPUAddressMode_Repeat;

+ 1 - 0
docs/CHANGELOG.txt

@@ -77,6 +77,7 @@ Other changes:
 - Demo: Better showcase use of SetNextItemAllowOverlap(). (#6574, #6512, #3909, #517)
 - Demo: Showcase a few more InputText() flags.
 - Backends: Made all backends sources files support global IMGUI_DISABLE. (#6601)
+- Backends: WebGPU: Update for changes in Dawn. (#6602, #6188) [@williamhCode]
 
 
 -----------------------------------------------------------------------