mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:08:12 +00:00
LibSoftGPU: Remove OpenGL type for depth test func
Replaces the GLenum used in the RasterizerConfig for selecting the depth test function with out own enum.
This commit is contained in:
parent
33e601800c
commit
74ed7713fa
3 changed files with 50 additions and 10 deletions
|
@ -2130,7 +2130,36 @@ void SoftwareGLContext::gl_depth_func(GLenum func)
|
|||
GL_INVALID_ENUM);
|
||||
|
||||
auto options = m_rasterizer.options();
|
||||
options.depth_func = func;
|
||||
|
||||
switch (func) {
|
||||
case GL_NEVER:
|
||||
options.depth_func = SoftGPU::DepthTestFunction::Never;
|
||||
break;
|
||||
case GL_ALWAYS:
|
||||
options.depth_func = SoftGPU::DepthTestFunction::Always;
|
||||
break;
|
||||
case GL_LESS:
|
||||
options.depth_func = SoftGPU::DepthTestFunction::Less;
|
||||
break;
|
||||
case GL_LEQUAL:
|
||||
options.depth_func = SoftGPU::DepthTestFunction::LessOrEqual;
|
||||
break;
|
||||
case GL_EQUAL:
|
||||
options.depth_func = SoftGPU::DepthTestFunction::Equal;
|
||||
break;
|
||||
case GL_NOTEQUAL:
|
||||
options.depth_func = SoftGPU::DepthTestFunction::NotEqual;
|
||||
break;
|
||||
case GL_GEQUAL:
|
||||
options.depth_func = SoftGPU::DepthTestFunction::GreaterOrEqual;
|
||||
break;
|
||||
case GL_GREATER:
|
||||
options.depth_func = SoftGPU::DepthTestFunction::Greater;
|
||||
break;
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
m_rasterizer.set_options(options);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue