On 7 September 2017 at 18:36, Kyle Brenneman <[email protected]> wrote:
> On 09/07/2017 10:03 AM, Emil Velikov wrote:
>>
>> From: Emil Velikov <[email protected]>
>>
>> Instead of having three, almost identical but not quite,
>> _eglDebugReport* functions, simply fold them into one.
>>
>> While doing so drop the unnecessary arguments 'command' and
>> 'objectLabel'. Former is identical to funcName, while the latter is
>> already stored (yet unused) in _EGLThreadInfo::CurrentObjectLabel.
>>
>> Cc: Kyle Brenneman <[email protected]>
>> Cc: Adam Jackson <[email protected]>
>> Signed-off-by: Emil Velikov <[email protected]>
>> ---
>>   src/egl/main/eglapi.c     |  3 +--
>>   src/egl/main/eglcurrent.c | 53
>> ++++++++++++-----------------------------------
>>   src/egl/main/eglcurrent.h |  7 -------
>>   3 files changed, 14 insertions(+), 49 deletions(-)
>>
>
> The command and funcName parameters aren't always identical. funcName is
> whatever string got passed to _eglError, which is often the name of some
> internal function. For instance, eglCreateWindowSurface can call _eglError
> with the string "_eglCreateWindowSurfaceCommon". A lot of the calls in the
> src/egl/drivers/ directory also use internal function names.
>
> I had both the command and fullName parameters in order to preserve the
> existing error reporting behavior (in _eglInternalError) in addition to the
> debug callback.
>
> Also, the reason I kept the command parameter at all instead of always using
> thr->CurrentFuncName is so that _eglSetFuncName could correctly report an
> EGL_BAD_ALLOC error if it couldn't allocate the _EGLThreadInfo struct in the
> first place. In that case, (thr->CurrentFuncName) would be NULL.
>
> You could change _eglError to pass NULL for the command name, in which case
> the debug callback would get the correct name in all cases, but then you'd
> lose the internal function name that would otherwise get passed to _eglLog.

I agree on the _eglError front - it is a bit iffy, as described in 3/4 [1].
At the same time I cannot find an instance where there will be a difference.

Can you point me to one?

Thanks
Emil

[1] https://patchwork.freedesktop.org/patch/175581/
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to