[Mesa-dev] [PATCH] i965: Move brw_cs_fill_local_id_payload() to libi965_compiler
Jason Ekstrand
jason at jlekstrand.net
Fri Dec 11 12:22:03 PST 2015
On Fri, Dec 11, 2015 at 12:17 PM, Jordan Justen
<jordan.l.justen at intel.com> wrote:
> On 2015-12-11 11:58:41, Matt Turner wrote:
>> On Fri, Dec 11, 2015 at 11:22 AM, Kristian Høgsberg Kristensen
>> <krh at bitplanet.net> wrote:
>> > This is a helper function for setting up the local invocation ID
>> > payload according to the cs_prog_data generated by the compiler. It's
>> > intended to be available to users of libi965_compiler so move it there.
>>
>> I moved this to brw_cs.c (from brw_fs.cpp) in commit 6ba700c because
>> its lack of extern "C" decoration on the function definition caused
>> undefined references when I cleaned up the #includes. I didn't
>> particularly like moving C code into C++ files willy-nilly, and it's
>> because of problems like that, and really -- when it's a C function
>> and is only called from C, why are we making it C++...?
That seems like a reasonable reason for the move.
> It is related to the C++ used to generated code by the compiler for
> accessing the CS local IDs, but it is called from C based state setup
> code.
>
> From that perspective, it is nice to have it near the code gen.
>
>>
>> Can we find a better spot than this, and we can stop undoing each
>> others' patches? :)
>
> Is the interface to libi965_compiler all C based? Maybe we could make
> a separate file for the C based interface to this library?
I'd be ok with adding another file. We could add just a
brw_compiler.c file. I've been wanting to move brw_compiler_create
out of brw_shader.cpp anyway, so maybe now is a good time to do that?
--Jason
More information about the mesa-dev
mailing list