Sitelet https://github.com/gpuweb/gpuweb/issues/5064
Skip to content

[WebGPU] Index resolution is potentially underspecified #5064

Description

@mwyrzykowski

Under step 2.2.3 of the index resolution process it is stated:

Append drawCall.baseVertex + relativeVertexIndex to the vertexIndexList.

in the case drawCall.baseVertex is negative and relativeVertexIndex < -drawCall.baseVertex, i.e., drawCall.baseVertex + relativeVertexIndex < 0, is it expected for the vertex index to wrap around or is the call rejected / invalid memory reference applies?

I was unable to find corresponding reference in Metal, but the OpenGL specification for glDrawElementsBaseVertex says:

The operation is undefined if the sum would be negative.

Is it allowed for an implementation to reject the call in this case per the note under https://www.w3.org/TR/webgpu/#dom-gpurendercommandsmixin-drawindexed? In the case of 16-indices and negative baseIndex values, it is not clear that all APIs have the same semantics and polyfilling it would seem expensive.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

apiWebGPU APIcopyeditingPure editorial stuff (copyediting, *.bs file syntax, etc.)

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions