mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 03:26:10 +00:00
LibGL: Return white texel when sampling uninitialized texture
This commit is contained in:
parent
894d81c1b8
commit
59998ff0b2
Notes:
sideshowbarker
2024-07-18 05:30:26 +09:00
Author: https://github.com/sunverwerth
Commit: 59998ff0b2
Pull-request: https://github.com/SerenityOS/serenity/pull/9451
Reviewed-by: https://github.com/Quaker762 ✅
Reviewed-by: https://github.com/alimpfard
2 changed files with 5 additions and 2 deletions
|
@ -42,8 +42,8 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
GLsizei m_width;
|
||||
GLsizei m_height;
|
||||
GLsizei m_width { 0 };
|
||||
GLsizei m_height { 0 };
|
||||
Vector<u32> m_pixel_data;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -57,6 +57,9 @@ FloatVector4 Sampler2D::sample(FloatVector2 const& uv) const
|
|||
|
||||
MipMap const& mip = m_texture.mipmap(lod);
|
||||
|
||||
if (mip.width() < 1 || mip.height() < 1)
|
||||
return { 1, 1, 1, 1 };
|
||||
|
||||
float x = wrap(uv.x(), m_wrap_t_mode);
|
||||
float y = wrap(uv.y(), m_wrap_s_mode);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue