Map renderer depth state to OpenGL
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -46,6 +46,13 @@ struct OpenGlColorWriteMask {
|
||||
std::uint8_t a = 0;
|
||||
};
|
||||
|
||||
struct OpenGlDepthState {
|
||||
std::uint8_t test_enabled = 0;
|
||||
std::uint8_t write_enabled = 0;
|
||||
std::uint32_t compare_function = 0;
|
||||
bool supported = false;
|
||||
};
|
||||
|
||||
struct OpenGlReadbackFormat {
|
||||
std::uint32_t pixel_format = 0;
|
||||
std::uint32_t component_type = 0;
|
||||
@@ -149,6 +156,8 @@ struct OpenGlWindowsWglContextConfig {
|
||||
[[nodiscard]] std::uint32_t depth_test_state() noexcept;
|
||||
[[nodiscard]] OpenGlEnumMapping compare_function_for_renderer_compare_op(
|
||||
pp::renderer::CompareOp op) noexcept;
|
||||
[[nodiscard]] OpenGlDepthState depth_state_for_renderer_depth_state(
|
||||
pp::renderer::DepthState state) noexcept;
|
||||
[[nodiscard]] std::uint32_t scissor_test_state() noexcept;
|
||||
[[nodiscard]] std::uint32_t program_point_size_state() noexcept;
|
||||
[[nodiscard]] std::uint32_t line_smooth_state() noexcept;
|
||||
|
||||
Reference in New Issue
Block a user