From 2c78a8dac1d827db07a3551e12467b403fc4fd88 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:44 +0000 Subject: [PATCH 1/3] Initial plan From 4434d4ba47f8b700564c556476b773bf797bb045 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Nov 2025 06:49:14 +0000 Subject: [PATCH 2/3] Add missing WebGL2 getParameter cases for state and numeric parameters Co-authored-by: EndlessJour9527 <155411404+EndlessJour9527@users.noreply.github.com> --- src/client/graphics/webgl_context.hpp | 32 +++++++++++++++++++ .../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 | 30 +++++++++++++++++ 18 files changed, 78 insertions(+), 16 deletions(-) diff --git a/src/client/graphics/webgl_context.hpp b/src/client/graphics/webgl_context.hpp index 32567de43..a95796004 100644 --- a/src/client/graphics/webgl_context.hpp +++ b/src/client/graphics/webgl_context.hpp @@ -101,6 +101,9 @@ namespace endor kStencilTest = WEBGL_STENCIL_TEST, kUnpackFlipY = WEBGL_UNPACK_FLIP_Y_WEBGL, kUnpackPremultiplyAlpha = WEBGL_UNPACK_PREMULTIPLY_ALPHA_WEBGL, + kSampleAlphaToCoverage = WEBGL_SAMPLE_ALPHA_TO_COVERAGE, + kSampleCoverage = WEBGL_SAMPLE_COVERAGE, + kRasterizerDiscard = WEBGL2_RASTERIZER_DISCARD, }; enum class WebGLFloatParameterName @@ -217,6 +220,35 @@ namespace endor kMaxUniformBlockSize = WEBGL2_MAX_UNIFORM_BLOCK_SIZE, kMaxTextureLodBias = WEBGL2_MAX_TEXTURE_LOD_BIAS, kExtMaxViewsOvr = WEBGL2_EXT_MAX_VIEWS_OVR, + // Pixel store parameters + kPackRowLength = WEBGL2_PACK_ROW_LENGTH, + kPackSkipPixels = WEBGL2_PACK_SKIP_PIXELS, + kPackSkipRows = WEBGL2_PACK_SKIP_ROWS, + kUnpackRowLength = WEBGL2_UNPACK_ROW_LENGTH, + kUnpackImageHeight = WEBGL2_UNPACK_IMAGE_HEIGHT, + kUnpackSkipPixels = WEBGL2_UNPACK_SKIP_PIXELS, + kUnpackSkipRows = WEBGL2_UNPACK_SKIP_ROWS, + kUnpackSkipImages = WEBGL2_UNPACK_SKIP_IMAGES, + // Other state parameters + kFragmentShaderDerivativeHint = WEBGL2_FRAGMENT_SHADER_DERIVATIVE_HINT, + kReadBuffer = WEBGL2_READ_BUFFER, + kDrawBuffer0 = WEBGL2_DRAW_BUFFER0, + kDrawBuffer1 = WEBGL2_DRAW_BUFFER1, + kDrawBuffer2 = WEBGL2_DRAW_BUFFER2, + kDrawBuffer3 = WEBGL2_DRAW_BUFFER3, + kDrawBuffer4 = WEBGL2_DRAW_BUFFER4, + kDrawBuffer5 = WEBGL2_DRAW_BUFFER5, + kDrawBuffer6 = WEBGL2_DRAW_BUFFER6, + kDrawBuffer7 = WEBGL2_DRAW_BUFFER7, + kDrawBuffer8 = WEBGL2_DRAW_BUFFER8, + kDrawBuffer9 = WEBGL2_DRAW_BUFFER9, + kDrawBuffer10 = WEBGL2_DRAW_BUFFER10, + kDrawBuffer11 = WEBGL2_DRAW_BUFFER11, + kDrawBuffer12 = WEBGL2_DRAW_BUFFER12, + kDrawBuffer13 = WEBGL2_DRAW_BUFFER13, + kDrawBuffer14 = WEBGL2_DRAW_BUFFER14, + kDrawBuffer15 = WEBGL2_DRAW_BUFFER15, + kUniformBufferOffsetAlignment = WEBGL2_UNIFORM_BUFFER_OFFSET_ALIGNMENT, }; class ContextAttributes final 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..bb852fe66 100644 --- a/src/client/script_bindings/webgl/webgl_rendering_context.cpp +++ b/src/client/script_bindings/webgl/webgl_rendering_context.cpp @@ -4353,6 +4353,9 @@ namespace endor case WEBGL_STENCIL_TEST: case WEBGL_UNPACK_FLIP_Y_WEBGL: case WEBGL_UNPACK_PREMULTIPLY_ALPHA_WEBGL: + case WEBGL_SAMPLE_ALPHA_TO_COVERAGE: + case WEBGL_SAMPLE_COVERAGE: + case WEBGL2_RASTERIZER_DISCARD: { jsValue = Boolean::New(isolate, handle()->getParameter(static_cast(pname))); @@ -4423,6 +4426,33 @@ namespace endor case WEBGL2_MAX_UNIFORM_BLOCK_SIZE: case WEBGL2_MAX_TEXTURE_LOD_BIAS: case WEBGL2_EXT_MAX_VIEWS_OVR: + case WEBGL2_PACK_ROW_LENGTH: + case WEBGL2_PACK_SKIP_PIXELS: + case WEBGL2_PACK_SKIP_ROWS: + case WEBGL2_UNPACK_ROW_LENGTH: + case WEBGL2_UNPACK_IMAGE_HEIGHT: + case WEBGL2_UNPACK_SKIP_PIXELS: + case WEBGL2_UNPACK_SKIP_ROWS: + case WEBGL2_UNPACK_SKIP_IMAGES: + case WEBGL2_FRAGMENT_SHADER_DERIVATIVE_HINT: + case WEBGL2_READ_BUFFER: + case WEBGL2_DRAW_BUFFER0: + case WEBGL2_DRAW_BUFFER1: + case WEBGL2_DRAW_BUFFER2: + case WEBGL2_DRAW_BUFFER3: + case WEBGL2_DRAW_BUFFER4: + case WEBGL2_DRAW_BUFFER5: + case WEBGL2_DRAW_BUFFER6: + case WEBGL2_DRAW_BUFFER7: + case WEBGL2_DRAW_BUFFER8: + case WEBGL2_DRAW_BUFFER9: + case WEBGL2_DRAW_BUFFER10: + case WEBGL2_DRAW_BUFFER11: + case WEBGL2_DRAW_BUFFER12: + case WEBGL2_DRAW_BUFFER13: + case WEBGL2_DRAW_BUFFER14: + case WEBGL2_DRAW_BUFFER15: + case WEBGL2_UNIFORM_BUFFER_OFFSET_ALIGNMENT: { auto value = handle() ->getParameterV2(static_cast(pname)); From 30c98e828ecdca6273e9c2c97d7d0d0075d87198 Mon Sep 17 00:00:00 2001 From: yjh Date: Mon, 24 Nov 2025 11:44:29 +0800 Subject: [PATCH 3/3] 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