Skip to content

Commit

Permalink
src/egl: always pass format modifiers, remove libdrm dependency
Browse files Browse the repository at this point in the history
DRM_FORMAT_MOD_INVALID means implicit modifiers in this case, so pass them.
Fixes #26
  • Loading branch information
Ferdi265 committed Oct 26, 2023
1 parent 3143b97 commit da90373
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/egl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <GLES2/gl2ext.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <libdrm/drm_fourcc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -482,12 +481,9 @@ bool dmabuf_to_texture(ctx_t * ctx, dmabuf_t * dmabuf) {
image_attribs[i++] = stride_attribs[j];
image_attribs[i++] = dmabuf->strides[j];
image_attribs[i++] = modifier_low_attribs[j];

if (dmabuf->modifiers[j] != DRM_FORMAT_MOD_INVALID) {
image_attribs[i++] = (uint32_t)dmabuf->modifiers[j];
image_attribs[i++] = modifier_high_attribs[j];
image_attribs[i++] = (uint32_t)(dmabuf->modifiers[j] >> 32);
}
image_attribs[i++] = (uint32_t)dmabuf->modifiers[j];
image_attribs[i++] = modifier_high_attribs[j];
image_attribs[i++] = (uint32_t)(dmabuf->modifiers[j] >> 32);
}

image_attribs[i++] = EGL_NONE;
Expand Down

0 comments on commit da90373

Please sign in to comment.