[Mesa-dev] new i965g pipe driver for Intel GEN6 (and later)

Chia-I Wu olvaffe at gmail.com
Tue Apr 16 23:20:57 PDT 2013


On Wed, Apr 17, 2013 at 8:09 AM, Marek Olšák <maraeo at gmail.com> wrote:
> On Tue, Apr 16, 2013 at 9:58 PM, Chia-I Wu <olvaffe at gmail.com> wrote:
>>
>> On Wed, Apr 17, 2013 at 12:58 AM, Matt Turner <mattst88 at gmail.com> wrote:
>>>
>>> I think everything Marek said was correct. If you could extend Gallium
>>> to consume GLSL IR it might actually be an interesting project.
>>
>> Yes, it is.  I do want to make pipe drivers be able to express the preferred IR and make the mesa state tracker generate it.  I had LLVM IR in mind, but GLSL IR could be a much less intrusive choice.  I will check that out.
>
> Actually, there is even a better option. You don't have to fork the
> compiler, you can add source files from src/mesa/drivers/dri/i965 to
> your gallium driver. We have done this before. r300g did not have its
> own compiler for a couple of *years*. The compiler lived in r300c in
> src/mesa/drivers/dri/r300/compiler and it was more or less a separate
> library (it did not depend on gl_context). If r300g was enabled, the
> build system also compiled files in the r300 compiler directory and
> the linker included them in the .so file. r300g also used (and still
> uses) the register allocator from src/mesa/program, which is also used
> by i965.
One thing I want to do next in i965g is to make shader compilation and
complied shaders opaque for the rest of the driver.  That would make
the code cleaner, and make it easy to switch to different compilers.
It seems the compiler in i965 makes some use of brw_context, but that
is mainly to get hardware capabilities.  It should be possible to make
it more library-like or to fork it for i965g.

How hard would it be to make GLSL IR an alternative IR for pipe
drivers?  On the driver side, it seems I only need to add
PIPE_SHADER_IR_GLSL for the preferred IR and change the type of tokens
to void *.  On the st/mesa side, could I simply skip GLSL-to-TGSI
pass?  Maybe also disable API_OPENGL_COMPAT?

>
> Feel free to use the same approach. It was a big win for us.
>
> Marek



--
olv at LunarG.com


More information about the mesa-dev mailing list