LibWeb/WebGL: Implement deleteTexture

This commit is contained in:
Luke Wilde 2024-12-05 13:19:29 +00:00 committed by Alexander Kalenik
parent 7b0c067f4d
commit 111c4495d9
Notes: github-actions[bot] 2024-12-05 20:42:43 +00:00
2 changed files with 9 additions and 1 deletions

View file

@ -82,7 +82,7 @@ interface mixin WebGLRenderingContextBase {
undefined deleteProgram(WebGLProgram? program);
[FIXME] undefined deleteRenderbuffer(WebGLRenderbuffer? renderbuffer);
undefined deleteShader(WebGLShader? shader);
[FIXME] undefined deleteTexture(WebGLTexture? texture);
undefined deleteTexture(WebGLTexture? texture);
undefined depthFunc(GLenum func);
undefined depthMask(GLboolean flag);

View file

@ -726,6 +726,14 @@ public:
continue;
}
if (function.name == "deleteTexture"sv) {
function_impl_generator.append(R"~~~(
auto handle = texture ? texture->handle() : 0;
glDeleteTextures(1, &handle);
)~~~");
continue;
}
Vector<ByteString> gl_call_arguments;
for (size_t i = 0; i < function.parameters.size(); ++i) {
auto const& parameter = function.parameters[i];