HLSL Compiler and d3dcompiler_xx.dll

Charles Davis cdavis at mymail.mines.edu
Wed Apr 14 11:56:17 CDT 2010


On 4/14/10 10:36 AM, Reece Dunn wrote:
> On 14 April 2010 16:19, Matijn Woudt <tijnema at gmail.com> wrote:
>> I have thought about using LLVM, but I don't like it because of:
>> 1) Having another wine dependency (~40MB for me on ubuntu)
>> 2) Code generated by LLVM will most likely not generated exactly the
>> same bytecode as native compiler does, even though the shader has same
>> effect on both. This makes it really hard to verify the HLSL compiler
>> is working. My idea was to make wine's hlsl compiler produce exactly
>> the same bytecode as native does. We might even find bugs in the
>> native compiler, and either fix or duplicate these bugs.
>>
>> LLVM might be useful if we needed a really fast compiler, but native
>> compiler isn't really fast AFAIK. Once games are calling it a few
>> hundred times it might be worth the effort.
> 
> My understanding was that LLVM is written in C++, so cannot be used
> directly in Wine (which only allows C89 code).
> 
> Therefore, for it to be usable in Wine, the LLVM API will need to be
> wrapped in a C API.
But LLVM *is* wrapped in a C API. (The headers are in include/llvm-c
from the LLVM source root.)

The real problem is that if we use LLVM, we'll have to write a backend
to generate shader bytecode, and LLVM backends have to be written in C++
(actually, you write description files that get turned into C++ code).
Personally, I think that should be a separate project anyway.

Chip



More information about the wine-devel mailing list