struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
- int depth, EGLint surface_type, const EGLint *attr_list)
+ int depth, EGLint surface_type, const EGLint *attr_list,
+ const unsigned int *rgba_masks)
{
struct dri2_egl_config *conf;
struct dri2_egl_display *dri2_dpy;
_EGLConfig base;
unsigned int attrib, value, double_buffer;
EGLint key, bind_to_texture_rgb, bind_to_texture_rgba;
+ unsigned int dri_masks[4] = { 0, 0, 0, 0 };
_EGLConfig *matching_config;
EGLint num_configs = 0;
EGLint config_id;
double_buffer = value;
break;
+ case __DRI_ATTRIB_RED_MASK:
+ dri_masks[0] = value;
+ break;
+
+ case __DRI_ATTRIB_GREEN_MASK:
+ dri_masks[1] = value;
+ break;
+
+ case __DRI_ATTRIB_BLUE_MASK:
+ dri_masks[2] = value;
+ break;
+
+ case __DRI_ATTRIB_ALPHA_MASK:
+ dri_masks[3] = value;
+ break;
+
default:
key = dri2_to_egl_attribute_map[attrib];
if (key != 0)
if (depth > 0 && depth != base.BufferSize)
return NULL;
+ if (rgba_masks && memcmp(rgba_masks, dri_masks, sizeof(dri_masks)))
+ return NULL;
+
base.NativeRenderable = EGL_TRUE;
base.SurfaceType = surface_type;
struct dri2_egl_config *
dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
- int depth, EGLint surface_type, const EGLint *attr_list);
+ int depth, EGLint surface_type, const EGLint *attr_list,
+ const unsigned int *rgba_masks);
_EGLImage *
dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
for (i = 0; dri2_dpy->driver_configs[i]; i++)
dri2_add_config(disp, dri2_dpy->driver_configs[i],
- i + 1, 0, 0, NULL);
+ i + 1, 0, 0, NULL, NULL);
drv->API.CreateImageKHR = dri2_drm_create_image_khr;
for (i = 0; dri2_dpy->driver_configs[i]; i++)
dri2_add_config(disp, dri2_dpy->driver_configs[i], i + 1, 0,
- EGL_WINDOW_BIT | EGL_PIXMAP_BIT, NULL);
+ EGL_WINDOW_BIT | EGL_PIXMAP_BIT, NULL, NULL);
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
config_attrs[3] = visuals[i]._class;
dri2_add_config(disp, dri2_dpy->driver_configs[j], id++,
- d.data->depth, surface_type, config_attrs);
+ d.data->depth, surface_type, config_attrs, NULL);
}
}