diff options
author | Jelle Raaijmakers <jelle@gmta.nl> | 2022-01-16 22:51:53 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-17 12:49:00 +0100 |
commit | 34a0f790a282c12d33404f243bc43c6320e7cbb4 (patch) | |
tree | 414f6f6fa207fc583aee45572473957e861f9a29 /Userland | |
parent | 11c807ebd1e0677bc93e6dc98123c9ca210b2cff (diff) | |
download | serenity-34a0f790a282c12d33404f243bc43c6320e7cbb4.zip |
LibGL: Use number of lights from stored device info
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibGL/SoftwareGLContext.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.cpp b/Userland/Libraries/LibGL/SoftwareGLContext.cpp index 0ca7b2f897..a387b456c3 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.cpp +++ b/Userland/Libraries/LibGL/SoftwareGLContext.cpp @@ -3249,7 +3249,7 @@ void SoftwareGLContext::gl_lightf(GLenum light, GLenum pname, GLfloat param) APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_lightf, light, pname, param); RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION); - RETURN_WITH_ERROR_IF(light < GL_LIGHT0 || light >= (GL_LIGHT0 + m_rasterizer.info().num_lights), GL_INVALID_ENUM); + RETURN_WITH_ERROR_IF(light < GL_LIGHT0 || light >= (GL_LIGHT0 + m_device_info.num_lights), GL_INVALID_ENUM); RETURN_WITH_ERROR_IF(!(pname == GL_CONSTANT_ATTENUATION || pname == GL_LINEAR_ATTENUATION || pname == GL_QUADRATIC_ATTENUATION || pname != GL_SPOT_EXPONENT || pname != GL_SPOT_CUTOFF), GL_INVALID_ENUM); auto& light_state = m_light_states.at(light - GL_LIGHT0); @@ -3281,7 +3281,7 @@ void SoftwareGLContext::gl_lightfv(GLenum light, GLenum pname, GLfloat const* pa { APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_lightfv, light, pname, params); RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION); - RETURN_WITH_ERROR_IF(light < GL_LIGHT0 || light >= (GL_LIGHT0 + m_rasterizer.info().num_lights), GL_INVALID_ENUM); + RETURN_WITH_ERROR_IF(light < GL_LIGHT0 || light >= (GL_LIGHT0 + m_device_info.num_lights), GL_INVALID_ENUM); RETURN_WITH_ERROR_IF(!(pname == GL_AMBIENT || pname == GL_DIFFUSE || pname == GL_SPECULAR || pname == GL_POSITION || pname == GL_CONSTANT_ATTENUATION || pname == GL_LINEAR_ATTENUATION || pname == GL_QUADRATIC_ATTENUATION || pname == GL_SPOT_CUTOFF || pname == GL_SPOT_EXPONENT || pname == GL_SPOT_DIRECTION), GL_INVALID_ENUM); auto& light_state = m_light_states.at(light - GL_LIGHT0); |