KhronosGroup / KhronosGroup/WebGL

Supply user-accessible version of packing algorithm

Open
#2,242 0 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

(The text of this issue came largely from an old Khronos-internal bug.)

The current editor's draft of the WebGL specification requires that the packing algorithm defined in GLSL ES 1.0.17, Appendix A, Section 7 "Counting of Varyings and Uniforms" succeed when run against shaders and programs. See https://www.khronos.org/registry/webgl/specs/latest/1.0/#PACKING_RESTRICTIONS .

In a conference call from 29 Nov 2012 (embarrassingly old), there was a request from a working group member for a user-visible version of the packing algorithm that operates upon representations of the types and numbers of the uniforms and varyings, as well as the limits to be imposed, and which provides a boolean answer. (It wasn't a request for a JavaScript compiler for GLSL shaders.)

To avoid duplication and skew between this library and how the browser works, however, the most robust way of providing this functionality may be to compile ANGLE's shader translator with Emscripten or a forthcoming WebAssembly toolchain, and invoke it directly from ECMAScript.

This tool hasn't been shown to be strictly necessary but could still be useful; for example, shader authors could experiment with compiling their shaders given various limitations to see on how small a device they could successfully run.

Contributor guide

Open the contributing guide

Research direction

Start with the WebGL specification's PACKING_RESTRICTIONS section and GLSL ES 1.0.17 Appendix A, Section 7 to understand the required algorithm. Then investigate ANGLE's shader translator and the proposed Emscripten or WebAssembly route for invoking it from ECMAScript. Done means providing a user-accessible tool that accepts shader type and limit representations and returns a boolean packing result.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, wasm
Domain
computer-graphics, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.