mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-13 21:12:26 +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
|
@ -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; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue