-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
WebGL2: support TexImage3D #37718
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
WebGL2: support TexImage3D #37718
Conversation
🔨 Triggering try run (#15900805398) for Linux (WPT) |
T 8000 est results for linux-wpt from try job (#15900805398): Flaky unexpected result (21)
Stable unexpected results that are known to be intermittent (22)
Stable unexpected results (35)
|
|
🔨 Triggering try run (#15917993593) for Linux (WPT) |
Test results for linux-wpt from try job (#15917993593): Flaky unexpected result (17)
Stable unexpected results that are known to be intermittent (20)
Stable unexpected results (17)
|
|
fn TexImage3D( | ||
&self, | ||
target: u32, | ||
level: i32, | ||
internal_format: i32, | ||
width: i32, | ||
height: i32, | ||
depth: i32, | ||
border: i32, | ||
format: u32, | ||
type_: u32, | ||
src_data: CustomAutoRooterGuard<Option<ArrayBufferView>>, | ||
) -> Fallible<()> { |
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.
When implementing texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView srcData, unsigned long long srcOffset)
we will just move all code there and call it from here.
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.
I think we are missing:
If UNPACK_FLIP_Y_WEBGL or UNPACK_PREMULTIPLY_ALPHA_WEBGL is set to true, texImage3D and texSubImage3D generate an INVALID_OPERATION error if they upload data from a PIXEL_UNPACK_BUFFER or a non-null client side ArrayBufferView.
https://registry.khronos.org/webgl/specs/latest/2.0/#PIXEL_STORE_PARAM_CONSTRAINTS
I did my best as I could, but I do not feel very confident giving reviews to webgl code, everything is so scattered around and is hard to follow (and the spec ain't any better), so maybe just improvement in test scores is enough here? Anyway, I will let others take shots at this.
@sagudev Thanks for the review! I saw that checks and TexImage2D also has this check but Servo didn't added it. So I kind of unsure if I should do so as well. I tried to add some TODO for those checks that are not implemented yet. I tried to limit the scope of this PR, but it still ends up hundreds LOC. I'll add these TODO to the tracking issue. Edit: try run successful with updated commit |
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
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.
Looking good!
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
🔨 Triggering try run (#16166886962) for Linux (WPT) |
Test results for linux-wpt from try job (#16166886962): Flaky unexpected result (16)
Stable unexpected results that are known to be intermittent (20)
Stable unexpected results (1)
|
|
{"fail_fast": false, "matrix": [{"name": "Linux (WPT)", "workflow": "linux", "wpt": true, "profile": "release", "unit_tests": false, "build_libservo": false, "bencher": false, "build_args": "", "wpt_args": "./tests/wpt/tests/webdriver/tests/classic/ --product servodriver --headless", "number_of_wpt_chunks": 1}]}
{"fail_fast": false, "matrix": [{"name": "Linux (WPT)", "workflow": "linux", "wpt": true, "profile": "release", "unit_tests": false, "build_libservo": false, "bencher": false, "build_args": "", "wpt_args": "./tests/wpt/tests/webdriver/tests/classic/ --product servodriver --headless", "number_of_wpt_chunks": 1}]}
Add TexImage3D method to WebGL2RenderingContext
Testing: conformance2 should pass. Also it should get http://webglsamples.org/WebGL2Samples/#texture_2d_array and http://webglsamples.org/WebGL2Samples/#texture_3d running.
Fixes: #26511
Now Servo can run texture_2d_array and texture_3d samples!


And it can now run three.js too!
