Skip to content

WebGL2 context.getParameter returns undefined for state and numeric parameters #420

@EndlessJour9527

Description

@EndlessJour9527

Problem

Calling context.getParameter() for several numeric or stateful parameters (not direct object bindings) such as:

  • FRAGMENT_SHADER_DERIVATIVE_HINT
  • PACK_ROW_LENGTH
  • PACK_SKIP_PIXELS
  • PACK_SKIP_ROWS
  • UNPACK_IMAGE_HEIGHT
  • UNPACK_ROW_LENGTH
  • UNPACK_SKIP_IMAGES
  • UNPACK_SKIP_PIXELS
  • UNPACK_SKIP_ROWS
  • RASTERIZER_DISCARD
  • SAMPLE_ALPHA_TO_COVERAGE
  • SAMPLE_COVERAGE
  • READ_BUFFER
  • DRAW_BUFFER0
  • MAX_3D_TEXTURE_SIZE
  • MAX_SERVER_WAIT_TIMEOUT
  • MIN_PROGRAM_TEXEL_OFFSET
  • UNIFORM_BUFFER_OFFSET_ALIGNMENT

...returns undefined instead of a valid value (should be integer, float, or boolean according to spec). Some should have a default value (e.g., 0 for PACK_ROW_LENGTH), or a specific constant (e.g., 1029 for DRAW_BUFFER0).

Expected Behavior

All WebGL2 state and capability parameters queried via getParameter() should always return a correct spec-compliant value, never undefined. This applies to API conformance and ensures portability.

Impact

  • Causes conformance tests to fail
  • Prevents expected application logic (e.g., typed array allocations, feature detection)

References

Suggested Actions

  • Audit numeric/boolean parameters in WebGL2 context.getParameter()
  • Implement default/fallback values according to specification
  • Add/extend regression tests to cover these cases

Category: WebGL2 parameter state compliance

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions