SIMD optimizations

Started by
2 comments, last by Charmander 23 years, 11 months ago
I remember I read somewhere that for SIMD to work properly, each vertex should have 3 floats (or maybe a multiple of 3 flaots ... not so sure). So how do you achieve that in direct3D where you probably have to specify at least one set of texture co-ordinate in the vertex format?
Advertisement
SIMD stands for Single Instruction, Multiple Data. It is just another way of threating data. Intel implemented this in their MMX (integer only) and ISSE (floating point)extension, AMD does this in MMX and 3DNow!

Now, what makes the SIMD instruction set so useful for 3D transforms (and lighting)? The fact that you can (amongst other things) do 4 floating point multiplies (4x32-bit float) in one instruction. Thus, when multiplying a 4-element vector with a 4x4 matrix, you can do a single row (1 coordinate) in one instruction, instead of 4. Thus, if you give only vertex data, the SIMD instruction set will already do it''s job.

For you, it means that you should just use D3D''s transform and lighting stage, and not worry about it. Should you want to write your own T&L stage, I recommend reading some docs about the ISSE instruction set. Intel has a few good interactive tutorials online.

DaBit.

SIMD stands for Single Instruction, Multiple Data. It is just another way of threating data. Intel implemented this in their MMX (integer only) and ISSE (floating point)extension, AMD does this in MMX and 3DNow!

Now, what makes the SIMD instruction set so useful for 3D transforms (and lighting)? The fact that you can (amongst other things) do 4 floating point multiplies (4x32-bit float) in one instruction. Thus, when multiplying a 4-element vector with a 4x4 matrix, you can do a single row (1 coordinate) in one instruction, instead of 4. Thus, if you give only vertex data, the SIMD instruction set will already do it''s job.

For you, it means that you should just use D3D''s transform and lighting stage, and not worry about it. Should you want to write your own T&L stage, I recommend reading some docs about the ISSE instruction set. Intel has a few good interactive tutorials online.

DaBit.

I see. Thank you

This topic is closed to new replies.

Advertisement