Move readback format mapping to renderer gl
This commit is contained in:
@@ -123,6 +123,32 @@ OpenGlPixelFormat texture_format_for_channel_count(std::uint32_t channel_count)
|
||||
}
|
||||
}
|
||||
|
||||
OpenGlReadbackFormat rgba8_readback_format() noexcept
|
||||
{
|
||||
return OpenGlReadbackFormat {
|
||||
.pixel_format = gl_rgba,
|
||||
.component_type = gl_unsigned_byte,
|
||||
.bytes_per_pixel = 4U,
|
||||
};
|
||||
}
|
||||
|
||||
OpenGlReadbackFormat rgba32f_readback_format() noexcept
|
||||
{
|
||||
return OpenGlReadbackFormat {
|
||||
.pixel_format = gl_rgba,
|
||||
.component_type = gl_float,
|
||||
.bytes_per_pixel = 16U,
|
||||
};
|
||||
}
|
||||
|
||||
std::uint64_t readback_byte_count(
|
||||
OpenGlReadbackFormat format,
|
||||
std::uint32_t width,
|
||||
std::uint32_t height) noexcept
|
||||
{
|
||||
return static_cast<std::uint64_t>(width) * height * format.bytes_per_pixel;
|
||||
}
|
||||
|
||||
const char* framebuffer_status_name(std::uint32_t status) noexcept
|
||||
{
|
||||
switch (status) {
|
||||
|
||||
Reference in New Issue
Block a user