Skip to content

Commit

Permalink
WebGPU: Add deprecation warning to wgpuAdapterGetProperties (emscript…
Browse files Browse the repository at this point in the history
…en-core#22088)

wgpuAdapterGetProperties() previously didn't work anyway - it just returned
zeroes. Use wgpuAdapterGetInfo() instead (once adapter.info is available in
browsers), which is fully implemented, and matches the JS API more closely.
  • Loading branch information
beaufortfrancois authored Jun 13, 2024
1 parent c0aa403 commit 0c50419
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/library_webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2587,7 +2587,10 @@ var LibraryWebGPU = {
{{{ makeSetValue('info', C_STRUCTS.WGPUAdapterInfo.deviceID, '0', 'i32') }}};
},

wgpuAdapterGetProperties__deps: ['$warnOnce'],
wgpuAdapterGetProperties: (adapterId, properties) => {
warnOnce('wgpuAdapterGetProperties is deprecated, use wgpuAdapterGetInfo instead');

{{{ gpu.makeCheckDescriptor('properties') }}}
{{{ makeSetValue('properties', C_STRUCTS.WGPUAdapterProperties.vendorID, '0', 'i32') }}};
{{{ makeSetValue('properties', C_STRUCTS.WGPUAdapterProperties.vendorName, '0', 'i32') }}};
Expand Down

0 comments on commit 0c50419

Please sign in to comment.