Skip to content

WebGL2 context.getParameter returns undefined for buffer and framebuffer bindings #419

@EndlessJour9527

Description

@EndlessJour9527

Problem

Calling context.getParameter() for various buffer and framebuffer-related enums (including COPY_READ_BUFFER_BINDING, COPY_WRITE_BUFFER_BINDING, DRAW_FRAMEBUFFER_BINDING, READ_FRAMEBUFFER_BINDING, PIXEL_PACK_BUFFER_BINDING, PIXEL_UNPACK_BUFFER_BINDING, UNIFORM_BUFFER_BINDING, VERTEX_ARRAY_BINDING, SAMPLER_BINDING, TRANSFORM_FEEDBACK_BINDING, TRANSFORM_FEEDBACK_BUFFER_BINDING, TEXTURE_BINDING_2D_ARRAY, TEXTURE_BINDING_3D) incorrectly returns undefined instead of the expected default value (usually null or an actual object per WebGL2 spec). This causes compliance failures with the WebGL 2.0 conformance suite.

Notable FAIL cases

  • context.getParameter(context.COPY_READ_BUFFER_BINDING)
  • context.getParameter(context.COPY_WRITE_BUFFER_BINDING)
  • context.getParameter(context.DRAW_FRAMEBUFFER_BINDING)
  • context.getParameter(context.READ_FRAMEBUFFER_BINDING)
  • context.getParameter(context.PIXEL_PACK_BUFFER_BINDING)
  • context.getParameter(context.PIXEL_UNPACK_BUFFER_BINDING)
  • context.getParameter(context.UNIFORM_BUFFER_BINDING)
  • context.getParameter(context.VERTEX_ARRAY_BINDING)
  • context.getParameter(context.SAMPLER_BINDING)
  • context.getParameter(context.TRANSFORM_FEEDBACK_BINDING)
  • context.getParameter(context.TRANSFORM_FEEDBACK_BUFFER_BINDING)
  • context.getParameter(context.TEXTURE_BINDING_2D_ARRAY)
  • context.getParameter(context.TEXTURE_BINDING_3D)

Expected behavior

According to the WebGL2 specification, these parameters must return null or a valid WebGL* object, never undefined.

Steps to reproduce

  1. Create a WebGL2 context
  2. Call context.getParameter(param) for each of the above enums
  3. Observe returned value is undefined

Impact

  • Fails conformance tests
  • Breaks compatibility with standard WebGL2 applications

References

Suggested Actions

  • Audit the implementation of getParameter() for all buffer, framebuffer, and object bindings in the WebGL2 context
  • Ensure correct default return value according to the spec
  • Add regression tests for these cases

Category: WebGL2 object/buffer binding compliance

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions