-
Notifications
You must be signed in to change notification settings - Fork 3
Fix getAttribLocation to return -1 for built-in attributes per WebGL 2.0 spec #412
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
3f31d97
e905a59
c135954
b41f3a8
e587f6c
99611d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| #include <set> | ||
| #include <client/script_bindings/canvas/image_source.hpp> | ||
| #include "./webgl_rendering_context.hpp" | ||
| #include "./active_info.hpp" | ||
|
|
@@ -2638,6 +2639,15 @@ namespace endor | |
| auto nameUtf8 = String::Utf8Value(isolate, info[1]); | ||
| string name = *nameUtf8; | ||
|
|
||
| // WebGL 2.0 spec §5.18: Built-in attributes always return -1 | ||
| static const std::set<string> kBuiltInAttribs = { | ||
| "gl_VertexID", "gl_InstanceID", "gl_Position", "gl_PointSize"}; | ||
| if (kBuiltInAttribs.count(name)) | ||
| { | ||
| info.GetReturnValue().Set(Number::New(isolate, -1)); | ||
| return; | ||
| } | ||
|
|
||
|
||
| auto loc = handle()->getAttribLocation(programBinding->handle(), name); | ||
| if (!loc.has_value()) | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot please restore this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Restored package-lock.json to its original state in commit e587f6c. The registry URLs have been reverted from npmjs.org back to npmmirror.com.