mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibGL: Add stubs for shader and program related functions
This commit is contained in:
parent
75495a5d65
commit
4568dcbb55
Notes:
sideshowbarker
2024-07-17 03:02:42 +09:00
Author: https://github.com/sunverwerth Commit: https://github.com/SerenityOS/serenity/commit/4568dcbb55 Pull-request: https://github.com/SerenityOS/serenity/pull/16225 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/gmta ✅ Reviewed-by: https://github.com/supercomputer7
5 changed files with 123 additions and 0 deletions
|
@ -10,6 +10,7 @@ set(SOURCES
|
|||
List.cpp
|
||||
Matrix.cpp
|
||||
NameAllocator.cpp
|
||||
Shader.cpp
|
||||
Stencil.cpp
|
||||
Tex/Texture2D.cpp
|
||||
Texture.cpp
|
||||
|
|
|
@ -813,6 +813,16 @@ GLAPI void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, void
|
|||
GLAPI void glDeleteBuffers(GLsizei n, GLuint const* buffers);
|
||||
GLAPI void glGenBuffers(GLsizei n, GLuint* buffers);
|
||||
|
||||
GLAPI GLuint glCreateShader(GLenum shader_type);
|
||||
GLAPI void glDeleteShader(GLuint shader);
|
||||
GLAPI void glShaderSource(GLuint shader, GLsizei count, GLchar const** string, GLint const* length);
|
||||
GLAPI void glCompileShader(GLuint shader);
|
||||
|
||||
GLAPI GLuint glCreateProgram();
|
||||
GLAPI void glDeleteProgram(GLuint program);
|
||||
GLAPI void glAttachShader(GLuint program, GLuint shader);
|
||||
GLAPI void glLinkProgram(GLuint program);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -62,6 +62,11 @@ void glArrayElement(GLint i)
|
|||
g_gl_context->gl_array_element(i);
|
||||
}
|
||||
|
||||
void glAttachShader(GLuint program, GLuint shader)
|
||||
{
|
||||
g_gl_context->gl_attach_shader(program, shader);
|
||||
}
|
||||
|
||||
void glBegin(GLenum mode)
|
||||
{
|
||||
g_gl_context->gl_begin(mode);
|
||||
|
@ -226,6 +231,11 @@ void glColorPointer(GLint size, GLenum type, GLsizei stride, void const* pointer
|
|||
g_gl_context->gl_color_pointer(size, type, stride, pointer);
|
||||
}
|
||||
|
||||
void glCompileShader(GLuint shader)
|
||||
{
|
||||
g_gl_context->gl_compile_shader(shader);
|
||||
}
|
||||
|
||||
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
|
||||
{
|
||||
g_gl_context->gl_copy_tex_image_2d(target, level, internalformat, x, y, width, height, border);
|
||||
|
@ -236,6 +246,16 @@ void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffse
|
|||
g_gl_context->gl_copy_tex_sub_image_2d(target, level, xoffset, yoffset, x, y, width, height);
|
||||
}
|
||||
|
||||
GLuint glCreateProgram()
|
||||
{
|
||||
return g_gl_context->gl_create_program();
|
||||
}
|
||||
|
||||
GLuint glCreateShader(GLenum shader_type)
|
||||
{
|
||||
return g_gl_context->gl_create_shader(shader_type);
|
||||
}
|
||||
|
||||
void glCullFace(GLenum mode)
|
||||
{
|
||||
g_gl_context->gl_cull_face(mode);
|
||||
|
@ -266,6 +286,16 @@ void glDeleteLists(GLuint list, GLsizei range)
|
|||
return g_gl_context->gl_delete_lists(list, range);
|
||||
}
|
||||
|
||||
void glDeleteProgram(GLuint program)
|
||||
{
|
||||
g_gl_context->gl_delete_program(program);
|
||||
}
|
||||
|
||||
void glDeleteShader(GLuint shader)
|
||||
{
|
||||
g_gl_context->gl_delete_shader(shader);
|
||||
}
|
||||
|
||||
void glDeleteTextures(GLsizei n, GLuint const* textures)
|
||||
{
|
||||
g_gl_context->gl_delete_textures(n, textures);
|
||||
|
@ -563,6 +593,11 @@ void glLineWidth(GLfloat width)
|
|||
g_gl_context->gl_line_width(width);
|
||||
}
|
||||
|
||||
void glLinkProgram(GLuint program)
|
||||
{
|
||||
g_gl_context->gl_link_program(program);
|
||||
}
|
||||
|
||||
void glListBase(GLuint base)
|
||||
{
|
||||
return g_gl_context->gl_list_base(base);
|
||||
|
@ -841,6 +876,11 @@ void glShadeModel(GLenum mode)
|
|||
g_gl_context->gl_shade_model(mode);
|
||||
}
|
||||
|
||||
void glShaderSource(GLuint shader, GLsizei count, GLchar const** string, GLint const* length)
|
||||
{
|
||||
g_gl_context->gl_shader_source(shader, count, string, length);
|
||||
}
|
||||
|
||||
void glStencilFunc(GLenum func, GLint ref, GLuint mask)
|
||||
{
|
||||
g_gl_context->gl_stencil_func_separate(GL_FRONT_AND_BACK, func, ref, mask);
|
||||
|
|
|
@ -228,6 +228,16 @@ public:
|
|||
void gl_delete_buffers(GLsizei n, GLuint const* buffers);
|
||||
void gl_gen_buffers(GLsizei n, GLuint* buffers);
|
||||
|
||||
GLuint gl_create_shader(GLenum shader_type);
|
||||
void gl_delete_shader(GLuint shader);
|
||||
void gl_shader_source(GLuint shader, GLsizei count, GLchar const** string, GLint const* length);
|
||||
void gl_compile_shader(GLuint shader);
|
||||
|
||||
GLuint gl_create_program();
|
||||
void gl_delete_program(GLuint program);
|
||||
void gl_attach_shader(GLuint program, GLuint shader);
|
||||
void gl_link_program(GLuint program);
|
||||
|
||||
private:
|
||||
void sync_device_config();
|
||||
void sync_device_sampler_config();
|
||||
|
|
62
Userland/Libraries/LibGL/Shader.cpp
Normal file
62
Userland/Libraries/LibGL/Shader.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/Debug.h>
|
||||
#include <LibGL/GLContext.h>
|
||||
|
||||
namespace GL {
|
||||
|
||||
GLuint GLContext::gl_create_shader(GLenum shader_type)
|
||||
{
|
||||
dbgln("gl_create_shader({}) unimplemented ", shader_type);
|
||||
TODO();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void GLContext::gl_delete_shader(GLuint shader)
|
||||
{
|
||||
dbgln("gl_delete_shader({}) unimplemented ", shader);
|
||||
TODO();
|
||||
}
|
||||
|
||||
void GLContext::gl_shader_source(GLuint shader, GLsizei count, GLchar const** string, GLint const* length)
|
||||
{
|
||||
dbgln("gl_shader_source({}, {}, {#x}, {#x}) unimplemented ", shader, count, string, length);
|
||||
TODO();
|
||||
}
|
||||
|
||||
void GLContext::gl_compile_shader(GLuint shader)
|
||||
{
|
||||
dbgln("gl_compile_shader({}) unimplemented ", shader);
|
||||
TODO();
|
||||
}
|
||||
|
||||
GLuint GLContext::gl_create_program()
|
||||
{
|
||||
dbgln("gl_create_program() unimplemented ");
|
||||
TODO();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void GLContext::gl_delete_program(GLuint program)
|
||||
{
|
||||
dbgln("gl_delete_program({}) unimplemented ", program);
|
||||
TODO();
|
||||
}
|
||||
|
||||
void GLContext::gl_attach_shader(GLuint program, GLuint shader)
|
||||
{
|
||||
dbgln("gl_attach_shader({}, {}) unimplemented ", program, shader);
|
||||
TODO();
|
||||
}
|
||||
|
||||
void GLContext::gl_link_program(GLuint program)
|
||||
{
|
||||
dbgln("gl_link_program({}) unimplemented ", program);
|
||||
TODO();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue