As mentioned in the previous commit message, we can't create an RBO out
of an NV12 buffer in GL ES2.0. Instead, we render in 2 passes to 2
separate RBOs.
This could be made more generic by having a lookup table for the
parameters that need to be set for each plane for any given format, but
as of yet, I see no practical reason for implementing any other kind of
YCbCr target buffer rendering as NV12 seems to be the only format that's
commonly supported by hardware video encoders.
Signed-off-by: Andri Yngvason <andri@yngvason.is>
Rendering to NV12 buffers is not directly supported in GL ES2.0, but can
be implemented by rendering in 2 passes to 2 different EGL images.
This change makes provisions for multiple EGL images inside a
wlr_gles2_buffer and adds a special case for mapping NV12 buffers to
multiple EGL images.
Signed-off-by: Andri Yngvason <andri@yngvason.is>
Stop trying to maintain a per-file _POSIX_C_SOURCE. Instead,
require POSIX.1-2008 globally. A lot of core source files depend
on that already.
Some care must be taken on a few select files where we need a bit
more than POSIX. Some files need XSI extensions (_XOPEN_SOURCE) and
some files need BSD extensions (_DEFAULT_SOURCE). In both cases,
these feature test macros imply _POSIX_C_SOURCE. Make sure to not
define both these macros and _POSIX_C_SOURCE explicitly to avoid
POSIX requirement conflicts (e.g. _POSIX_C_SOURCE says POSIX.1-2001
but _XOPEN_SOURCE says POSIX.1-2008).
Additionally, there is one special case in render/vulkan/vulkan.c.
That file needs major()/minor(), and these are system-specific.
On FreeBSD, _POSIX_C_SOURCE hides system-specific symbols so we need
to make sure it's not defined for this file. On Linux, we can
explicitly include <sys/sysmacros.h> and ensure that apart from
symbols defined there the file only uses POSIX toys.
Not needs set GL_DEPTH_TEST, Because when rendering to a framebuffer
that has no depth buffer, depth testing always behaves as though
the test is disabled, The initial value for each capability with
the exception of GL_DITHER is GL_FALSE.