LibWeb/WebGL: Implement getShaderPrecisionFormat

This commit is contained in:
Luke Wilde 2024-12-05 15:14:44 +00:00 committed by Alexander Kalenik
commit bf2b8c5f2b
Notes: github-actions[bot] 2024-12-05 20:42:25 +00:00
8 changed files with 59 additions and 11 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
* Copyright (c) 2024, Luke Wilde <luke@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -327,6 +328,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
#include <LibWeb/WebGL/WebGLRenderbuffer.h>
#include <LibWeb/WebGL/WebGLRenderingContextImpl.h>
#include <LibWeb/WebGL/WebGLShader.h>
#include <LibWeb/WebGL/WebGLShaderPrecisionFormat.h>
#include <LibWeb/WebGL/WebGLTexture.h>
#include <LibWeb/WebGL/WebGLUniformLocation.h>
#include <LibWeb/WebIDL/Buffers.h>
@ -718,6 +720,16 @@ public:
continue;
}
if (function.name == "getShaderPrecisionFormat"sv) {
function_impl_generator.append(R"~~~(
GLint range[2];
GLint precision;
glGetShaderPrecisionFormat(shadertype, precisiontype, range, &precision);
return WebGLShaderPrecisionFormat::create(m_realm, range[0], range[1], precision);
)~~~");
continue;
}
if (function.name == "deleteBuffer"sv) {
function_impl_generator.append(R"~~~(
auto handle = buffer ? buffer->handle() : 0;