KhronosGroup / KhronosGroup/WebGL

Nullability of texSubImage entrypoints vs compressedTex[Sub]Image

Open
#2,169 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
2.9k
Forks
703
Avg merge
2d 9h
Merged PRs (30d)
4

Description

We tried making texSubImage entrypoints non-nullable, instead of generating INVALID_VALUE, but reverted back to using INVALID_VALUE because of the implicit webidl coersion of `null` to `0`, which selects the PBO offset upload entrypoint.

However, compressedTex[Sub]Image has this same problem, since it was non-nullable already in WebGL 1.

I would rather change texSubImage back to non-nullable to have the webidl match intent, rather than add nullable entrypoints to compressedTex[Sub]Image to match behavior.

I propose that we detect when this null-coersion is likely happening, and when we generate INVALID_OPERATION for using the PBO offset entrypoint without a PBO bound, we suggest that perhaps their ArrayBufferView is null.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the texSubImage and compressedTex[Sub]Image entrypoints, then find the INVALID_OPERATION path for PBO offset uploads. Done means detecting likely null coercion and suggesting that the caller's ArrayBufferView may be null, while preserving the intended entrypoint behavior.

Written by the indexing model from the issue text.

Assessment

Domain
api, computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.