LibGL: Implement glFlush() and glFinish()

This commit is contained in:
Stephan Unverwerth 2021-05-14 21:47:25 +02:00 committed by Andreas Kling
parent 3429b44161
commit 2b9ad11bd8
Notes: sideshowbarker 2024-07-18 18:09:06 +09:00
5 changed files with 36 additions and 0 deletions

View file

@ -124,6 +124,8 @@ void glCallList(GLuint list);
void glDeleteLists(GLuint list, GLsizei range);
void glEndList(void);
void glNewList(GLuint list, GLenum mode);
void glFlush();
void glFinish();
#ifdef __cplusplus
}

View file

@ -47,6 +47,8 @@ public:
virtual void gl_delete_lists(GLuint list, GLsizei range) = 0;
virtual void gl_end_list(void) = 0;
virtual void gl_new_list(GLuint list, GLenum mode) = 0;
virtual void gl_flush() = 0;
virtual void gl_finish() = 0;
virtual void present() = 0;
};

View file

@ -59,3 +59,13 @@ GLenum glGetError()
{
return g_gl_context->gl_get_error();
}
void glFlush()
{
return g_gl_context->gl_flush();
}
void glFinish()
{
return g_gl_context->gl_finish();
}

View file

@ -839,6 +839,26 @@ void SoftwareGLContext::gl_new_list(GLuint list, GLenum mode)
m_current_listing_index = CurrentListing { {}, static_cast<size_t>(list - 1), mode };
}
void SoftwareGLContext::gl_flush()
{
if (m_in_draw_state) {
m_error = GL_INVALID_OPERATION;
return;
}
// No-op since SoftwareGLContext is completely synchronous at the moment
}
void SoftwareGLContext::gl_finish()
{
if (m_in_draw_state) {
m_error = GL_INVALID_OPERATION;
return;
}
// No-op since SoftwareGLContext is completely synchronous at the moment
}
void SoftwareGLContext::present()
{
m_rasterizer.blit_to(*m_frontbuffer);

View file

@ -53,6 +53,8 @@ public:
virtual void gl_delete_lists(GLuint list, GLsizei range) override;
virtual void gl_end_list(void) override;
virtual void gl_new_list(GLuint list, GLenum mode) override;
virtual void gl_flush() override;
virtual void gl_finish() override;
virtual void present() override;