mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
egl: Implement EGL_EXT_config_select_group
It allows us to influence the order of EGL configs for arbitrary reasons, which will be used in the following commit. Based on a patch by Freya Gentz <zegentzy@protonmail.com>, see https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2376 Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: David Heidelberg <david.heidelberg@collabora.com> Signed-off-by: Robert Mader <robert.mader@posteo.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9989>
This commit is contained in:
parent
8b6b327d1b
commit
0d90415625
5 changed files with 15 additions and 0 deletions
|
|
@ -790,6 +790,8 @@ dri2_setup_screen(_EGLDisplay *disp)
|
|||
disp->Extensions.KHR_gl_colorspace = EGL_TRUE;
|
||||
}
|
||||
|
||||
disp->Extensions.EXT_config_select_group = EGL_TRUE;
|
||||
|
||||
disp->Extensions.EXT_create_context_robustness =
|
||||
get_screen_param(disp, PIPE_CAP_DEVICE_RESET_STATUS_QUERY);
|
||||
disp->RobustBufferAccess =
|
||||
|
|
|
|||
|
|
@ -547,6 +547,7 @@ _eglCreateExtensionsString(_EGLDisplay *disp)
|
|||
_EGL_CHECK_EXTENSION(ANGLE_sync_control_rate);
|
||||
|
||||
_EGL_CHECK_EXTENSION(EXT_buffer_age);
|
||||
_EGL_CHECK_EXTENSION(EXT_config_select_group);
|
||||
_EGL_CHECK_EXTENSION(EXT_create_context_robustness);
|
||||
_EGL_CHECK_EXTENSION(EXT_image_dma_buf_import);
|
||||
_EGL_CHECK_EXTENSION(EXT_image_dma_buf_import_modifiers);
|
||||
|
|
|
|||
|
|
@ -249,6 +249,9 @@ static const struct {
|
|||
{ EGL_COLOR_COMPONENT_TYPE_EXT, ATTRIB_TYPE_ENUM,
|
||||
ATTRIB_CRITERION_EXACT,
|
||||
EGL_COLOR_COMPONENT_TYPE_FIXED_EXT },
|
||||
{ EGL_CONFIG_SELECT_GROUP_EXT, ATTRIB_TYPE_INTEGER,
|
||||
ATTRIB_CRITERION_IGNORE,
|
||||
0 },
|
||||
/* clang-format on */
|
||||
};
|
||||
|
||||
|
|
@ -287,6 +290,8 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
|
|||
if (val > 1 || val < 0)
|
||||
valid = EGL_FALSE;
|
||||
break;
|
||||
case EGL_CONFIG_SELECT_GROUP_EXT:
|
||||
break;
|
||||
default:
|
||||
if (val < 0)
|
||||
valid = EGL_FALSE;
|
||||
|
|
@ -587,6 +592,10 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
|
|||
if (conf1 == conf2)
|
||||
return 0;
|
||||
|
||||
val1 = conf1->ConfigSelectGroup - conf2->ConfigSelectGroup;
|
||||
if (val1)
|
||||
return val1;
|
||||
|
||||
/* the enum values have the desired ordering */
|
||||
STATIC_ASSERT(EGL_NONE < EGL_SLOW_CONFIG);
|
||||
STATIC_ASSERT(EGL_SLOW_CONFIG < EGL_NON_CONFORMANT_CONFIG);
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ struct _egl_config {
|
|||
EGLint FramebufferTargetAndroid;
|
||||
EGLint RecordableAndroid;
|
||||
EGLint ComponentType;
|
||||
EGLint ConfigSelectGroup;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -135,6 +136,7 @@ _eglOffsetOfConfig(EGLint attr)
|
|||
ATTRIB_MAP(EGL_FRAMEBUFFER_TARGET_ANDROID, FramebufferTargetAndroid);
|
||||
ATTRIB_MAP(EGL_RECORDABLE_ANDROID, RecordableAndroid);
|
||||
ATTRIB_MAP(EGL_COLOR_COMPONENT_TYPE_EXT, ComponentType);
|
||||
ATTRIB_MAP(EGL_CONFIG_SELECT_GROUP_EXT, ConfigSelectGroup);
|
||||
#undef ATTRIB_MAP
|
||||
default:
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ struct _egl_extensions {
|
|||
EGLBoolean CHROMIUM_sync_control;
|
||||
|
||||
EGLBoolean EXT_buffer_age;
|
||||
EGLBoolean EXT_config_select_group;
|
||||
EGLBoolean EXT_create_context_robustness;
|
||||
EGLBoolean EXT_image_dma_buf_import;
|
||||
EGLBoolean EXT_image_dma_buf_import_modifiers;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue