[Mesa-dev] [PATCH 09/26] glapi: Generate GL API marshalling code from the XML.

Marek Olšák maraeo at gmail.com
Fri Feb 10 14:31:57 UTC 2017


On Fri, Feb 10, 2017 at 3:23 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> On 10.02.2017 15:01, Nicolai Hähnle wrote:
>>
>> On 08.02.2017 19:03, Marek Olšák wrote:
>>>
>>> From: Paul Berry <stereotype441 at gmail.com>
>>>
>>> This is not yet used in the build, just generated.
>>>
>>> v2: Add missing build dependencies.
>>> v3: Avoid mixing declarations and code, remove logic for avoiding
>>> emitting
>>>     code that the compiler's optimizer can deal with anyway.
>>
>>
>> For the unmarshalling, have you considered simply generating a function
>> pointer table indexed by DISPATCH_CMD_*?
>>
>> gcc transforms the giant switch into a jump table anyway, I suspect the
>> compiler will generate a jump table anyway, but ends up having an
>> additional call indirection (call _mesa_unmarshal_dispatch_cmd + call
>> actual unmarshal function).
>
>
> Never mind, this would only be interesting for commands with custom
> unmarshaling, and there are probably quite few of those.

Mesa with glthread might spend more time in the umarshalling code than
in the Mesa/Gallium code, so a lot of optimizations will be necessary
there to make the dispatch more efficient at least for lower latency
if not for performance.

Marek


More information about the mesa-dev mailing list