From f627c91bf3aa7540f679924e384152c639c16d6b Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Fri, 27 Dec 2024 13:25:34 +0000 Subject: [PATCH] LibWeb/WebGL2: Implement deleteSampler --- Libraries/LibWeb/WebGL/WebGL2RenderingContextBase.idl | 2 +- .../LibWeb/GenerateWebGLRenderingContext.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Libraries/LibWeb/WebGL/WebGL2RenderingContextBase.idl b/Libraries/LibWeb/WebGL/WebGL2RenderingContextBase.idl index 424082b763e..586ee45c83e 100644 --- a/Libraries/LibWeb/WebGL/WebGL2RenderingContextBase.idl +++ b/Libraries/LibWeb/WebGL/WebGL2RenderingContextBase.idl @@ -388,7 +388,7 @@ interface mixin WebGL2RenderingContextBase { // Sampler Objects WebGLSampler createSampler(); - [FIXME] undefined deleteSampler(WebGLSampler? sampler); + undefined deleteSampler(WebGLSampler? sampler); [FIXME] GLboolean isSampler(WebGLSampler? sampler); // [WebGLHandlesContextLoss] undefined bindSampler(GLuint unit, WebGLSampler? sampler); undefined samplerParameteri(WebGLSampler sampler, GLenum pname, GLint param); diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWebGLRenderingContext.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWebGLRenderingContext.cpp index c21b901ccd4..62e182c69b4 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWebGLRenderingContext.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWebGLRenderingContext.cpp @@ -1288,6 +1288,14 @@ public: continue; } + if (function.name == "deleteSampler"sv) { + generate_webgl_object_handle_unwrap(function_impl_generator, "sampler"sv, ""sv); + function_impl_generator.append(R"~~~( + glDeleteSamplers(1, &sampler_handle); +)~~~"); + continue; + } + if (function.name == "bindBuffer"sv) { // FIXME: Implement Buffer Object Binding restrictions. generate_webgl_object_handle_unwrap(function_impl_generator, "buffer"sv, ""sv);