[PATCH 5/5] d3dcompiler: Implement basic expressions parsing.

Stefan Dösinger stefandoesinger at gmx.at
Tue Jul 17 06:03:59 CDT 2012


Am Montag, 16. Juli 2012, 20:39:23 schrieb Matteo Bruni:
> +    HLSL_IR_BINOP_MUL,
> ...
> +    HLSL_IR_BINOP_DOT,
HLSL has 3 somewhat related multiplication operations: "*", "mul" and "dot". 
Dot is fairly straightforward, but "*" and "mul" have subtle differences. I 
recommend to write tests to find out the exact details, but as far as I 
remember "float4 * float4" gives you a float4 with a component-wise 
multiplication, whereas mul(float, float) returns a scalar like the dot 
product. "float4x4 * float4" is an error, but mul(float4x4, float4) performs a 
matrix-vector multiplication and returns a float4.

> +static struct hlsl_type *expr_common_type(struct hlsl_type *t1, struct
> hlsl_type *t2,
> +        struct source_location *loc)
This type inference system might be a bit too limited, you have to take the 
operation into account. e.g. a dot(float3, float4) returns a scalar and 
crs(float4, float4) returns a float3.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20120717/1e8d3798/attachment.pgp>


More information about the wine-devel mailing list