One thing about Jakub's patch is that, on x86, it eliminates the need for the specialized _ts_* versions of the dispatch functions. It basically converts the DISPATCH macro (as used in src/mesa/main/dispatch.c) from:

#define DISPATCH(FUNC, ARGS, MESSAGE) \
        (_glapi_Dispatch->FUNC) ARGS

to:

#define DISPATCH(FUNC, ARGS, MESSAGE)                           \
        const struct _glapi_table * d = _glapi_Dispatch;        \
        if ( __builtin_expect( d == NULL, 0 ) )                 \
                d = get_dispatch();                             \
        (d->FUNC) ARGS

There is some extra cost in the non-threaded case, but it seems very minimal. In the x86 assembly case, it's only a test and a conditional branch that is usually not taken. Does this seem like a reasonable change to make across the board?




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
--
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to