mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibGL+LibSoftGPU: Use more expressive is_power_of_two
This commit is contained in:
parent
971b39ae4f
commit
7004b20656
Notes:
sideshowbarker
2024-07-17 18:23:28 +09:00
Author: https://github.com/gmta
Commit: 7004b20656
Pull-request: https://github.com/SerenityOS/serenity/pull/12695
Reviewed-by: https://github.com/Quaker762 ✅
Reviewed-by: https://github.com/linusg ✅
Reviewed-by: https://github.com/sunverwerth ✅
2 changed files with 5 additions and 10 deletions
|
@ -971,8 +971,8 @@ void SoftwareGLContext::gl_tex_image_2d(GLenum target, GLint level, GLint intern
|
|||
RETURN_WITH_ERROR_IF(width < 0 || height < 0 || width > (2 + Texture2D::MAX_TEXTURE_SIZE) || height > (2 + Texture2D::MAX_TEXTURE_SIZE), GL_INVALID_VALUE);
|
||||
// Check if width and height are a power of 2
|
||||
if (!m_device_info.supports_npot_textures) {
|
||||
RETURN_WITH_ERROR_IF((width & (width - 1)) != 0, GL_INVALID_VALUE);
|
||||
RETURN_WITH_ERROR_IF((height & (height - 1)) != 0, GL_INVALID_VALUE);
|
||||
RETURN_WITH_ERROR_IF(!is_power_of_two(width), GL_INVALID_VALUE);
|
||||
RETURN_WITH_ERROR_IF(!is_power_of_two(height), GL_INVALID_VALUE);
|
||||
}
|
||||
RETURN_WITH_ERROR_IF(border != 0, GL_INVALID_VALUE);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue