Skip to content

Commit 3d2874b

Browse files
Lubrsigmta
authored andcommitted
LibWeb/WebGL2: Implement invalidateSubFramebuffer
1 parent b949c8e commit 3d2874b

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Libraries/LibWeb/WebGL/WebGL2RenderingContextBase.idl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ interface mixin WebGL2RenderingContextBase {
298298
undefined blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
299299
undefined framebufferTextureLayer(GLenum target, GLenum attachment, WebGLTexture? texture, GLint level, GLint layer);
300300
undefined invalidateFramebuffer(GLenum target, sequence<GLenum> attachments);
301-
[FIXME] undefined invalidateSubFramebuffer(GLenum target, sequence<GLenum> attachments, GLint x, GLint y, GLsizei width, GLsizei height);
301+
undefined invalidateSubFramebuffer(GLenum target, sequence<GLenum> attachments, GLint x, GLint y, GLsizei width, GLsizei height);
302302
undefined readBuffer(GLenum src);
303303

304304
// Renderbuffer objects

Libraries/LibWeb/WebGL/WebGL2RenderingContextImpl.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ void WebGL2RenderingContextImpl::invalidate_framebuffer(WebIDL::UnsignedLong tar
101101
needs_to_present();
102102
}
103103

104+
void WebGL2RenderingContextImpl::invalidate_sub_framebuffer(WebIDL::UnsignedLong target, Vector<WebIDL::UnsignedLong> attachments, WebIDL::Long x, WebIDL::Long y, WebIDL::Long width, WebIDL::Long height)
105+
{
106+
m_context->make_current();
107+
m_context->notify_content_will_change();
108+
109+
glInvalidateSubFramebuffer(target, attachments.size(), attachments.data(), x, y, width, height);
110+
needs_to_present();
111+
}
112+
104113
void WebGL2RenderingContextImpl::read_buffer(WebIDL::UnsignedLong src)
105114
{
106115
m_context->make_current();

Libraries/LibWeb/WebGL/WebGL2RenderingContextImpl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class WebGL2RenderingContextImpl : public WebGLRenderingContextBase {
3232
void blit_framebuffer(WebIDL::Long src_x0, WebIDL::Long src_y0, WebIDL::Long src_x1, WebIDL::Long src_y1, WebIDL::Long dst_x0, WebIDL::Long dst_y0, WebIDL::Long dst_x1, WebIDL::Long dst_y1, WebIDL::UnsignedLong mask, WebIDL::UnsignedLong filter);
3333
void framebuffer_texture_layer(WebIDL::UnsignedLong target, WebIDL::UnsignedLong attachment, GC::Root<WebGLTexture> texture, WebIDL::Long level, WebIDL::Long layer);
3434
void invalidate_framebuffer(WebIDL::UnsignedLong target, Vector<WebIDL::UnsignedLong> attachments);
35+
void invalidate_sub_framebuffer(WebIDL::UnsignedLong target, Vector<WebIDL::UnsignedLong> attachments, WebIDL::Long x, WebIDL::Long y, WebIDL::Long width, WebIDL::Long height);
3536
void read_buffer(WebIDL::UnsignedLong src);
3637
JS::Value get_internalformat_parameter(WebIDL::UnsignedLong target, WebIDL::UnsignedLong internalformat, WebIDL::UnsignedLong pname);
3738
void renderbuffer_storage_multisample(WebIDL::UnsignedLong target, WebIDL::Long samples, WebIDL::UnsignedLong internalformat, WebIDL::Long width, WebIDL::Long height);

0 commit comments

Comments
 (0)