Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update parameter caching table #1511

Open
Pessimistress opened this issue Oct 1, 2021 · 1 comment
Open

Update parameter caching table #1511

Pessimistress opened this issue Oct 1, 2021 · 1 comment
Assignees

Comments

@Pessimistress
Copy link
Collaborator

See discussion in #1510

TODO

Update GL_PARAMETER_DEFAULTS to include static WebGL limits, reference:

https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParameter

@Pessimistress
Copy link
Collaborator Author

Pessimistress commented Oct 3, 2021

I did an audit on getParameter enums that are not in the GL_PARAMETER_DEFAULTS table. They fall into one of 4 categories

A. Static limits

Count: 56

These used to be cached after the first query, and after #1510 are no longer cached.

We can either whitelist these, or add special handling for the other categories and then fall back to always caching.

B. Cached by setters but not listed in defaults

Count: 2

These used to be cached after the first query, and after #1510 are only cached if the setter is called.

We should just add these to the defaults table.

  • enable/disable
    • SAMPLE_COVERAGE
    • SAMPLE_ALPHA_TO_COVERAGE

C. Dynamic parameters whose setters are not intercepted

Count: 19

getParameter used to return wrong results for these, fixed by #1510.

We can either start to intercept their setters -- I'm unsure about the perf and bundle size implications -- or blacklist them from being cached.

  • activeTexture
    • ACTIVE_TEXTURE
  • beginTransformFeedback/endTransformFeedback
    • TRANSFORM_FEEDBACK_ACTIVE
    • TRANSFORM_FEEDBACK_PAUSED
  • bindBuffer
    • ARRAY_BUFFER_BINDING
    • COPY_READ_BUFFER_BINDING
    • COPY_WRITE_BUFFER_BINDING
    • ELEMENT_ARRAY_BUFFER_BINDING
    • PIXEL_PACK_BUFFER_BINDING
    • PIXEL_UNPACK_BUFFER_BINDING
    • TRANSFORM_FEEDBACK_BUFFER_BINDING
    • UNIFORM_BUFFER_BINDING
  • bindRenderBuffer
    • RENDERBUFFER_BINDING
  • bindTexture
    • TEXTURE_BINDING_2D
    • TEXTURE_BINDING_2D_ARRAY
    • TEXTURE_BINDING_3D
    • TEXTURE_BINDING_CUBE_MAP
  • bindTransformFeedback
    • TRANSFORM_FEEDBACK_BINDING
  • bindVertexArray
    • VERTEX_ARRAY_BINDING
  • useProgram
    • CURRENT_PROGRAM

D. Dynamic parameters that depend on another parameter

Count: 5

getParameter used to return wrong results for these, fixed by #1510.

We need to either add the ability to delete a cache within a setter, or blacklist these from being cached.

  • depend on READ_FRAMEBUFFER_BINDING
    • IMPLEMENTATION_COLOR_READ_FORMAT
    • IMPLEMENTATION_COLOR_READ_TYPE
  • depend on DRAW_FRAMEBUFFER_BINDING
    • READ_BUFFER
    • DRAW_BUFFERi
  • depend on ACTIVE_TEXTURE
    • SAMPLER_BINDING

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant