webgpu-native / webgpu-headers

https://webgpu-native.github.io/webgpu-headers/
BSD 3-Clause "New" or "Revised" License
375 stars 43 forks source link

Should more functions take extensible structs? #216

Open kainino0x opened 1 year ago

kainino0x commented 1 year ago

Struct chains provide extensibility to methods that take an extensible struct as an argument, like CreateBuffer. But there are a number of functions which don't. In JavaScript, all functions are extensible because we can add optional arguments to the end, but not in C.

Functions that could make sense to take extensible structs:

The following take extensible structs that are shared with other functions so may not be always cleanly extensible:

These aren't extensible, but I don't think they need it:

(I think that's the complete list)

kainino0x commented 1 year ago
Kangz commented 1 year ago

MapAsync / Unmap for multi-queue as well.

kainino0x commented 1 year ago

meeting: discussed a little, but didn't conclude exactly which entry points we wanted to change. We want to add extensibility to at least some of them, so we can start with the easiest ones like GetPreferredFormat, at least.

kainino0x commented 9 months ago

Note per #115 any function that takes an extensible struct needs to be able to return an error code if you pass something invalid in the struct chain.

kainino0x commented 1 month ago

Likewise, should we have some form of both in and out extensibility for present? For example to request present timings.

Originally posted by @Kangz in https://github.com/webgpu-native/webgpu-headers/issues/261#issuecomment-2315100082

kainino0x commented 3 weeks ago

Sep 12 meeting:

kainino0x commented 3 weeks ago
  • double check that this is consistent with other decisions

it's not; see https://github.com/webgpu-native/webgpu-headers/issues/261#issuecomment-1910889507

I'll keep thinking about this.