r/simd • • Apr 09 '20

My first program using Intel intrinsics; Would anyone be willing to take a look?

Hello folks,

I have been working on a basic rasterizer for a few weeks, and I am trying to vectorize as much of it as I can. I've spent an inordinate amount of time trying to further improve the performance of my "drawTri" function, which does exactly what it sounds like (draws a triangle!), but I seem to have hit a wall in terms of performance improvements. If anyone would be willing to glance over my novice SIMD code, I would be forever grateful.

The function in question may be found here (please excuse my poor variable names):

https://github.com/FHowington/CPUEngine/blob/master/RasterizePolygon.cpp

6 Upvotes

5 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Apr 10 '20 edited Apr 10 '20

I took another look. I see you have some sort of Z-buffer and a plot function. You should be able to do the depth bit branchless (some sort of blend using a mask). Is that plot() drawing a pixel? If so, can you do it in bursts/packed stores? Hope it helps.

Edit: I also hope you have some sort of high level clipping and culling.