1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:57:34 +00:00

LibGL+LibGPU+LibSoftGPU: Implement and expose glClipPlane

This commit implements glClipPlane and its supporting calls, backed
by new support for user-defined clip planes in the software GPU clipper.

This fixes some visual bugs seen in the Quake III port, in which mirrors
would only reflect correctly from close distances.
This commit is contained in:
RKBethke 2022-05-06 09:40:55 +00:00 committed by Linus Groh
parent bc2f738a84
commit 0836912a6d
14 changed files with 193 additions and 63 deletions

View file

@ -197,6 +197,7 @@ public:
void gl_get_light(GLenum light, GLenum pname, void* params, GLenum type);
void gl_get_material(GLenum face, GLenum pname, void* params, GLenum type);
void gl_clip_plane(GLenum plane, GLdouble const* equation);
void gl_get_clip_plane(GLenum plane, GLdouble* equation);
void gl_array_element(GLint i);
void gl_copy_tex_sub_image_2d(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
void gl_point_size(GLfloat size);
@ -207,6 +208,7 @@ private:
void sync_device_texcoord_config();
void sync_light_state();
void sync_stencil_configuration();
void sync_clip_planes();
void build_extension_string();
@ -307,6 +309,13 @@ private:
GLenum m_current_read_buffer = GL_BACK;
GLenum m_current_draw_buffer = GL_BACK;
// User-defined clip planes
struct ClipPlaneAttributes {
Array<FloatVector4, 6> eye_clip_plane; // TODO: Change to use device-defined constant
GLuint enabled { 0 };
} m_clip_plane_attributes;
bool m_clip_planes_dirty { true };
// Client side arrays
bool m_client_side_vertex_array_enabled { false };
bool m_client_side_color_array_enabled { false };