mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/WebGL: Implement the EXT_texture_filter_anisotropic extension
This commit is contained in:
parent
d08915a0cd
commit
b15f4424f9
Notes:
github-actions[bot]
2025-10-20 13:34:39 +00:00
Author: https://github.com/Lubrsi
Commit: b15f4424f9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6521
Reviewed-by: https://github.com/gmta ✅
13 changed files with 166 additions and 2 deletions
|
|
@ -8,6 +8,7 @@
|
|||
#define GL_GLEXT_PROTOTYPES 1
|
||||
#include <GLES3/gl3.h>
|
||||
extern "C" {
|
||||
#include <GLES2/gl2ext.h>
|
||||
#include <GLES2/gl2ext_angle.h>
|
||||
}
|
||||
|
||||
|
|
@ -394,6 +395,13 @@ void WebGL2RenderingContextImpl::sampler_parameteri(GC::Root<WebGLSampler> sampl
|
|||
case GL_TEXTURE_WRAP_S:
|
||||
case GL_TEXTURE_WRAP_T:
|
||||
break;
|
||||
case GL_TEXTURE_MAX_ANISOTROPY_EXT: {
|
||||
if (ext_texture_filter_anisotropic_extension_enabled())
|
||||
break;
|
||||
|
||||
set_error(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
dbgln("Unknown WebGL sampler parameter name: 0x{:04x}", pname);
|
||||
set_error(GL_INVALID_ENUM);
|
||||
|
|
@ -427,6 +435,13 @@ void WebGL2RenderingContextImpl::sampler_parameterf(GC::Root<WebGLSampler> sampl
|
|||
case GL_TEXTURE_WRAP_S:
|
||||
case GL_TEXTURE_WRAP_T:
|
||||
break;
|
||||
case GL_TEXTURE_MAX_ANISOTROPY_EXT: {
|
||||
if (ext_texture_filter_anisotropic_extension_enabled())
|
||||
break;
|
||||
|
||||
set_error(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
dbgln("Unknown WebGL sampler parameter name: 0x{:04x}", pname);
|
||||
set_error(GL_INVALID_ENUM);
|
||||
|
|
@ -2571,6 +2586,16 @@ JS::Value WebGL2RenderingContextImpl::get_parameter(WebIDL::UnsignedLong pname)
|
|||
glGetInteger64vRobustANGLE(GL_MAX_SERVER_WAIT_TIMEOUT, 1, nullptr, &result);
|
||||
return JS::Value(static_cast<double>(result));
|
||||
}
|
||||
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: {
|
||||
if (ext_texture_filter_anisotropic_extension_enabled()) {
|
||||
GLfloat result { 0.0f };
|
||||
glGetFloatvRobustANGLE(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, 1, nullptr, &result);
|
||||
return JS::Value(result);
|
||||
}
|
||||
|
||||
set_error(GL_INVALID_ENUM);
|
||||
return JS::js_null();
|
||||
}
|
||||
default:
|
||||
dbgln("Unknown WebGL parameter name: {:x}", pname);
|
||||
set_error(GL_INVALID_ENUM);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue