mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +00:00
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.
This commit is contained in:
parent
3ab93667f5
commit
aa99853a5c
Notes:
github-actions[bot]
2025-01-21 20:38:32 +00:00
Author: https://github.com/Lubrsi
Commit: aa99853a5c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3239
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/kalenikaliaksandr
5 changed files with 86 additions and 9 deletions
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||||
* Copyright (c) 2024, Luke Wilde <luke@ladybird.org>
|
||||
* Copyright (c) 2024-2025, Luke Wilde <luke@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -22,10 +22,21 @@ public:
|
|||
|
||||
virtual ~WebGLProgram();
|
||||
|
||||
GC::Ptr<WebGLShader> attached_vertex_shader() const { return m_attached_fragment_shader; }
|
||||
void set_attached_vertex_shader(GC::Ptr<WebGLShader> shader) { m_attached_vertex_shader = shader; }
|
||||
|
||||
GC::Ptr<WebGLShader> attached_fragment_shader() const { return m_attached_fragment_shader; }
|
||||
void set_attached_fragment_shader(GC::Ptr<WebGLShader> shader) { m_attached_fragment_shader = shader; }
|
||||
|
||||
protected:
|
||||
explicit WebGLProgram(JS::Realm&, WebGLRenderingContextBase&, GLuint handle);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(JS::Cell::Visitor&) override;
|
||||
|
||||
private:
|
||||
GC::Ptr<WebGLShader> m_attached_vertex_shader;
|
||||
GC::Ptr<WebGLShader> m_attached_fragment_shader;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue