Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Charmander

SIMD optimizations

This topic is 6925 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!