API Call |
Average number of Cycles |
SetVertexDeclaration |
6500 - 11250 |
SetFVF |
6400 - 11200 |
SetVertexShader |
3000 - 12100 |
SetPixelShader |
6300 - 7000 |
SPECULARENABLE |
1900 - 11200 |
SetRenderTarget |
6000 - 6250 |
SetPixelShaderConstant (1 Constant) |
1500 - 9000 |
NORMALIZENORMALS |
2200 - 8100 |
LightEnable |
1300 - 9000 |
SetStreamSource |
3700 - 5800 |
LIGHTING |
1700 - 7500 |
DIFFUSEMATERIALSOURCE |
900 - 8300 |
AMBIENTMATERIALSOURCE |
900 - 8200 |
COLORVERTEX |
800 - 7800 |
SetLight |
2200 - 5100 |
SetTransform |
3200 - 3750 |
SetIndices |
900 - 5600 |
AMBIENT |
1150 - 4800 |
SetTexture |
2500 - 3100 |
SPECULARMATERIALSOURCE |
900 - 4600 |
EMISSIVEMATERIALSOURCE |
900 - 4500 |
SetMaterial |
1000 - 3700 |
ZENABLE |
700 - 3900 |
WRAP0 |
1600 - 2700 |
MINFILTER |
1700 - 2500 |
MAGFILTER |
1700 - 2400 |
SetVertexShaderConstant (1 Constant) |
1000 - 2700 |
COLOROP |
1500 - 2100 |
COLORARG2 |
1300 - 2000 |
COLORARG1 |
1300 - 1980 |
CULLMODE |
500 - 2570 |
CLIPPING |
500 - 2550 |
DrawIndexedPrimitive |
1200 - 1400 |
ADDRESSV |
1090 - 1500 |
ADDRESSU |
1070 - 1500 |
DrawPrimitive |
1050 - 1150 |
SRGBTEXTURE |
150 - 1500 |
STENCILMASK |
570 - 700 |
STENCILZFAIL |
500 - 800 |
STENCILREF |
550 - 700 |
ALPHABLENDENABLE |
550 - 700 |
STENCILFUNC |
560 - 680 |
STENCILWRITEMASK |
520 - 700 |
STENCILFAIL |
500 - 750 |
ZFUNC |
510 - 700 |
ZWRITEENABLE |
520 - 680 |
STENCILENABLE |
540 - 650 |
STENCILPASS |
560 - 630 |
SRCBLEND |
500 - 685 |
Two_Sided_StencilMODE |
450 - 590 |
ALPHATESTENABLE |
470 - 525 |
ALPHAREF |
460 - 530 |
ALPHAFUNC |
450 - 540 |
DESTBLEND |
475 - 510 |
COLORWRITEENABLE |
465 - 515 |
CCW_STENCILFAIL |
340 - 560 |
CCW_STENCILPASS |
340 - 545 |
CCW_STENCILZFAIL |
330 - 495 |
SCISSORTESTENABLE |
375 - 440 |
CCW_STENCILFUNC |
250 - 480 |
SetScissorRect |
150 - 340 |
使用D3D,我们就得知道常用的API的消耗,才能够方便我们优化自己的渲染器。这里给出了常用API的消耗表,可以有一个直观的比较。
这个表也可以在D3D SDK文档的 Accurately Profiling Direct3D API Calls (Direct3D 9) 一文中找到