Update for WebGPU latest

omar 2026-04-23 20:27:04 +02:00
parent 87e01f4fb2
commit e4939e6abf

@ -1145,8 +1145,7 @@ bool LoadTextureFromMemory(const void* data, size_t data_size, WGPUDevice device
return false;
// Create a WebGPU texture
WGPUTextureDescriptor tex_desc;
tex_desc.nextInChain = NULL;
WGPUTextureDescriptor tex_desc = {};
tex_desc.label = { "", WGPU_STRLEN };
tex_desc.usage = WGPUTextureUsage_CopyDst | WGPUTextureUsage_TextureBinding;
tex_desc.dimension = WGPUTextureDimension_2D;
@ -1156,13 +1155,10 @@ bool LoadTextureFromMemory(const void* data, size_t data_size, WGPUDevice device
tex_desc.format = WGPUTextureFormat_RGBA8Unorm;
tex_desc.mipLevelCount = 1;
tex_desc.sampleCount = 1;
tex_desc.viewFormatCount = 0;
tex_desc.viewFormats = NULL;
WGPUTexture image_texture = wgpuDeviceCreateTexture(device, &tex_desc);
// Create a WebGPU texture view
WGPUTextureViewDescriptor view_desc;
view_desc.nextInChain = NULL;
WGPUTextureViewDescriptor view_desc = {};
view_desc.label = { "", WGPU_STRLEN };
view_desc.format = WGPUTextureFormat_RGBA8Unorm;
view_desc.dimension = WGPUTextureViewDimension_2D;