1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

LibGL: Improve mipmap lookup in Texture2D

We can get rid of a `VERIFY` since we already do this in `Array::at()`.
Also move `::mipmap()` to the header file so it is inlined in
`Sampler2D`.
This commit is contained in:
Jelle Raaijmakers 2021-11-29 12:56:55 +01:00 committed by Andreas Kling
parent 65cda8e4aa
commit bccfa205d3
2 changed files with 7 additions and 10 deletions

View file

@ -38,7 +38,13 @@ public:
void upload_texture_data(GLuint lod, GLint internal_format, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels, GLsizei pixels_per_row, u8 byte_alignment);
void replace_sub_texture_data(GLuint lod, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels, GLsizei pixels_per_row, u8 byte_alignment);
MipMap const& mipmap(unsigned lod) const;
MipMap const& mipmap(unsigned lod) const
{
if (lod >= m_mipmaps.size())
return m_mipmaps.back();
return m_mipmaps.at(lod);
}
GLenum internal_format() const { return m_internal_format; }
Sampler2D const& sampler() const { return m_sampler; }