mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:17:35 +00:00
LibGL: Return white texel when sampling uninitialized texture
This commit is contained in:
parent
894d81c1b8
commit
59998ff0b2
2 changed files with 5 additions and 2 deletions
|
@ -42,8 +42,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GLsizei m_width;
|
GLsizei m_width { 0 };
|
||||||
GLsizei m_height;
|
GLsizei m_height { 0 };
|
||||||
Vector<u32> m_pixel_data;
|
Vector<u32> m_pixel_data;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,9 @@ FloatVector4 Sampler2D::sample(FloatVector2 const& uv) const
|
||||||
|
|
||||||
MipMap const& mip = m_texture.mipmap(lod);
|
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 x = wrap(uv.x(), m_wrap_t_mode);
|
||||||
float y = wrap(uv.y(), m_wrap_s_mode);
|
float y = wrap(uv.y(), m_wrap_s_mode);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue