Commit graph

131 commits

Author SHA1 Message Date
Viktor Szépe
5cc371d54c LibWeb: Fix typos - act II 2025-04-09 15:05:20 +01:00
Luke Wilde
948349974c LibWeb/WebGL: Implement EXT_blend_minmax extension
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-04-07 23:21:11 +02:00
Andreas Kling
53da8893ac LibJS: Replace PropertyKey(char[]) with PropertyKey(FlyString)
...and deal with the fallout.
2025-03-24 22:27:17 +00:00
Luke Wilde
9ca25eed7f LibWeb/WebGL2: Implement EXT_color_buffer_float extension
This makes the Point Of Sale model on https://www.shopify.com/ have
colour instead of being completely black.
2025-03-06 12:59:28 +01:00
Luke Wilde
958938655d LibWeb/WebGL: Implement WEBGL_compressed_texture_s3tc extension 2025-02-09 01:00:51 +01:00
Luke Wilde
484008d440 LibWeb/WebGL: Implement compressedTex(Sub)Image2D 2025-02-09 01:00:51 +01:00
Luke Wilde
f1b81b1ae2 LibWeb/WebGL2: Implement getActiveUniforms 2025-02-09 01:00:51 +01:00
Luke Wilde
071a445015 LibWeb/WebGL2: Implement drawArraysInstanced 2025-02-09 01:00:51 +01:00
Luke Wilde
13f28cb941 LibWeb/WebGL: Reimplement OpenGLContext::clear_buffer_to_default_values
The implementation was removed with the migration to ANGLE. This
reimplements it. This is required by Stimulation Clicker on neal.fun,
which does not clear the framebuffer itself, instead relying on the
browser doing it.
2025-02-09 01:00:51 +01:00
Luke Wilde
f4649aa40d LibWeb/WebGL: Implement copyTexSubImage2D
Used by d3wasm for effects that use the current framebuffer as the
texture, such as screen wipes.
2025-01-28 19:01:40 +01:00
Luke Wilde
46f986bc2b LibWeb/WebGL: Implement copyTexImage2D
Used by d3wasm for effects that use the current framebuffer as the
texture, such as screen wipes.
2025-01-28 19:01:40 +01:00
Luke Wilde
915c36c366 LibWeb/WebGL: Map WebGL extensions to the required extensions
This is used to put together the list of supported WebGL extensions
based on the available extensions, per-extension required extensions
and WebGL version.
2025-01-21 21:36:05 +01:00
Luke Wilde
55f7cb4f10 LibWeb/WebGL: Implement WEBGL_draw_buffers extension 2025-01-21 21:36:05 +01:00
Luke Wilde
de77a5e3ea LibWeb/WebGL: Move extensions into their own folder 2025-01-21 21:36:05 +01:00
Luke Wilde
cfbd125e57 LibWeb/WebGL: Make getExtension spec-compliant
Namely:
- Perform case-insensitive matching
- Return the same extension objects every time
- Only enable the extension if it's supported by the current context
2025-01-21 21:36:05 +01:00
Luke Wilde
442f0b9a13 LibWeb/WebGL: Implement OES_vertex_array_object extension 2025-01-21 21:36:05 +01:00
Luke Wilde
58942e1137 LibWeb/WebGL: Request GL_ANGLE_instanced_arrays extension when required 2025-01-21 21:36:05 +01:00
Luke Wilde
1156fe483d LibWeb/WebGL: Tell ANGLE to create a WebGL compatible EGL context
This causes it to enforce the sections "Differences Between WebGL and
OpenGL ES 2.0" from the WebGL 1 specification and "Differences Between
WebGL and OpenGL ES 3.0" from the WebGL 2 specification. It also
disables a bunch of extensions by default, which we must now request
with glRequestExtensionANGLE.
2025-01-21 21:36:05 +01:00
Luke Wilde
4cb5a980e5 LibWeb/WebGL: Implement getAttachedShaders 2025-01-21 21:36:05 +01:00
Luke Wilde
aa99853a5c LibWeb/WebGL: Track the shaders attached to a program
This is required to return original references to the shaders attached
to a program from getAttachedShaders. This is required for Figma (and
likely all other Emscripten compiled applications that use WebGL) to
get it's own generated shader IDs from the shaders returned from
getAttachedShaders.
2025-01-21 21:36:05 +01:00
Timothy Flynn
a4324ee6e9 LibWeb: Remove the initialize_strings methods
We added these methods to propagate OOM errors at process startup, but
we longer fret about these tiny OOM failures. Requiring that these init
methods be called prohibits using these strings in processes that have
not set up a MainThreadVM. So let's just remove them and initialize the
strings in a sane manner.

In doing so, this also standardizes how we initialize strings whose C++
variable name differs from their string value. Instead of special-casing
these strings, we just include their string value in the x-macro list.
2025-01-12 00:35:58 +01:00
Luke Wilde
71746c47c2 LibWeb/WebGL: Bind default frame/render buffer when binding is null
This fixes the depth issues on github.com, as the depth commands are
now sent to the right frame/render buffer.
2025-01-08 17:55:17 +03:00
Luke Wilde
e5d59a2d42 LibWeb/WebGL2: Implement getSyncParameter 2025-01-08 17:55:17 +03:00
Luke Wilde
49c966b4e7 LibWeb/WebGL2: Implement uniform{1,2,3,4}ui 2025-01-08 17:55:17 +03:00
Luke Wilde
2f26ade426 LibWeb/WebGL2: Implement copyBufferSubData 2025-01-08 17:55:17 +03:00
Luke Wilde
db2d8f8f17 LibWeb/WebGL2: Implement bindBufferRange 2025-01-08 17:55:17 +03:00
Luke Wilde
c30c1d65f4 LibWeb/WebGL2: Implement clearBuffer{fv,iv,uiv,fi} 2025-01-08 17:55:17 +03:00
Luke Wilde
f627c91bf3 LibWeb/WebGL2: Implement deleteSampler 2025-01-08 17:55:17 +03:00
Luke Wilde
09ad685238 LibWeb/WebGL2: Implement samplerParameter{i,f} 2025-01-08 17:55:17 +03:00
Luke Wilde
42cce393f4 LibWeb/WebGL2: Implement drawElementsInstanced 2025-01-08 17:55:17 +03:00
Luke Wilde
c05fa44cf8 LibWeb/WebGL2: Implement vertexAttribDivisor 2025-01-08 17:55:17 +03:00
Luke Wilde
b6bc5912d6 LibWeb/WebGL: Implement tex(Sub)Image2D with TexImageSource 2025-01-08 17:55:17 +03:00
Luke Wilde
f66f01ce53 LibWeb/WebGL: Implement getUniformBlockIndex 2025-01-08 17:55:17 +03:00
Luke Wilde
216d5b33be LibWeb/WebGL: Enforce minimum size when resizing existing context
Previously the enforcement was only done on creation. Not enforcing it
on change would cause a crash if the canvas width/height was set to
zero or less.
2025-01-08 17:55:17 +03:00
Luke Wilde
8e453d5069 LibWeb/WebGL: Preserve original bound objects to return in getParameter
Required by https://qwasm2.m-h.org.uk, which adds a custom `name`
attribute to objects it generates. It then gets some of these objects
out with getParameter, and expects the `name` attribute to be there.
2025-01-08 17:55:17 +03:00
Luke Wilde
c067271897 LibWeb/WebGL2: Implement getActiveUniformBlockParameter 2025-01-08 17:55:17 +03:00
Luke Wilde
191ceb0f61 LibWeb/WebGL2: Implement getActiveUniformBlockName 2025-01-08 17:55:17 +03:00
Luke Wilde
7957793863 LibWeb/WebGL2: Implement uniformBlockBinding 2025-01-08 17:55:17 +03:00
Luke Wilde
28a73dc392 LibWeb/WebGL: Implement deleteRenderbuffer 2025-01-08 17:55:17 +03:00
Luke Wilde
e26b524721 LibWeb/WebGL2: Implement invalidateFramebuffer 2025-01-08 17:55:17 +03:00
Luke Wilde
63b792c205 LibWeb/WebGL2: Implement bufferSubData with offset and length 2025-01-08 17:55:17 +03:00
Luke Wilde
18ea91715b LibWeb/WebGL2: Implement bufferData with offset and length 2025-01-08 17:55:17 +03:00
Aliaksandr Kalenik
30d915c361 LibGfx+LibWeb: Specify bottom left origin for WebGL's PaintingSurface
By doing that we eliminate the need for the vertical flip flag.

As a side effect it fixes the bug when doing:
`canvasContext2d.drawImage(canvasWithWebGLContext, 0, 0);`
produced a flipped image because we didn't account for different origin
while serializing PaintingSurface into Gfx::Bitmap.

Visual progress on https://ciechanow.ski/curves-and-surfaces/
2024-12-20 20:47:45 +01:00
Aliaksandr Kalenik
c9105955f6 LibWeb/WebGL: Add support for ANGLEInstancedArrays extension
This is only WebGL 1.0 extension. It's enabled in ANGLE by default.

Progress on https://ciechanow.ski/curves-and-surfaces/ that relies on
this extension.
2024-12-20 15:31:58 +01:00
Aliaksandr Kalenik
07635d4554 LibWeb/WebGL: Set INVALID_OPERATION if object does not belong to context 2024-12-19 13:38:43 +01:00
Aliaksandr Kalenik
cf730870c5 LibWeb: Save WebGL context pointer in WebGLObject
This way we could be sure that context object won't be deallocated
before any of the objects that belong to it.

Having a context pointer is also going to be used in upcoming changes
to generate an INVALID_OPERATION error if an object does not belong to
the context it's being used in.
2024-12-19 13:38:43 +01:00
Luke Wilde
160c15444b LibWeb/WebGL2: Implement blitFramebuffer 2024-12-14 09:06:28 +01:00
Luke Wilde
4a4263d869 LibWeb/WebGL2: Implement readBuffer 2024-12-14 09:06:28 +01:00
Luke Wilde
db89b478ff LibWeb/WebGL2: Implement renderbufferStorageMultisample 2024-12-14 09:06:28 +01:00
Luke Wilde
8b07af9801 LibWeb/WebGL2: Implement bindBufferBase 2024-12-14 09:06:28 +01:00