Map render pass clear masks to OpenGL
This commit is contained in:
@@ -106,6 +106,7 @@ constexpr std::uint32_t gl_framebuffer_undefined = 0x8219U;
|
||||
constexpr std::uint32_t gl_framebuffer_incomplete_multisample = 0x8D56U;
|
||||
constexpr std::uint32_t gl_color_buffer_bit = 0x00004000U;
|
||||
constexpr std::uint32_t gl_depth_buffer_bit = 0x00000100U;
|
||||
constexpr std::uint32_t gl_stencil_buffer_bit = 0x00000400U;
|
||||
constexpr std::uint32_t gl_color_writemask = 0x0C23U;
|
||||
constexpr std::uint32_t gl_texture_cube_map = 0x8513U;
|
||||
constexpr std::uint32_t gl_texture_cube_map_positive_x = 0x8515U;
|
||||
@@ -465,6 +466,29 @@ std::uint32_t framebuffer_depth_buffer_mask() noexcept
|
||||
return gl_depth_buffer_bit;
|
||||
}
|
||||
|
||||
std::uint32_t framebuffer_stencil_buffer_mask() noexcept
|
||||
{
|
||||
return gl_stencil_buffer_bit;
|
||||
}
|
||||
|
||||
std::uint32_t clear_mask_for_render_pass(pp::renderer::RenderPassDesc desc) noexcept
|
||||
{
|
||||
std::uint32_t mask = 0U;
|
||||
if (desc.clear_color_enabled) {
|
||||
mask |= gl_color_buffer_bit;
|
||||
}
|
||||
|
||||
if (desc.clear_depth_enabled) {
|
||||
mask |= gl_depth_buffer_bit;
|
||||
}
|
||||
|
||||
if (desc.clear_stencil_enabled) {
|
||||
mask |= gl_stencil_buffer_bit;
|
||||
}
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
std::uint32_t color_write_mask_query() noexcept
|
||||
{
|
||||
return gl_color_writemask;
|
||||
|
||||
@@ -105,6 +105,9 @@ struct OpenGlWindowsWglContextConfig {
|
||||
[[nodiscard]] const char* framebuffer_status_name(std::uint32_t status) noexcept;
|
||||
[[nodiscard]] std::uint32_t framebuffer_color_buffer_mask() noexcept;
|
||||
[[nodiscard]] std::uint32_t framebuffer_depth_buffer_mask() noexcept;
|
||||
[[nodiscard]] std::uint32_t framebuffer_stencil_buffer_mask() noexcept;
|
||||
[[nodiscard]] std::uint32_t clear_mask_for_render_pass(
|
||||
pp::renderer::RenderPassDesc desc) noexcept;
|
||||
[[nodiscard]] std::uint32_t color_write_mask_query() noexcept;
|
||||
[[nodiscard]] std::uint32_t framebuffer_blit_filter(bool linear) noexcept;
|
||||
[[nodiscard]] OpenGlEnumMapping blit_filter_for_renderer_filter(
|
||||
|
||||
Reference in New Issue
Block a user