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

Remove OFFSCREEN_FRAMEBUFFER_FORBID_VAO_PATH. NFC #23056

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Dec 3, 2024

This was the only remaining test-only setting. The same effect can be achieved instead using some EM_ASM.

assert(GL.currentContext.defaultVao);
GL.currentContext.defaultVao = undefined;
});
#endif

#if !TEST_WEBGL2 && TEST_VAO
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does anything set TEST_VAO? I can't find any other references to it. I think maybe we want this to be
#if !TEST_WEBGL2 && !TEST_DISABLE_VAO?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know I'm afraid, but that seems like a pre-existing condition here.

'gl1': (['-sMAX_WEBGL_VERSION=1'],),
'gl1_max_gl2': (['-sMAX_WEBGL_VERSION=2'],),
# VAO path on WebGL 2.0
'gl2': (['-sMAX_WEBGL_VERSION=2', '-DTEST_WEBGL2=1', '-DTEST_ANTIALIAS=1', '-DTEST_REQUIRE_VAO=1'],),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly I don't see any references to TEST_REQUIRE_VAO, does it do anything?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this pre-existing state seems maybe wrong. I'll see if I can make a separate PR to fix that before I land this one.

#ifdef TEST_DISABLE_VAO
EM_ASM({
console.log(GL.currentContext.defaultVao);
assert(GL.currentContext.defaultVao);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assert seems like it should fail on WebGL 1.0 because we won't have created a defaultVao unless OES_vertex_array_object has been enabled, which it hasn't yet (that happens below).

Except the code that creates defaultVao runs early, in createContext>registerContext>createOffscreenFramebuffer, so evidently webgl_enable_OES_vertex_array_object has already run by that point.
I don't know how that happens.

This was the only remaining test-only setting.  The same effect can be
achieved instead using some EM_ASM.
@sbc100
Copy link
Collaborator Author

sbc100 commented Dec 4, 2024

Updated. PTAL

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

Successfully merging this pull request may close these issues.

2 participants