Skip to content

Behavior of NaNs and Infinities passed as float/double #466

Closed
@kainino0x

Description

@kainino0x

The JS API throws an exception (or rejects a promise with an exception) if NaN or Infinity is passed into any float/double (this rule comes from WebIDL; we don't use unrestricted which would lift it).

What should webgpu.h do when NaN or Infinity is passed to a required float/double, or Infinity is passed to an optional float/double (depthClearValue)?

The obvious answer is to produce a regular validation error, but Wasm implementations would technically need to detect these and inject them into the error scope. In practice, this is really unnecessary and impractical, so Wasm implementations would probably just crash by hitting the aforementioned JS exception. We could maybe say "may crash, and if not produces a validation error" I guess?

Forked from isnan question on #427.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions