KhronosGroup / KhronosGroup/WebGL
Clarification regarding context loss handling
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 2.9k
- Forks
- 704
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 4
Description
Khronos' documentation on handling context loss states:
Don’t check for null on creation
var program = gl.createProgram();
if (program === null) // BAD!!!
You should really only get null from these functions if the context is lost and in that case there’s no reason to check. WebGL is designed so that for the most part everything just runs as normal even when a program or shader is null.
However, it's recently come to my attention that implementations will raise errors if you apply the "keep on truckin'" approach recommended in the above documentation:
https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1262#issuecomment-1054917371
Is the documentation incorrect, or are the implementations incorrect?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Khronos Handling Context Lost documentation and the TypeScript-DOM-lib-generator issue comment. Compare the documented null-handling guidance with the implementation behavior described there, then determine whether the documentation or implementations need correction. Done means the discrepancy is resolved and the relevant guidance is clarified.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100