From 6b2b143bcf8ba61a1735a3b79ecb6c687870d410 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Nov 2025 06:34:13 +0000 Subject: [PATCH 1/9] Initial plan From bc244e59b575e400167e3d609382d28711287ed9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Nov 2025 06:53:31 +0000 Subject: [PATCH 2/9] Fix WebGL2 getParameter to return null for unhandled binding parameters - Add handling for WebGL1 binding parameters (ARRAY_BUFFER_BINDING, ELEMENT_ARRAY_BUFFER_BINDING, etc.) - Add handling for WebGL2 binding parameters (COPY_READ_BUFFER_BINDING, DRAW_FRAMEBUFFER_BINDING, etc.) - Return null instead of undefined per WebGL specification - Add TODO comments for future implementation of proper object retrieval Co-authored-by: EndlessJour9527 <155411404+EndlessJour9527@users.noreply.github.com> --- .../script_bindings/webgl/active_info.cpp | 2 +- .../script_bindings/webgl/active_info.hpp | 2 +- .../script_bindings/webgl/framebuffer.cpp | 2 +- .../script_bindings/webgl/framebuffer.hpp | 2 +- src/client/script_bindings/webgl/object.cpp | 2 +- src/client/script_bindings/webgl/object.hpp | 2 +- src/client/script_bindings/webgl/program.cpp | 2 +- src/client/script_bindings/webgl/program.hpp | 2 +- .../script_bindings/webgl/renderbuffer.cpp | 2 +- .../script_bindings/webgl/renderbuffer.hpp | 2 +- src/client/script_bindings/webgl/texture.cpp | 2 +- src/client/script_bindings/webgl/texture.hpp | 2 +- .../webgl/uniform_location.cpp | 2 +- .../webgl/uniform_location.hpp | 2 +- .../script_bindings/webgl/vertex_array.cpp | 2 +- .../script_bindings/webgl/vertex_array.hpp | 2 +- .../webgl/webgl_rendering_context.cpp | 38 +++++++++++++++++++ 17 files changed, 54 insertions(+), 16 deletions(-) diff --git a/src/client/script_bindings/webgl/active_info.cpp b/src/client/script_bindings/webgl/active_info.cpp index c0f9d3e81..803ffe763 100644 --- a/src/client/script_bindings/webgl/active_info.cpp +++ b/src/client/script_bindings/webgl/active_info.cpp @@ -60,5 +60,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/active_info.hpp b/src/client/script_bindings/webgl/active_info.hpp index b125c893c..c2d6c9080 100644 --- a/src/client/script_bindings/webgl/active_info.hpp +++ b/src/client/script_bindings/webgl/active_info.hpp @@ -38,5 +38,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/framebuffer.cpp b/src/client/script_bindings/webgl/framebuffer.cpp index dbe790869..d38e0687c 100644 --- a/src/client/script_bindings/webgl/framebuffer.cpp +++ b/src/client/script_bindings/webgl/framebuffer.cpp @@ -31,5 +31,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/framebuffer.hpp b/src/client/script_bindings/webgl/framebuffer.hpp index c54189e65..fd3ab4ec2 100644 --- a/src/client/script_bindings/webgl/framebuffer.hpp +++ b/src/client/script_bindings/webgl/framebuffer.hpp @@ -37,5 +37,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/object.cpp b/src/client/script_bindings/webgl/object.cpp index b03f846b5..78779213d 100644 --- a/src/client/script_bindings/webgl/object.cpp +++ b/src/client/script_bindings/webgl/object.cpp @@ -28,5 +28,5 @@ namespace endor // WebGLObject is a base class, typically not instantiated directly } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/object.hpp b/src/client/script_bindings/webgl/object.hpp index cd48b93ae..f69bb78c8 100644 --- a/src/client/script_bindings/webgl/object.hpp +++ b/src/client/script_bindings/webgl/object.hpp @@ -45,5 +45,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/program.cpp b/src/client/script_bindings/webgl/program.cpp index e4a68a6f8..8c21d7e26 100644 --- a/src/client/script_bindings/webgl/program.cpp +++ b/src/client/script_bindings/webgl/program.cpp @@ -20,5 +20,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/program.hpp b/src/client/script_bindings/webgl/program.hpp index ede29c134..0971e7271 100644 --- a/src/client/script_bindings/webgl/program.hpp +++ b/src/client/script_bindings/webgl/program.hpp @@ -32,5 +32,5 @@ namespace endor WebGLProgram(v8::Isolate *isolate, const v8::FunctionCallbackInfo &args); }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/renderbuffer.cpp b/src/client/script_bindings/webgl/renderbuffer.cpp index 7f512b63d..d858602e8 100644 --- a/src/client/script_bindings/webgl/renderbuffer.cpp +++ b/src/client/script_bindings/webgl/renderbuffer.cpp @@ -19,5 +19,5 @@ namespace endor // WebGLRenderbuffer objects are created by WebGL context, not by user code } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/renderbuffer.hpp b/src/client/script_bindings/webgl/renderbuffer.hpp index a9651c800..581ff1b2e 100644 --- a/src/client/script_bindings/webgl/renderbuffer.hpp +++ b/src/client/script_bindings/webgl/renderbuffer.hpp @@ -33,5 +33,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/texture.cpp b/src/client/script_bindings/webgl/texture.cpp index 3b51f5dfa..3d034839c 100644 --- a/src/client/script_bindings/webgl/texture.cpp +++ b/src/client/script_bindings/webgl/texture.cpp @@ -27,5 +27,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/texture.hpp b/src/client/script_bindings/webgl/texture.hpp index b40acad08..9272d305c 100644 --- a/src/client/script_bindings/webgl/texture.hpp +++ b/src/client/script_bindings/webgl/texture.hpp @@ -45,5 +45,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/uniform_location.cpp b/src/client/script_bindings/webgl/uniform_location.cpp index 597a73e97..ce71bd5d6 100644 --- a/src/client/script_bindings/webgl/uniform_location.cpp +++ b/src/client/script_bindings/webgl/uniform_location.cpp @@ -47,5 +47,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/uniform_location.hpp b/src/client/script_bindings/webgl/uniform_location.hpp index a5e7de1f2..a1f98b66d 100644 --- a/src/client/script_bindings/webgl/uniform_location.hpp +++ b/src/client/script_bindings/webgl/uniform_location.hpp @@ -44,5 +44,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/vertex_array.cpp b/src/client/script_bindings/webgl/vertex_array.cpp index 3e6ed5f0a..48e8e644b 100644 --- a/src/client/script_bindings/webgl/vertex_array.cpp +++ b/src/client/script_bindings/webgl/vertex_array.cpp @@ -20,5 +20,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/vertex_array.hpp b/src/client/script_bindings/webgl/vertex_array.hpp index 7ba162aa3..a4a03cc1d 100644 --- a/src/client/script_bindings/webgl/vertex_array.hpp +++ b/src/client/script_bindings/webgl/vertex_array.hpp @@ -33,5 +33,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/webgl_rendering_context.cpp b/src/client/script_bindings/webgl/webgl_rendering_context.cpp index 7c9351388..2bbfd49d6 100644 --- a/src/client/script_bindings/webgl/webgl_rendering_context.cpp +++ b/src/client/script_bindings/webgl/webgl_rendering_context.cpp @@ -4385,6 +4385,22 @@ namespace endor jsValue = String::NewFromUtf8(isolate, value.c_str()).ToLocalChecked(); break; } + /** + * WebGL object bindings (return null when nothing bound, object when bound) + * Currently return null as backend doesn't track all binding states + */ + case WEBGL_ARRAY_BUFFER_BINDING: + case WEBGL_ELEMENT_ARRAY_BUFFER_BINDING: + case WEBGL_FRAMEBUFFER_BINDING: + case WEBGL_RENDERBUFFER_BINDING: + case WEBGL_TEXTURE_BINDING_2D: + case WEBGL_TEXTURE_BINDING_CUBE_MAP: + case WEBGL_CURRENT_PROGRAM: + { + // TODO: Implement proper object binding retrieval from backend + jsValue = Null(isolate); + break; + } default: cerr << "WebGLRenderingContext::GetParameter: Unhandled pname " << pname << endl; break; @@ -4429,6 +4445,28 @@ namespace endor jsValue = Integer::New(isolate, value); break; } + /** + * WebGL2 object bindings (return null when nothing bound, object when bound) + * Currently return null as backend doesn't track all binding states + */ + case WEBGL2_COPY_READ_BUFFER_BINDING: + case WEBGL2_COPY_WRITE_BUFFER_BINDING: + case WEBGL2_DRAW_FRAMEBUFFER_BINDING: + case WEBGL2_READ_FRAMEBUFFER_BINDING: + case WEBGL2_PIXEL_PACK_BUFFER_BINDING: + case WEBGL2_PIXEL_UNPACK_BUFFER_BINDING: + case WEBGL2_UNIFORM_BUFFER_BINDING: + case WEBGL2_VERTEX_ARRAY_BINDING: + case WEBGL2_SAMPLER_BINDING: + case WEBGL2_TRANSFORM_FEEDBACK_BINDING: + case WEBGL2_TRANSFORM_FEEDBACK_BUFFER_BINDING: + case WEBGL2_TEXTURE_BINDING_2D_ARRAY: + case WEBGL2_TEXTURE_BINDING_3D: + { + // TODO: Implement proper object binding retrieval from backend + jsValue = Null(isolate); + break; + } default: break; } From 9fe79ac612351177c50f84896fb38d820350f7b1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Nov 2025 06:54:51 +0000 Subject: [PATCH 3/9] Add test fixture for WebGL getParameter binding parameters Co-authored-by: EndlessJour9527 <155411404+EndlessJour9527@users.noreply.github.com> --- .../getparameter-binding-test.html | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 fixtures/html/webgl-conformance/getparameter-binding-test.html diff --git a/fixtures/html/webgl-conformance/getparameter-binding-test.html b/fixtures/html/webgl-conformance/getparameter-binding-test.html new file mode 100644 index 000000000..3d4ab52bc --- /dev/null +++ b/fixtures/html/webgl-conformance/getparameter-binding-test.html @@ -0,0 +1,85 @@ + + + + + WebGL getParameter Binding Test + + + +

WebGL getParameter Binding Test

+

This test verifies that context.getParameter() returns null (not undefined) for binding parameters.

+
+ + + From 5de9983b21c7a6c88e77876306622e71f04a5dfc Mon Sep 17 00:00:00 2001 From: yjh Date: Tue, 18 Nov 2025 16:55:04 +0800 Subject: [PATCH 4/9] fix format --- src/client/script_bindings/webgl/active_info.cpp | 2 +- src/client/script_bindings/webgl/active_info.hpp | 2 +- src/client/script_bindings/webgl/framebuffer.cpp | 2 +- src/client/script_bindings/webgl/framebuffer.hpp | 2 +- src/client/script_bindings/webgl/object.cpp | 2 +- src/client/script_bindings/webgl/object.hpp | 2 +- src/client/script_bindings/webgl/program.cpp | 2 +- src/client/script_bindings/webgl/program.hpp | 2 +- src/client/script_bindings/webgl/renderbuffer.cpp | 2 +- src/client/script_bindings/webgl/renderbuffer.hpp | 2 +- src/client/script_bindings/webgl/texture.cpp | 2 +- src/client/script_bindings/webgl/texture.hpp | 2 +- src/client/script_bindings/webgl/uniform_location.cpp | 2 +- src/client/script_bindings/webgl/uniform_location.hpp | 2 +- src/client/script_bindings/webgl/vertex_array.cpp | 2 +- src/client/script_bindings/webgl/vertex_array.hpp | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/client/script_bindings/webgl/active_info.cpp b/src/client/script_bindings/webgl/active_info.cpp index 803ffe763..c0f9d3e81 100644 --- a/src/client/script_bindings/webgl/active_info.cpp +++ b/src/client/script_bindings/webgl/active_info.cpp @@ -60,5 +60,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/active_info.hpp b/src/client/script_bindings/webgl/active_info.hpp index c2d6c9080..b125c893c 100644 --- a/src/client/script_bindings/webgl/active_info.hpp +++ b/src/client/script_bindings/webgl/active_info.hpp @@ -38,5 +38,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/framebuffer.cpp b/src/client/script_bindings/webgl/framebuffer.cpp index d38e0687c..dbe790869 100644 --- a/src/client/script_bindings/webgl/framebuffer.cpp +++ b/src/client/script_bindings/webgl/framebuffer.cpp @@ -31,5 +31,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/framebuffer.hpp b/src/client/script_bindings/webgl/framebuffer.hpp index fd3ab4ec2..c54189e65 100644 --- a/src/client/script_bindings/webgl/framebuffer.hpp +++ b/src/client/script_bindings/webgl/framebuffer.hpp @@ -37,5 +37,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/object.cpp b/src/client/script_bindings/webgl/object.cpp index 78779213d..b03f846b5 100644 --- a/src/client/script_bindings/webgl/object.cpp +++ b/src/client/script_bindings/webgl/object.cpp @@ -28,5 +28,5 @@ namespace endor // WebGLObject is a base class, typically not instantiated directly } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/object.hpp b/src/client/script_bindings/webgl/object.hpp index f69bb78c8..cd48b93ae 100644 --- a/src/client/script_bindings/webgl/object.hpp +++ b/src/client/script_bindings/webgl/object.hpp @@ -45,5 +45,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/program.cpp b/src/client/script_bindings/webgl/program.cpp index 8c21d7e26..e4a68a6f8 100644 --- a/src/client/script_bindings/webgl/program.cpp +++ b/src/client/script_bindings/webgl/program.cpp @@ -20,5 +20,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/program.hpp b/src/client/script_bindings/webgl/program.hpp index 0971e7271..ede29c134 100644 --- a/src/client/script_bindings/webgl/program.hpp +++ b/src/client/script_bindings/webgl/program.hpp @@ -32,5 +32,5 @@ namespace endor WebGLProgram(v8::Isolate *isolate, const v8::FunctionCallbackInfo &args); }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/renderbuffer.cpp b/src/client/script_bindings/webgl/renderbuffer.cpp index d858602e8..7f512b63d 100644 --- a/src/client/script_bindings/webgl/renderbuffer.cpp +++ b/src/client/script_bindings/webgl/renderbuffer.cpp @@ -19,5 +19,5 @@ namespace endor // WebGLRenderbuffer objects are created by WebGL context, not by user code } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/renderbuffer.hpp b/src/client/script_bindings/webgl/renderbuffer.hpp index 581ff1b2e..a9651c800 100644 --- a/src/client/script_bindings/webgl/renderbuffer.hpp +++ b/src/client/script_bindings/webgl/renderbuffer.hpp @@ -33,5 +33,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/texture.cpp b/src/client/script_bindings/webgl/texture.cpp index 3d034839c..3b51f5dfa 100644 --- a/src/client/script_bindings/webgl/texture.cpp +++ b/src/client/script_bindings/webgl/texture.cpp @@ -27,5 +27,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/texture.hpp b/src/client/script_bindings/webgl/texture.hpp index 9272d305c..b40acad08 100644 --- a/src/client/script_bindings/webgl/texture.hpp +++ b/src/client/script_bindings/webgl/texture.hpp @@ -45,5 +45,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/uniform_location.cpp b/src/client/script_bindings/webgl/uniform_location.cpp index ce71bd5d6..597a73e97 100644 --- a/src/client/script_bindings/webgl/uniform_location.cpp +++ b/src/client/script_bindings/webgl/uniform_location.cpp @@ -47,5 +47,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/uniform_location.hpp b/src/client/script_bindings/webgl/uniform_location.hpp index a1f98b66d..a5e7de1f2 100644 --- a/src/client/script_bindings/webgl/uniform_location.hpp +++ b/src/client/script_bindings/webgl/uniform_location.hpp @@ -44,5 +44,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/vertex_array.cpp b/src/client/script_bindings/webgl/vertex_array.cpp index 48e8e644b..3e6ed5f0a 100644 --- a/src/client/script_bindings/webgl/vertex_array.cpp +++ b/src/client/script_bindings/webgl/vertex_array.cpp @@ -20,5 +20,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/vertex_array.hpp b/src/client/script_bindings/webgl/vertex_array.hpp index a4a03cc1d..7ba162aa3 100644 --- a/src/client/script_bindings/webgl/vertex_array.hpp +++ b/src/client/script_bindings/webgl/vertex_array.hpp @@ -33,5 +33,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file From b864ea99650b63d1fb5d140df96f40bfdc842b46 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Nov 2025 09:22:40 +0000 Subject: [PATCH 5/9] Implement proper object binding retrieval for tracked WebGL bindings - Return actual bound objects for ARRAY_BUFFER_BINDING, ELEMENT_ARRAY_BUFFER_BINDING, FRAMEBUFFER_BINDING, RENDERBUFFER_BINDING, and CURRENT_PROGRAM from clientState - Return actual bound objects for WebGL2 VERTEX_ARRAY_BINDING, DRAW_FRAMEBUFFER_BINDING, and READ_FRAMEBUFFER_BINDING - Keep null return for bindings not yet tracked (textures, samplers, transform feedback, and additional buffer binding points) - Add detailed TODO comments explaining what would be needed for untracked bindings Co-authored-by: EndlessJour9527 <155411404+EndlessJour9527@users.noreply.github.com> --- .../script_bindings/webgl/active_info.cpp | 2 +- .../script_bindings/webgl/active_info.hpp | 2 +- .../script_bindings/webgl/framebuffer.cpp | 2 +- .../script_bindings/webgl/framebuffer.hpp | 2 +- src/client/script_bindings/webgl/object.cpp | 2 +- src/client/script_bindings/webgl/object.hpp | 2 +- src/client/script_bindings/webgl/program.cpp | 2 +- src/client/script_bindings/webgl/program.hpp | 2 +- .../script_bindings/webgl/renderbuffer.cpp | 2 +- .../script_bindings/webgl/renderbuffer.hpp | 2 +- src/client/script_bindings/webgl/texture.cpp | 2 +- src/client/script_bindings/webgl/texture.hpp | 2 +- .../webgl/uniform_location.cpp | 2 +- .../webgl/uniform_location.hpp | 2 +- .../script_bindings/webgl/vertex_array.cpp | 2 +- .../script_bindings/webgl/vertex_array.hpp | 2 +- .../webgl/webgl_rendering_context.cpp | 113 ++++++++++++++++-- 17 files changed, 120 insertions(+), 25 deletions(-) diff --git a/src/client/script_bindings/webgl/active_info.cpp b/src/client/script_bindings/webgl/active_info.cpp index c0f9d3e81..803ffe763 100644 --- a/src/client/script_bindings/webgl/active_info.cpp +++ b/src/client/script_bindings/webgl/active_info.cpp @@ -60,5 +60,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/active_info.hpp b/src/client/script_bindings/webgl/active_info.hpp index b125c893c..c2d6c9080 100644 --- a/src/client/script_bindings/webgl/active_info.hpp +++ b/src/client/script_bindings/webgl/active_info.hpp @@ -38,5 +38,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/framebuffer.cpp b/src/client/script_bindings/webgl/framebuffer.cpp index dbe790869..d38e0687c 100644 --- a/src/client/script_bindings/webgl/framebuffer.cpp +++ b/src/client/script_bindings/webgl/framebuffer.cpp @@ -31,5 +31,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/framebuffer.hpp b/src/client/script_bindings/webgl/framebuffer.hpp index c54189e65..fd3ab4ec2 100644 --- a/src/client/script_bindings/webgl/framebuffer.hpp +++ b/src/client/script_bindings/webgl/framebuffer.hpp @@ -37,5 +37,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/object.cpp b/src/client/script_bindings/webgl/object.cpp index b03f846b5..78779213d 100644 --- a/src/client/script_bindings/webgl/object.cpp +++ b/src/client/script_bindings/webgl/object.cpp @@ -28,5 +28,5 @@ namespace endor // WebGLObject is a base class, typically not instantiated directly } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/object.hpp b/src/client/script_bindings/webgl/object.hpp index cd48b93ae..f69bb78c8 100644 --- a/src/client/script_bindings/webgl/object.hpp +++ b/src/client/script_bindings/webgl/object.hpp @@ -45,5 +45,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/program.cpp b/src/client/script_bindings/webgl/program.cpp index e4a68a6f8..8c21d7e26 100644 --- a/src/client/script_bindings/webgl/program.cpp +++ b/src/client/script_bindings/webgl/program.cpp @@ -20,5 +20,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/program.hpp b/src/client/script_bindings/webgl/program.hpp index ede29c134..0971e7271 100644 --- a/src/client/script_bindings/webgl/program.hpp +++ b/src/client/script_bindings/webgl/program.hpp @@ -32,5 +32,5 @@ namespace endor WebGLProgram(v8::Isolate *isolate, const v8::FunctionCallbackInfo &args); }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/renderbuffer.cpp b/src/client/script_bindings/webgl/renderbuffer.cpp index 7f512b63d..d858602e8 100644 --- a/src/client/script_bindings/webgl/renderbuffer.cpp +++ b/src/client/script_bindings/webgl/renderbuffer.cpp @@ -19,5 +19,5 @@ namespace endor // WebGLRenderbuffer objects are created by WebGL context, not by user code } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/renderbuffer.hpp b/src/client/script_bindings/webgl/renderbuffer.hpp index a9651c800..581ff1b2e 100644 --- a/src/client/script_bindings/webgl/renderbuffer.hpp +++ b/src/client/script_bindings/webgl/renderbuffer.hpp @@ -33,5 +33,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/texture.cpp b/src/client/script_bindings/webgl/texture.cpp index 3b51f5dfa..3d034839c 100644 --- a/src/client/script_bindings/webgl/texture.cpp +++ b/src/client/script_bindings/webgl/texture.cpp @@ -27,5 +27,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/texture.hpp b/src/client/script_bindings/webgl/texture.hpp index b40acad08..9272d305c 100644 --- a/src/client/script_bindings/webgl/texture.hpp +++ b/src/client/script_bindings/webgl/texture.hpp @@ -45,5 +45,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/uniform_location.cpp b/src/client/script_bindings/webgl/uniform_location.cpp index 597a73e97..ce71bd5d6 100644 --- a/src/client/script_bindings/webgl/uniform_location.cpp +++ b/src/client/script_bindings/webgl/uniform_location.cpp @@ -47,5 +47,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/uniform_location.hpp b/src/client/script_bindings/webgl/uniform_location.hpp index a5e7de1f2..a1f98b66d 100644 --- a/src/client/script_bindings/webgl/uniform_location.hpp +++ b/src/client/script_bindings/webgl/uniform_location.hpp @@ -44,5 +44,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/vertex_array.cpp b/src/client/script_bindings/webgl/vertex_array.cpp index 3e6ed5f0a..48e8e644b 100644 --- a/src/client/script_bindings/webgl/vertex_array.cpp +++ b/src/client/script_bindings/webgl/vertex_array.cpp @@ -20,5 +20,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/vertex_array.hpp b/src/client/script_bindings/webgl/vertex_array.hpp index 7ba162aa3..a4a03cc1d 100644 --- a/src/client/script_bindings/webgl/vertex_array.hpp +++ b/src/client/script_bindings/webgl/vertex_array.hpp @@ -33,5 +33,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/webgl_rendering_context.cpp b/src/client/script_bindings/webgl/webgl_rendering_context.cpp index 2bbfd49d6..81d7bb6a0 100644 --- a/src/client/script_bindings/webgl/webgl_rendering_context.cpp +++ b/src/client/script_bindings/webgl/webgl_rendering_context.cpp @@ -4387,17 +4387,76 @@ namespace endor } /** * WebGL object bindings (return null when nothing bound, object when bound) - * Currently return null as backend doesn't track all binding states */ case WEBGL_ARRAY_BUFFER_BINDING: + { + auto &state = handle()->clientState(); + if (state.vertexBuffer.has_value() && state.vertexBuffer.value() != nullptr) + { + jsValue = WebGLBuffer::NewInstance(isolate, state.vertexBuffer.value()); + } + else + { + jsValue = Null(isolate); + } + break; + } case WEBGL_ELEMENT_ARRAY_BUFFER_BINDING: + { + auto &state = handle()->clientState(); + if (state.elementBuffer.has_value() && state.elementBuffer.value() != nullptr) + { + jsValue = WebGLBuffer::NewInstance(isolate, state.elementBuffer.value()); + } + else + { + jsValue = Null(isolate); + } + break; + } case WEBGL_FRAMEBUFFER_BINDING: + { + auto &state = handle()->clientState(); + if (state.framebuffer.has_value() && state.framebuffer.value() != nullptr) + { + jsValue = WebGLFramebuffer::NewInstance(isolate, state.framebuffer.value()); + } + else + { + jsValue = Null(isolate); + } + break; + } case WEBGL_RENDERBUFFER_BINDING: + { + auto &state = handle()->clientState(); + if (state.renderbuffer.has_value() && state.renderbuffer.value() != nullptr) + { + jsValue = WebGLRenderbuffer::NewInstance(isolate, state.renderbuffer.value()); + } + else + { + jsValue = Null(isolate); + } + break; + } + case WEBGL_CURRENT_PROGRAM: + { + auto &state = handle()->clientState(); + if (state.program.has_value() && state.program.value() != nullptr) + { + jsValue = WebGLProgram::NewInstance(isolate, state.program.value()); + } + else + { + jsValue = Null(isolate); + } + break; + } case WEBGL_TEXTURE_BINDING_2D: case WEBGL_TEXTURE_BINDING_CUBE_MAP: - case WEBGL_CURRENT_PROGRAM: { - // TODO: Implement proper object binding retrieval from backend + // TODO: Texture bindings not yet tracked in clientState jsValue = Null(isolate); break; } @@ -4447,23 +4506,59 @@ namespace endor } /** * WebGL2 object bindings (return null when nothing bound, object when bound) - * Currently return null as backend doesn't track all binding states */ - case WEBGL2_COPY_READ_BUFFER_BINDING: - case WEBGL2_COPY_WRITE_BUFFER_BINDING: + case WEBGL2_VERTEX_ARRAY_BINDING: + { + auto &state = handle()->clientState(); + if (state.vertexArray.has_value() && state.vertexArray.value() != nullptr) + { + jsValue = WebGLVertexArray::NewInstance(isolate, state.vertexArray.value()); + } + else + { + jsValue = Null(isolate); + } + break; + } case WEBGL2_DRAW_FRAMEBUFFER_BINDING: case WEBGL2_READ_FRAMEBUFFER_BINDING: + { + // Both draw and read framebuffer binding return the same framebuffer in WebGL2 + auto &state = handle()->clientState(); + if (state.framebuffer.has_value() && state.framebuffer.value() != nullptr) + { + jsValue = WebGLFramebuffer::NewInstance(isolate, state.framebuffer.value()); + } + else + { + jsValue = Null(isolate); + } + break; + } + case WEBGL2_COPY_READ_BUFFER_BINDING: + case WEBGL2_COPY_WRITE_BUFFER_BINDING: case WEBGL2_PIXEL_PACK_BUFFER_BINDING: case WEBGL2_PIXEL_UNPACK_BUFFER_BINDING: case WEBGL2_UNIFORM_BUFFER_BINDING: - case WEBGL2_VERTEX_ARRAY_BINDING: + case WEBGL2_TRANSFORM_FEEDBACK_BUFFER_BINDING: + { + // TODO: These buffer bindings are not yet tracked in clientState + // Would require extending WebGLState to track additional buffer binding points + jsValue = Null(isolate); + break; + } case WEBGL2_SAMPLER_BINDING: case WEBGL2_TRANSFORM_FEEDBACK_BINDING: - case WEBGL2_TRANSFORM_FEEDBACK_BUFFER_BINDING: + { + // TODO: Sampler and transform feedback bindings not yet tracked + // Would require creating WebGLSampler and WebGLTransformFeedback JavaScript bindings + jsValue = Null(isolate); + break; + } case WEBGL2_TEXTURE_BINDING_2D_ARRAY: case WEBGL2_TEXTURE_BINDING_3D: { - // TODO: Implement proper object binding retrieval from backend + // TODO: Texture bindings not yet tracked in clientState jsValue = Null(isolate); break; } From a0c62e9a836f4df70abbba1ab123de1597af538d Mon Sep 17 00:00:00 2001 From: yjh Date: Mon, 24 Nov 2025 20:01:54 +0800 Subject: [PATCH 6/9] fix format --- src/client/script_bindings/webgl/active_info.cpp | 2 +- src/client/script_bindings/webgl/active_info.hpp | 2 +- src/client/script_bindings/webgl/framebuffer.cpp | 2 +- src/client/script_bindings/webgl/framebuffer.hpp | 2 +- src/client/script_bindings/webgl/object.cpp | 2 +- src/client/script_bindings/webgl/object.hpp | 2 +- src/client/script_bindings/webgl/program.cpp | 2 +- src/client/script_bindings/webgl/program.hpp | 2 +- src/client/script_bindings/webgl/renderbuffer.cpp | 2 +- src/client/script_bindings/webgl/renderbuffer.hpp | 2 +- src/client/script_bindings/webgl/texture.cpp | 2 +- src/client/script_bindings/webgl/texture.hpp | 2 +- src/client/script_bindings/webgl/uniform_location.cpp | 2 +- src/client/script_bindings/webgl/uniform_location.hpp | 2 +- src/client/script_bindings/webgl/vertex_array.cpp | 2 +- src/client/script_bindings/webgl/vertex_array.hpp | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/client/script_bindings/webgl/active_info.cpp b/src/client/script_bindings/webgl/active_info.cpp index 803ffe763..c0f9d3e81 100644 --- a/src/client/script_bindings/webgl/active_info.cpp +++ b/src/client/script_bindings/webgl/active_info.cpp @@ -60,5 +60,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/active_info.hpp b/src/client/script_bindings/webgl/active_info.hpp index c2d6c9080..b125c893c 100644 --- a/src/client/script_bindings/webgl/active_info.hpp +++ b/src/client/script_bindings/webgl/active_info.hpp @@ -38,5 +38,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/framebuffer.cpp b/src/client/script_bindings/webgl/framebuffer.cpp index d38e0687c..dbe790869 100644 --- a/src/client/script_bindings/webgl/framebuffer.cpp +++ b/src/client/script_bindings/webgl/framebuffer.cpp @@ -31,5 +31,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/framebuffer.hpp b/src/client/script_bindings/webgl/framebuffer.hpp index fd3ab4ec2..c54189e65 100644 --- a/src/client/script_bindings/webgl/framebuffer.hpp +++ b/src/client/script_bindings/webgl/framebuffer.hpp @@ -37,5 +37,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/object.cpp b/src/client/script_bindings/webgl/object.cpp index 78779213d..b03f846b5 100644 --- a/src/client/script_bindings/webgl/object.cpp +++ b/src/client/script_bindings/webgl/object.cpp @@ -28,5 +28,5 @@ namespace endor // WebGLObject is a base class, typically not instantiated directly } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/object.hpp b/src/client/script_bindings/webgl/object.hpp index f69bb78c8..cd48b93ae 100644 --- a/src/client/script_bindings/webgl/object.hpp +++ b/src/client/script_bindings/webgl/object.hpp @@ -45,5 +45,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/program.cpp b/src/client/script_bindings/webgl/program.cpp index 8c21d7e26..e4a68a6f8 100644 --- a/src/client/script_bindings/webgl/program.cpp +++ b/src/client/script_bindings/webgl/program.cpp @@ -20,5 +20,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/program.hpp b/src/client/script_bindings/webgl/program.hpp index 0971e7271..ede29c134 100644 --- a/src/client/script_bindings/webgl/program.hpp +++ b/src/client/script_bindings/webgl/program.hpp @@ -32,5 +32,5 @@ namespace endor WebGLProgram(v8::Isolate *isolate, const v8::FunctionCallbackInfo &args); }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/renderbuffer.cpp b/src/client/script_bindings/webgl/renderbuffer.cpp index d858602e8..7f512b63d 100644 --- a/src/client/script_bindings/webgl/renderbuffer.cpp +++ b/src/client/script_bindings/webgl/renderbuffer.cpp @@ -19,5 +19,5 @@ namespace endor // WebGLRenderbuffer objects are created by WebGL context, not by user code } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/renderbuffer.hpp b/src/client/script_bindings/webgl/renderbuffer.hpp index 581ff1b2e..a9651c800 100644 --- a/src/client/script_bindings/webgl/renderbuffer.hpp +++ b/src/client/script_bindings/webgl/renderbuffer.hpp @@ -33,5 +33,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/texture.cpp b/src/client/script_bindings/webgl/texture.cpp index 3d034839c..3b51f5dfa 100644 --- a/src/client/script_bindings/webgl/texture.cpp +++ b/src/client/script_bindings/webgl/texture.cpp @@ -27,5 +27,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/texture.hpp b/src/client/script_bindings/webgl/texture.hpp index 9272d305c..b40acad08 100644 --- a/src/client/script_bindings/webgl/texture.hpp +++ b/src/client/script_bindings/webgl/texture.hpp @@ -45,5 +45,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/uniform_location.cpp b/src/client/script_bindings/webgl/uniform_location.cpp index ce71bd5d6..597a73e97 100644 --- a/src/client/script_bindings/webgl/uniform_location.cpp +++ b/src/client/script_bindings/webgl/uniform_location.cpp @@ -47,5 +47,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/uniform_location.hpp b/src/client/script_bindings/webgl/uniform_location.hpp index a1f98b66d..a5e7de1f2 100644 --- a/src/client/script_bindings/webgl/uniform_location.hpp +++ b/src/client/script_bindings/webgl/uniform_location.hpp @@ -44,5 +44,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/vertex_array.cpp b/src/client/script_bindings/webgl/vertex_array.cpp index 48e8e644b..3e6ed5f0a 100644 --- a/src/client/script_bindings/webgl/vertex_array.cpp +++ b/src/client/script_bindings/webgl/vertex_array.cpp @@ -20,5 +20,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/vertex_array.hpp b/src/client/script_bindings/webgl/vertex_array.hpp index a4a03cc1d..7ba162aa3 100644 --- a/src/client/script_bindings/webgl/vertex_array.hpp +++ b/src/client/script_bindings/webgl/vertex_array.hpp @@ -33,5 +33,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file From bc4765991eab188284e4a6bf9035c651360d4cc7 Mon Sep 17 00:00:00 2001 From: yjh Date: Tue, 25 Nov 2025 10:56:03 +0800 Subject: [PATCH 7/9] Refactor WebGL context to provide a read-only accessor for client state --- .../getparameter-binding-test.html | 19 +------------------ src/client/graphics/webgl_context.hpp | 15 ++++++++------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/fixtures/html/webgl-conformance/getparameter-binding-test.html b/fixtures/html/webgl-conformance/getparameter-binding-test.html index 3d4ab52bc..bcb898805 100644 --- a/fixtures/html/webgl-conformance/getparameter-binding-test.html +++ b/fixtures/html/webgl-conformance/getparameter-binding-test.html @@ -41,26 +41,9 @@

WebGL getParameter Binding Test

} } - // Create WebGL1 context - const canvas1 = document.createElement('canvas'); - const gl1 = canvas1.getContext('webgl'); - - if (gl1) { - results.innerHTML += '

WebGL 1.0 Binding Parameters

'; - testParameter(gl1, 'ARRAY_BUFFER_BINDING', gl1.ARRAY_BUFFER_BINDING); - testParameter(gl1, 'ELEMENT_ARRAY_BUFFER_BINDING', gl1.ELEMENT_ARRAY_BUFFER_BINDING); - testParameter(gl1, 'FRAMEBUFFER_BINDING', gl1.FRAMEBUFFER_BINDING); - testParameter(gl1, 'RENDERBUFFER_BINDING', gl1.RENDERBUFFER_BINDING); - testParameter(gl1, 'TEXTURE_BINDING_2D', gl1.TEXTURE_BINDING_2D); - testParameter(gl1, 'TEXTURE_BINDING_CUBE_MAP', gl1.TEXTURE_BINDING_CUBE_MAP); - testParameter(gl1, 'CURRENT_PROGRAM', gl1.CURRENT_PROGRAM); - } else { - log('WebGL 1.0 not supported', false); - } - // Create WebGL2 context const canvas2 = document.createElement('canvas'); - const gl2 = canvas2.getContext('webgl2'); + const gl2 = navigator.gl || canvas2.getContext('webgl2'); if (gl2) { results.innerHTML += '

WebGL 2.0 Binding Parameters

'; diff --git a/src/client/graphics/webgl_context.hpp b/src/client/graphics/webgl_context.hpp index 32567de43..3cb4aefbd 100644 --- a/src/client/graphics/webgl_context.hpp +++ b/src/client/graphics/webgl_context.hpp @@ -725,13 +725,6 @@ namespace endor } private: - /** - * @returns the client state of the WebGL context. - */ - WebGLState &clientState() - { - return clientState_; - } /** * an XR-compatible WebGL context could be configured as an `XRWebGLLayer` object and be connected to a specific WebXR * session. At the same time, each WebXR session could own 1 base layer, thus the XR-compatible WebGL context to a WebXR @@ -771,6 +764,14 @@ namespace endor std::string renderer; // The default handedness of the coordinate system to use. commandbuffers::MatrixHandedness defaultCoordHandedness = commandbuffers::MatrixHandedness::MATRIX_RIGHT_HANDED; + /** + * @returns the client state of the WebGL context. + */ + // Read-only accessor + const WebGLState &clientState() const + { + return clientState_; + } protected: TrClientContextPerProcess *clientContext_; From d5f449804e80da66d69ab661ccc085ada19a4831 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Nov 2025 06:24:25 +0000 Subject: [PATCH 8/9] Refactor getParameter binding logic to use webgl_context layer - Add new enums for buffer/object binding parameters in webgl_context.hpp - Add getParameter methods in WebGLContext for buffer/program/framebuffer/renderbuffer bindings - Add getParameterV2 methods in WebGL2Context for WebGL2-specific bindings - Update webgl_rendering_context.cpp to use handle()->getParameter() pattern Co-authored-by: EndlessJour9527 <155411404+EndlessJour9527@users.noreply.github.com> --- src/client/graphics/webgl_context.cpp | 70 ++++++++++++++++ src/client/graphics/webgl_context.hpp | 42 ++++++++++ .../script_bindings/webgl/active_info.cpp | 2 +- .../script_bindings/webgl/active_info.hpp | 2 +- .../script_bindings/webgl/framebuffer.cpp | 2 +- .../script_bindings/webgl/framebuffer.hpp | 2 +- src/client/script_bindings/webgl/object.cpp | 2 +- src/client/script_bindings/webgl/object.hpp | 2 +- src/client/script_bindings/webgl/program.cpp | 2 +- src/client/script_bindings/webgl/program.hpp | 2 +- .../script_bindings/webgl/renderbuffer.cpp | 2 +- .../script_bindings/webgl/renderbuffer.hpp | 2 +- src/client/script_bindings/webgl/texture.cpp | 2 +- src/client/script_bindings/webgl/texture.hpp | 2 +- .../webgl/uniform_location.cpp | 2 +- .../webgl/uniform_location.hpp | 2 +- .../script_bindings/webgl/vertex_array.cpp | 2 +- .../script_bindings/webgl/vertex_array.hpp | 2 +- .../webgl/webgl_rendering_context.cpp | 82 +++++++------------ 19 files changed, 157 insertions(+), 69 deletions(-) diff --git a/src/client/graphics/webgl_context.cpp b/src/client/graphics/webgl_context.cpp index 9e60d485b..6349d3434 100644 --- a/src/client/graphics/webgl_context.cpp +++ b/src/client/graphics/webgl_context.cpp @@ -1466,6 +1466,40 @@ namespace endor return v; } + shared_ptr WebGLContext::getParameter(WebGLBufferBindingParameterName pname) + { + switch (pname) + { + case WebGLBufferBindingParameterName::kArrayBufferBinding: + return clientState_.vertexBuffer.value_or(nullptr); + case WebGLBufferBindingParameterName::kElementArrayBufferBinding: + return clientState_.elementBuffer.value_or(nullptr); + default: + return nullptr; + } + } + + shared_ptr WebGLContext::getParameterProgram(WebGLObjectBindingParameterName pname) + { + if (pname == WebGLObjectBindingParameterName::kCurrentProgram) + return clientState_.program.value_or(nullptr); + return nullptr; + } + + shared_ptr WebGLContext::getParameterFramebuffer(WebGLObjectBindingParameterName pname) + { + if (pname == WebGLObjectBindingParameterName::kFramebufferBinding) + return clientState_.framebuffer.value_or(nullptr); + return nullptr; + } + + shared_ptr WebGLContext::getParameterRenderbuffer(WebGLObjectBindingParameterName pname) + { + if (pname == WebGLObjectBindingParameterName::kRenderbufferBinding) + return clientState_.renderbuffer.value_or(nullptr); + return nullptr; + } + WebGLShaderPrecisionFormat WebGLContext::getShaderPrecisionFormat(int shadertype, int precisiontype) { if (shadertype != WEBGL_VERTEX_SHADER && shadertype != WEBGL_FRAGMENT_SHADER) @@ -2038,6 +2072,42 @@ namespace endor return v; } + shared_ptr WebGL2Context::getParameterV2(WebGL2BufferBindingParameterName pname) + { + // These buffer bindings are not yet tracked in clientState + // TODO: Extend WebGLState to track additional buffer binding points + switch (pname) + { + case WebGL2BufferBindingParameterName::kCopyReadBufferBinding: + case WebGL2BufferBindingParameterName::kCopyWriteBufferBinding: + case WebGL2BufferBindingParameterName::kPixelPackBufferBinding: + case WebGL2BufferBindingParameterName::kPixelUnpackBufferBinding: + case WebGL2BufferBindingParameterName::kTransformFeedbackBufferBinding: + case WebGL2BufferBindingParameterName::kUniformBufferBinding: + default: + return nullptr; + } + } + + shared_ptr WebGL2Context::getParameterFramebufferV2(WebGL2ObjectBindingParameterName pname) + { + switch (pname) + { + case WebGL2ObjectBindingParameterName::kDrawFramebufferBinding: + case WebGL2ObjectBindingParameterName::kReadFramebufferBinding: + return clientState_.framebuffer.value_or(nullptr); + default: + return nullptr; + } + } + + shared_ptr WebGL2Context::getParameterVertexArrayV2(WebGL2ObjectBindingParameterName pname) + { + if (pname == WebGL2ObjectBindingParameterName::kVertexArrayBinding) + return clientState_.vertexArray.value_or(nullptr); + return nullptr; + } + shared_ptr WebGL2Context::getQuery(WebGLQueryTarget target, int pname) { NOT_IMPLEMENTED(); diff --git a/src/client/graphics/webgl_context.hpp b/src/client/graphics/webgl_context.hpp index 3cb4aefbd..b8f08cd59 100644 --- a/src/client/graphics/webgl_context.hpp +++ b/src/client/graphics/webgl_context.hpp @@ -219,6 +219,41 @@ namespace endor kExtMaxViewsOvr = WEBGL2_EXT_MAX_VIEWS_OVR, }; + /** + * Enum for buffer/object binding parameters that return WebGL objects. + */ + enum class WebGLBufferBindingParameterName + { + kArrayBufferBinding = WEBGL_ARRAY_BUFFER_BINDING, + kElementArrayBufferBinding = WEBGL_ELEMENT_ARRAY_BUFFER_BINDING, + }; + + enum class WebGLObjectBindingParameterName + { + kCurrentProgram = WEBGL_CURRENT_PROGRAM, + kFramebufferBinding = WEBGL_FRAMEBUFFER_BINDING, + kRenderbufferBinding = WEBGL_RENDERBUFFER_BINDING, + }; + + enum class WebGL2BufferBindingParameterName + { + kCopyReadBufferBinding = WEBGL2_COPY_READ_BUFFER_BINDING, + kCopyWriteBufferBinding = WEBGL2_COPY_WRITE_BUFFER_BINDING, + kPixelPackBufferBinding = WEBGL2_PIXEL_PACK_BUFFER_BINDING, + kPixelUnpackBufferBinding = WEBGL2_PIXEL_UNPACK_BUFFER_BINDING, + kTransformFeedbackBufferBinding = WEBGL2_TRANSFORM_FEEDBACK_BUFFER_BINDING, + kUniformBufferBinding = WEBGL2_UNIFORM_BUFFER_BINDING, + }; + + enum class WebGL2ObjectBindingParameterName + { + kDrawFramebufferBinding = WEBGL2_DRAW_FRAMEBUFFER_BINDING, + kReadFramebufferBinding = WEBGL2_READ_FRAMEBUFFER_BINDING, + kVertexArrayBinding = WEBGL2_VERTEX_ARRAY_BINDING, + kSamplerBinding = WEBGL2_SAMPLER_BINDING, + kTransformFeedbackBinding = WEBGL2_TRANSFORM_FEEDBACK_BINDING, + }; + class ContextAttributes final { public: @@ -464,6 +499,10 @@ namespace endor bool getParameter(WebGLBooleanIndexedParameterName pname, int index); float getParameter(WebGLFloatArrayParameterName pname, int index); std::string getParameter(WebGLStringParameterName pname); + std::shared_ptr getParameter(WebGLBufferBindingParameterName pname); + std::shared_ptr getParameterProgram(WebGLObjectBindingParameterName pname); + std::shared_ptr getParameterFramebuffer(WebGLObjectBindingParameterName pname); + std::shared_ptr getParameterRenderbuffer(WebGLObjectBindingParameterName pname); WebGLShaderPrecisionFormat getShaderPrecisionFormat(int shadertype, int precisiontype); int getError(); std::vector &getSupportedExtensions(); @@ -918,6 +957,9 @@ namespace endor std::optional length = std::nullopt); int getFragDataLocation(std::shared_ptr program, const std::string &name); int getParameterV2(WebGL2IntegerParameterName pname); + std::shared_ptr getParameterV2(WebGL2BufferBindingParameterName pname); + std::shared_ptr getParameterFramebufferV2(WebGL2ObjectBindingParameterName pname); + std::shared_ptr getParameterVertexArrayV2(WebGL2ObjectBindingParameterName pname); std::shared_ptr getQuery(WebGLQueryTarget target, int pname); int getUniformBlockIndex(std::shared_ptr program, const std::string &uniformBlockName); diff --git a/src/client/script_bindings/webgl/active_info.cpp b/src/client/script_bindings/webgl/active_info.cpp index c0f9d3e81..803ffe763 100644 --- a/src/client/script_bindings/webgl/active_info.cpp +++ b/src/client/script_bindings/webgl/active_info.cpp @@ -60,5 +60,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/active_info.hpp b/src/client/script_bindings/webgl/active_info.hpp index b125c893c..c2d6c9080 100644 --- a/src/client/script_bindings/webgl/active_info.hpp +++ b/src/client/script_bindings/webgl/active_info.hpp @@ -38,5 +38,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/framebuffer.cpp b/src/client/script_bindings/webgl/framebuffer.cpp index dbe790869..d38e0687c 100644 --- a/src/client/script_bindings/webgl/framebuffer.cpp +++ b/src/client/script_bindings/webgl/framebuffer.cpp @@ -31,5 +31,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/framebuffer.hpp b/src/client/script_bindings/webgl/framebuffer.hpp index c54189e65..fd3ab4ec2 100644 --- a/src/client/script_bindings/webgl/framebuffer.hpp +++ b/src/client/script_bindings/webgl/framebuffer.hpp @@ -37,5 +37,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/object.cpp b/src/client/script_bindings/webgl/object.cpp index b03f846b5..78779213d 100644 --- a/src/client/script_bindings/webgl/object.cpp +++ b/src/client/script_bindings/webgl/object.cpp @@ -28,5 +28,5 @@ namespace endor // WebGLObject is a base class, typically not instantiated directly } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/object.hpp b/src/client/script_bindings/webgl/object.hpp index cd48b93ae..f69bb78c8 100644 --- a/src/client/script_bindings/webgl/object.hpp +++ b/src/client/script_bindings/webgl/object.hpp @@ -45,5 +45,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/program.cpp b/src/client/script_bindings/webgl/program.cpp index e4a68a6f8..8c21d7e26 100644 --- a/src/client/script_bindings/webgl/program.cpp +++ b/src/client/script_bindings/webgl/program.cpp @@ -20,5 +20,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/program.hpp b/src/client/script_bindings/webgl/program.hpp index ede29c134..0971e7271 100644 --- a/src/client/script_bindings/webgl/program.hpp +++ b/src/client/script_bindings/webgl/program.hpp @@ -32,5 +32,5 @@ namespace endor WebGLProgram(v8::Isolate *isolate, const v8::FunctionCallbackInfo &args); }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/renderbuffer.cpp b/src/client/script_bindings/webgl/renderbuffer.cpp index 7f512b63d..d858602e8 100644 --- a/src/client/script_bindings/webgl/renderbuffer.cpp +++ b/src/client/script_bindings/webgl/renderbuffer.cpp @@ -19,5 +19,5 @@ namespace endor // WebGLRenderbuffer objects are created by WebGL context, not by user code } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/renderbuffer.hpp b/src/client/script_bindings/webgl/renderbuffer.hpp index a9651c800..581ff1b2e 100644 --- a/src/client/script_bindings/webgl/renderbuffer.hpp +++ b/src/client/script_bindings/webgl/renderbuffer.hpp @@ -33,5 +33,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/texture.cpp b/src/client/script_bindings/webgl/texture.cpp index 3b51f5dfa..3d034839c 100644 --- a/src/client/script_bindings/webgl/texture.cpp +++ b/src/client/script_bindings/webgl/texture.cpp @@ -27,5 +27,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/texture.hpp b/src/client/script_bindings/webgl/texture.hpp index b40acad08..9272d305c 100644 --- a/src/client/script_bindings/webgl/texture.hpp +++ b/src/client/script_bindings/webgl/texture.hpp @@ -45,5 +45,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/uniform_location.cpp b/src/client/script_bindings/webgl/uniform_location.cpp index 597a73e97..ce71bd5d6 100644 --- a/src/client/script_bindings/webgl/uniform_location.cpp +++ b/src/client/script_bindings/webgl/uniform_location.cpp @@ -47,5 +47,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/uniform_location.hpp b/src/client/script_bindings/webgl/uniform_location.hpp index a5e7de1f2..a1f98b66d 100644 --- a/src/client/script_bindings/webgl/uniform_location.hpp +++ b/src/client/script_bindings/webgl/uniform_location.hpp @@ -44,5 +44,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/vertex_array.cpp b/src/client/script_bindings/webgl/vertex_array.cpp index 3e6ed5f0a..48e8e644b 100644 --- a/src/client/script_bindings/webgl/vertex_array.cpp +++ b/src/client/script_bindings/webgl/vertex_array.cpp @@ -20,5 +20,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/vertex_array.hpp b/src/client/script_bindings/webgl/vertex_array.hpp index 7ba162aa3..a4a03cc1d 100644 --- a/src/client/script_bindings/webgl/vertex_array.hpp +++ b/src/client/script_bindings/webgl/vertex_array.hpp @@ -33,5 +33,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/webgl_rendering_context.cpp b/src/client/script_bindings/webgl/webgl_rendering_context.cpp index 81d7bb6a0..7d10a56ca 100644 --- a/src/client/script_bindings/webgl/webgl_rendering_context.cpp +++ b/src/client/script_bindings/webgl/webgl_rendering_context.cpp @@ -4390,67 +4390,47 @@ namespace endor */ case WEBGL_ARRAY_BUFFER_BINDING: { - auto &state = handle()->clientState(); - if (state.vertexBuffer.has_value() && state.vertexBuffer.value() != nullptr) - { - jsValue = WebGLBuffer::NewInstance(isolate, state.vertexBuffer.value()); - } + auto value = handle()->getParameter(static_cast(pname)); + if (value != nullptr) + jsValue = WebGLBuffer::NewInstance(isolate, value); else - { jsValue = Null(isolate); - } break; } case WEBGL_ELEMENT_ARRAY_BUFFER_BINDING: { - auto &state = handle()->clientState(); - if (state.elementBuffer.has_value() && state.elementBuffer.value() != nullptr) - { - jsValue = WebGLBuffer::NewInstance(isolate, state.elementBuffer.value()); - } + auto value = handle()->getParameter(static_cast(pname)); + if (value != nullptr) + jsValue = WebGLBuffer::NewInstance(isolate, value); else - { jsValue = Null(isolate); - } break; } case WEBGL_FRAMEBUFFER_BINDING: { - auto &state = handle()->clientState(); - if (state.framebuffer.has_value() && state.framebuffer.value() != nullptr) - { - jsValue = WebGLFramebuffer::NewInstance(isolate, state.framebuffer.value()); - } + auto value = handle()->getParameterFramebuffer(static_cast(pname)); + if (value != nullptr) + jsValue = WebGLFramebuffer::NewInstance(isolate, value); else - { jsValue = Null(isolate); - } break; } case WEBGL_RENDERBUFFER_BINDING: { - auto &state = handle()->clientState(); - if (state.renderbuffer.has_value() && state.renderbuffer.value() != nullptr) - { - jsValue = WebGLRenderbuffer::NewInstance(isolate, state.renderbuffer.value()); - } + auto value = handle()->getParameterRenderbuffer(static_cast(pname)); + if (value != nullptr) + jsValue = WebGLRenderbuffer::NewInstance(isolate, value); else - { jsValue = Null(isolate); - } break; } case WEBGL_CURRENT_PROGRAM: { - auto &state = handle()->clientState(); - if (state.program.has_value() && state.program.value() != nullptr) - { - jsValue = WebGLProgram::NewInstance(isolate, state.program.value()); - } + auto value = handle()->getParameterProgram(static_cast(pname)); + if (value != nullptr) + jsValue = WebGLProgram::NewInstance(isolate, value); else - { jsValue = Null(isolate); - } break; } case WEBGL_TEXTURE_BINDING_2D: @@ -4509,30 +4489,23 @@ namespace endor */ case WEBGL2_VERTEX_ARRAY_BINDING: { - auto &state = handle()->clientState(); - if (state.vertexArray.has_value() && state.vertexArray.value() != nullptr) - { - jsValue = WebGLVertexArray::NewInstance(isolate, state.vertexArray.value()); - } + auto value = handle() + ->getParameterVertexArrayV2(static_cast(pname)); + if (value != nullptr) + jsValue = WebGLVertexArray::NewInstance(isolate, value); else - { jsValue = Null(isolate); - } break; } case WEBGL2_DRAW_FRAMEBUFFER_BINDING: case WEBGL2_READ_FRAMEBUFFER_BINDING: { - // Both draw and read framebuffer binding return the same framebuffer in WebGL2 - auto &state = handle()->clientState(); - if (state.framebuffer.has_value() && state.framebuffer.value() != nullptr) - { - jsValue = WebGLFramebuffer::NewInstance(isolate, state.framebuffer.value()); - } + auto value = handle() + ->getParameterFramebufferV2(static_cast(pname)); + if (value != nullptr) + jsValue = WebGLFramebuffer::NewInstance(isolate, value); else - { jsValue = Null(isolate); - } break; } case WEBGL2_COPY_READ_BUFFER_BINDING: @@ -4542,9 +4515,12 @@ namespace endor case WEBGL2_UNIFORM_BUFFER_BINDING: case WEBGL2_TRANSFORM_FEEDBACK_BUFFER_BINDING: { - // TODO: These buffer bindings are not yet tracked in clientState - // Would require extending WebGLState to track additional buffer binding points - jsValue = Null(isolate); + auto value = handle() + ->getParameterV2(static_cast(pname)); + if (value != nullptr) + jsValue = WebGLBuffer::NewInstance(isolate, value); + else + jsValue = Null(isolate); break; } case WEBGL2_SAMPLER_BINDING: From 8770dbd92e6c8603d5aa8b88c063a0a7f976556e Mon Sep 17 00:00:00 2001 From: yjh Date: Tue, 25 Nov 2025 15:18:24 +0800 Subject: [PATCH 9/9] fix format --- src/client/graphics/webgl_context.hpp | 16 ++++++++-------- src/client/script_bindings/webgl/active_info.cpp | 2 +- src/client/script_bindings/webgl/active_info.hpp | 2 +- src/client/script_bindings/webgl/framebuffer.cpp | 2 +- src/client/script_bindings/webgl/framebuffer.hpp | 2 +- src/client/script_bindings/webgl/object.cpp | 2 +- src/client/script_bindings/webgl/object.hpp | 2 +- src/client/script_bindings/webgl/program.cpp | 2 +- src/client/script_bindings/webgl/program.hpp | 2 +- .../script_bindings/webgl/renderbuffer.cpp | 2 +- .../script_bindings/webgl/renderbuffer.hpp | 2 +- src/client/script_bindings/webgl/texture.cpp | 2 +- src/client/script_bindings/webgl/texture.hpp | 2 +- .../script_bindings/webgl/uniform_location.cpp | 2 +- .../script_bindings/webgl/uniform_location.hpp | 2 +- .../script_bindings/webgl/vertex_array.cpp | 2 +- .../script_bindings/webgl/vertex_array.hpp | 2 +- 17 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/client/graphics/webgl_context.hpp b/src/client/graphics/webgl_context.hpp index b8f08cd59..3e02da007 100644 --- a/src/client/graphics/webgl_context.hpp +++ b/src/client/graphics/webgl_context.hpp @@ -764,6 +764,14 @@ namespace endor } private: + /** + * @returns the client state of the WebGL context. + */ + // Read-only accessor + const WebGLState &clientState() const + { + return clientState_; + } /** * an XR-compatible WebGL context could be configured as an `XRWebGLLayer` object and be connected to a specific WebXR * session. At the same time, each WebXR session could own 1 base layer, thus the XR-compatible WebGL context to a WebXR @@ -803,14 +811,6 @@ namespace endor std::string renderer; // The default handedness of the coordinate system to use. commandbuffers::MatrixHandedness defaultCoordHandedness = commandbuffers::MatrixHandedness::MATRIX_RIGHT_HANDED; - /** - * @returns the client state of the WebGL context. - */ - // Read-only accessor - const WebGLState &clientState() const - { - return clientState_; - } protected: TrClientContextPerProcess *clientContext_; diff --git a/src/client/script_bindings/webgl/active_info.cpp b/src/client/script_bindings/webgl/active_info.cpp index 803ffe763..c0f9d3e81 100644 --- a/src/client/script_bindings/webgl/active_info.cpp +++ b/src/client/script_bindings/webgl/active_info.cpp @@ -60,5 +60,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/active_info.hpp b/src/client/script_bindings/webgl/active_info.hpp index c2d6c9080..b125c893c 100644 --- a/src/client/script_bindings/webgl/active_info.hpp +++ b/src/client/script_bindings/webgl/active_info.hpp @@ -38,5 +38,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/framebuffer.cpp b/src/client/script_bindings/webgl/framebuffer.cpp index d38e0687c..dbe790869 100644 --- a/src/client/script_bindings/webgl/framebuffer.cpp +++ b/src/client/script_bindings/webgl/framebuffer.cpp @@ -31,5 +31,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/framebuffer.hpp b/src/client/script_bindings/webgl/framebuffer.hpp index fd3ab4ec2..c54189e65 100644 --- a/src/client/script_bindings/webgl/framebuffer.hpp +++ b/src/client/script_bindings/webgl/framebuffer.hpp @@ -37,5 +37,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/object.cpp b/src/client/script_bindings/webgl/object.cpp index 78779213d..b03f846b5 100644 --- a/src/client/script_bindings/webgl/object.cpp +++ b/src/client/script_bindings/webgl/object.cpp @@ -28,5 +28,5 @@ namespace endor // WebGLObject is a base class, typically not instantiated directly } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/object.hpp b/src/client/script_bindings/webgl/object.hpp index f69bb78c8..cd48b93ae 100644 --- a/src/client/script_bindings/webgl/object.hpp +++ b/src/client/script_bindings/webgl/object.hpp @@ -45,5 +45,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/program.cpp b/src/client/script_bindings/webgl/program.cpp index 8c21d7e26..e4a68a6f8 100644 --- a/src/client/script_bindings/webgl/program.cpp +++ b/src/client/script_bindings/webgl/program.cpp @@ -20,5 +20,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/program.hpp b/src/client/script_bindings/webgl/program.hpp index 0971e7271..ede29c134 100644 --- a/src/client/script_bindings/webgl/program.hpp +++ b/src/client/script_bindings/webgl/program.hpp @@ -32,5 +32,5 @@ namespace endor WebGLProgram(v8::Isolate *isolate, const v8::FunctionCallbackInfo &args); }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/renderbuffer.cpp b/src/client/script_bindings/webgl/renderbuffer.cpp index d858602e8..7f512b63d 100644 --- a/src/client/script_bindings/webgl/renderbuffer.cpp +++ b/src/client/script_bindings/webgl/renderbuffer.cpp @@ -19,5 +19,5 @@ namespace endor // WebGLRenderbuffer objects are created by WebGL context, not by user code } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/renderbuffer.hpp b/src/client/script_bindings/webgl/renderbuffer.hpp index 581ff1b2e..a9651c800 100644 --- a/src/client/script_bindings/webgl/renderbuffer.hpp +++ b/src/client/script_bindings/webgl/renderbuffer.hpp @@ -33,5 +33,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/texture.cpp b/src/client/script_bindings/webgl/texture.cpp index 3d034839c..3b51f5dfa 100644 --- a/src/client/script_bindings/webgl/texture.cpp +++ b/src/client/script_bindings/webgl/texture.cpp @@ -27,5 +27,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/texture.hpp b/src/client/script_bindings/webgl/texture.hpp index 9272d305c..b40acad08 100644 --- a/src/client/script_bindings/webgl/texture.hpp +++ b/src/client/script_bindings/webgl/texture.hpp @@ -45,5 +45,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/uniform_location.cpp b/src/client/script_bindings/webgl/uniform_location.cpp index ce71bd5d6..597a73e97 100644 --- a/src/client/script_bindings/webgl/uniform_location.cpp +++ b/src/client/script_bindings/webgl/uniform_location.cpp @@ -47,5 +47,5 @@ namespace endor } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/uniform_location.hpp b/src/client/script_bindings/webgl/uniform_location.hpp index a1f98b66d..a5e7de1f2 100644 --- a/src/client/script_bindings/webgl/uniform_location.hpp +++ b/src/client/script_bindings/webgl/uniform_location.hpp @@ -44,5 +44,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file diff --git a/src/client/script_bindings/webgl/vertex_array.cpp b/src/client/script_bindings/webgl/vertex_array.cpp index 48e8e644b..3e6ed5f0a 100644 --- a/src/client/script_bindings/webgl/vertex_array.cpp +++ b/src/client/script_bindings/webgl/vertex_array.cpp @@ -20,5 +20,5 @@ namespace endor { } } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor diff --git a/src/client/script_bindings/webgl/vertex_array.hpp b/src/client/script_bindings/webgl/vertex_array.hpp index a4a03cc1d..7ba162aa3 100644 --- a/src/client/script_bindings/webgl/vertex_array.hpp +++ b/src/client/script_bindings/webgl/vertex_array.hpp @@ -33,5 +33,5 @@ namespace endor }; } // namespace webgl - } // namespace script_bindings + } // namespace script_bindings } // namespace endor \ No newline at end of file