Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WGPUBufferMapAsyncStatus error codes #183

Open
kainino0x opened this issue May 23, 2023 · 5 comments
Open

WGPUBufferMapAsyncStatus error codes #183

kainino0x opened this issue May 23, 2023 · 5 comments
Labels
errors Error reporting has resolution Issue is resolved, just needs to be done

Comments

@kainino0x
Copy link
Collaborator

Right now we have a bunch of error codes in WGPUBufferMapAsyncStatus for different failures. The pattern used elsewhere looks more like a generic Error enum value + a const char * message. Should mapAsync change to that?

@kainino0x
Copy link
Collaborator Author

kainino0x commented Aug 24, 2023

@kainino0x kainino0x added has resolution Issue is resolved, just needs to be done async Asynchronous operations and callbacks and removed async Asynchronous operations and callbacks labels Aug 24, 2023
@kainino0x
Copy link
Collaborator Author

Actually, MapAsync is a little different from others in that it has two error types in the JS spec, OperationError and AbortError. I think these need to be two different values in the enum.

@kainino0x
Copy link
Collaborator Author

kainino0x commented May 22, 2024

We also need to actually pick names, for example:

  • WGPUBufferMapAsyncStatus (or WGPUMapAsyncStatus)?
    • Success
    • InstanceDropped
    • Error (or OperationError to ~match JS?)
    • Aborted (or AbortError to ~match JS?)
    • Unknown

@kainino0x kainino0x added agenda Agenda for upcoming meetings and removed has resolution Issue is resolved, just needs to be done labels May 22, 2024
@lokokung
Copy link
Collaborator

FWIW, most of the other status codes all drop the object name:

RequestAdapterStatus vs InstanceRequestAdapterStatus
RequestDeviceStatus vs AdapterRequestDeviceStatus
CompilationInfoRequestStatus vs ShaderCompilationInfoRequestStatus
CreatePipelineAsyncStatus vs DeviceCreatePipelineAsyncStatus

The only ones that have the object name prepended (if I didn't miss any) are BufferMapAsyncStatus and QueueWorkDoneStatus.

@kainino0x kainino0x removed the agenda Agenda for upcoming meetings label Jun 6, 2024
@kainino0x
Copy link
Collaborator Author

May 23 meeting:

  • Add an equivalent for JS’s AbortError
  • Name of enum and enum values?
    • KN: think “Error” / “Aborted” are good names
    • no objections
  • Status type naming:
    • LK: a lot of them drop the object name.
      AdapterRequestDevice → RequestDeviceStatus
      InstanceRequestAdapter –> RequestAdapterStatus
      proposal:
      BufferMapAsync → MapAsyncStatus
    • CF / KN: sounds good me.
    • LK:
      WGPUSurfaceGetCurrentTextureStatus_Error → WGPUGetCurrentTextureStatus_Error ?
      QueueOnSubmittedWorkDone → WorkDoneStatus ? OnSubmittedWorkDoneStatus ? QueueWorkDoneStatus ?
    • KN: Fine to rename buffer mapping one
      leave other ones for now
    • discussion about .yml generator, potentially nesting enums in some language bindings, like Buffer::MapAsyncStatus::Error
      • KN: should be OK as long as it is expressible in the yml that it could be nested
      • But yaml can specify how the name is spelled in all cases, don't have to derive it - like if there is a prefix or not, naming of QueueWorkDone

@kainino0x kainino0x added the has resolution Issue is resolved, just needs to be done label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errors Error reporting has resolution Issue is resolved, just needs to be done
Projects
None yet
Development

No branches or pull requests

2 participants