Map renderer depth state to OpenGL

This commit is contained in:
2026-06-02 20:23:49 +02:00
parent 9b6c5b0849
commit 36f9e73dd4
5 changed files with 61 additions and 2 deletions

View File

@@ -733,6 +733,17 @@ OpenGlEnumMapping compare_function_for_renderer_compare_op(pp::renderer::Compare
}
}
OpenGlDepthState depth_state_for_renderer_depth_state(pp::renderer::DepthState state) noexcept
{
const auto compare_function = compare_function_for_renderer_compare_op(state.compare);
return OpenGlDepthState {
.test_enabled = state.test_enabled ? gl_boolean_true : gl_boolean_false,
.write_enabled = state.write_enabled ? gl_boolean_true : gl_boolean_false,
.compare_function = compare_function.value,
.supported = compare_function.supported,
};
}
std::uint32_t scissor_test_state() noexcept
{
return gl_scissor_test;