mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +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:
parent
65cda8e4aa
commit
bccfa205d3
Notes:
sideshowbarker
2024-07-17 22:57:18 +09:00
Author: https://github.com/gmta
Commit: bccfa205d3
Pull-request: https://github.com/SerenityOS/serenity/pull/11108
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/sunverwerth ✅
2 changed files with 7 additions and 10 deletions
|
@ -36,7 +36,6 @@ void Texture2D::replace_sub_texture_data(GLuint lod, GLint xoffset, GLint yoffse
|
|||
|
||||
// FIXME: We currently only support GL_UNSIGNED_BYTE pixel data
|
||||
VERIFY(type == GL_UNSIGNED_BYTE);
|
||||
VERIFY(lod < m_mipmaps.size());
|
||||
VERIFY(xoffset >= 0 && yoffset >= 0 && xoffset + width <= mip.width() && yoffset + height <= mip.height());
|
||||
VERIFY(pixels_per_row == 0 || pixels_per_row >= xoffset + width);
|
||||
|
||||
|
@ -111,12 +110,4 @@ void Texture2D::replace_sub_texture_data(GLuint lod, GLint xoffset, GLint yoffse
|
|||
}
|
||||
}
|
||||
|
||||
MipMap const& Texture2D::mipmap(unsigned lod) const
|
||||
{
|
||||
if (lod >= m_mipmaps.size())
|
||||
return m_mipmaps.back();
|
||||
|
||||
return m_mipmaps.at(lod);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue