From 9bc70fa0d927ce16fd7be50b368f4cf23a8eb79c Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Tue, 7 Apr 2020 20:10:23 +0000 Subject: [PATCH] Bug 1627368 - allow requesting trilinear filtering in SWGL. r=jimb Differential Revision: https://phabricator.services.mozilla.com/D69897 --HG-- extra : moz-landing-system : lando --- gfx/wr/swgl/src/gl.cc | 6 ++++-- gfx/wr/swgl/src/swgl_fns.rs | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gfx/wr/swgl/src/gl.cc b/gfx/wr/swgl/src/gl.cc index 8d6628318b96..7855878bcef9 100644 --- a/gfx/wr/swgl/src/gl.cc +++ b/gfx/wr/swgl/src/gl.cc @@ -1379,6 +1379,10 @@ void TexImage3D(GLenum target, GLint level, GLint internal_format, TexSubImage3D(target, 0, 0, 0, 0, width, height, depth, format, ty, data); } +void GenerateMipmap(GLenum target) { + // TODO: support mipmaps +} + void TexParameteri(GLenum target, GLenum pname, GLint param) { Texture& t = ctx->textures[ctx->get_binding(target)]; switch (pname) { @@ -1389,11 +1393,9 @@ void TexParameteri(GLenum target, GLenum pname, GLint param) { assert(param == GL_CLAMP_TO_EDGE); break; case GL_TEXTURE_MIN_FILTER: - assert(param == GL_NEAREST || param == GL_LINEAR); t.min_filter = param; break; case GL_TEXTURE_MAG_FILTER: - assert(param == GL_NEAREST || param == GL_LINEAR); t.mag_filter = param; break; default: diff --git a/gfx/wr/swgl/src/swgl_fns.rs b/gfx/wr/swgl/src/swgl_fns.rs index 556884c8e59e..229c8ae50801 100644 --- a/gfx/wr/swgl/src/swgl_fns.rs +++ b/gfx/wr/swgl/src/swgl_fns.rs @@ -121,6 +121,7 @@ extern "C" { ty: GLenum, data: *const c_void, ); + fn GenerateMipmap(target: GLenum); fn GetUniformLocation(program: GLuint, name: *const GLchar) -> GLint; fn BindAttribLocation(program: GLuint, index: GLuint, name: *const GLchar); fn GetAttribLocation(program: GLuint, name: *const GLchar) -> GLint; @@ -2055,7 +2056,9 @@ impl Gl for Context { } fn generate_mipmap(&self, target: GLenum) { - panic!(); + unsafe { + GenerateMipmap(target); + } } fn insert_event_marker_ext(&self, message: &str) {