[PATCH 2/7] glamor: glObjectLabel is not defined in GLES2

Maarten Lankhorst maarten.lankhorst at ubuntu.com
Thu Jan 15 05:11:09 PST 2015


Op 13-01-15 om 08:35 schreef Maarten Lankhorst:
> Hey,
>
> On 13-01-15 03:40, Eric Anholt wrote:
>> Maarten Lankhorst <maarten.lankhorst at ubuntu.com> writes:
>>
>>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at ubuntu.com>
>>> ---
>>>  glamor/glamor_core.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c
>>> index 737b274..4eaf8ac 100644
>>> --- a/glamor/glamor_core.c
>>> +++ b/glamor/glamor_core.c
>>> @@ -102,7 +102,8 @@ glamor_link_glsl_prog(ScreenPtr screen, GLint prog, const char *format, ...)
>>>          FatalError("GLSL link failure\n");
>>>      }
>>>  
>>> -    if (glamor_priv->has_khr_debug) {
>>> +    if (glamor_priv->has_khr_debug &&
>>> +        (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP)) {
>>>          char *label;
>>>          va_list va;
>> On ES2, glObjectLabelKHR() should exist instead of glObjectLabel(), and
>> epoxy should be aliasing the two.  We should fix epoxy if it's not
>> working.
> I was getting a null pointer dereference here in libepoxy 1.2, how can I check if it's working as it should?
>
Oh right it seems libepoxy is the problem here, it doesn't seem to distinguish between glObjectLabel
and glObjectLabelKHR correctly. Take a look at the generated code for glObjectLabel and glObjectLabelKHR:

static PFNGLOBJECTLABELPROC
epoxy_glObjectLabel_resolver(void)
{
    static const enum gl_provider providers[] = {
        GL_extension_GL_KHR_debug,
        Desktop_OpenGL_4_3,
        GL_extension_GL_KHR_debug,
        gl_provider_terminator
    };
    static const uint16_t entrypoints[] = {
        33201 /* "glObjectLabel" */,
        33201 /* "glObjectLabel" */,
        33215 /* "glObjectLabelKHR" */,
    };
    return gl_provider_resolver(entrypoint_strings + 33201 /* "glObjectLabel" */,
                                providers, entrypoints);
}

static PFNGLOBJECTLABELKHRPROC
epoxy_glObjectLabelKHR_resolver(void)
{
    static const enum gl_provider providers[] = {
        GL_extension_GL_KHR_debug,
        GL_extension_GL_KHR_debug,
        Desktop_OpenGL_4_3,
        gl_provider_terminator
    };
    static const uint16_t entrypoints[] = {
        33215 /* "glObjectLabelKHR" */,
        33201 /* "glObjectLabel" */,
        33201 /* "glObjectLabel" */,
    };
    return gl_provider_resolver(entrypoint_strings + 33215 /* "glObjectLabelKHR" */,
                                providers, entrypoints);
}

Could you fix this bug and make the extensions distinguish between GLES2 and desktop opengl for the entrypoints?

~Maarten



More information about the xorg-devel mailing list