summaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2017-02-21 15:39:40 -0500
committerRob Clark <robdclark@gmail.com>2017-02-21 15:39:40 -0500
commit3e78eabeeeeb8476583cf2d37f1bd561307694db (patch)
tree95b519bd94cb268bbbb89a81ed0f8385f0cefe98 /common.h
parentf639c63a366d34e7d98facd58d0855f9e1ab1d66 (diff)
downloadkmscube-3e78eabeeeeb8476583cf2d37f1bd561307694db.tar.gz
add yuv/rgb tex mode
Diffstat (limited to 'common.h')
-rw-r--r--common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/common.h b/common.h
index 0e537ac..ee1aa54 100644
--- a/common.h
+++ b/common.h
@@ -31,6 +31,7 @@
#include <EGL/eglext.h>
#include <gbm.h>
+#include <drm/drm_fourcc.h>
#define GL_GLEXT_PROTOTYPES 1
#include <GLES2/gl2.h>
@@ -54,6 +55,9 @@ struct egl {
EGLSurface surface;
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT;
+ PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
+ PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
+ PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES;
void (*draw)(unsigned i);
};
@@ -62,7 +66,14 @@ int init_egl(struct egl *egl, const struct gbm *gbm);
int create_program(const char *vs_src, const char *fs_src);
int link_program(unsigned program);
+enum mode {
+ SMOOTH, /* smooth-shaded */
+ RGBA, /* single-plane RGBA */
+ NV12_2IMG, /* NV12, handled as two textures and converted to RGB in shader */
+ NV12_1IMG, /* NV12, imported as planar YUV eglimg */
+};
const struct egl * init_cube_smooth(const struct gbm *gbm);
+const struct egl * init_cube_tex(const struct gbm *gbm, enum mode mode);
#endif /* _COMMON_H */