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


DirectX8 Function Times

Recommended Posts

Dwiel    365
I was wondering if anyone knew the aprox. times(or average times since every comp. will be different) of some of the functions in the DirectX 8 API? Ones I am mostly conserned about are: SetTextureStageState() SetTexture() SetStreamSource() SetVertexShader() I know this is VERY general, but general answers will help. Things like "function a is normally faster than function b" will help. Or even "function a is faster on my computer than function b" will help Thanx alot. You Can use the code snippet: clock_t start, finish; double duration; FILE *file; start = clock(); for (int a = 0; a < 10000; a++) { m_pd3dDevice->SetStreamSource(0, m_pVB1, sizeof(XYZ_RHW_DIFFUSE)); m_pd3dDevice->SetStreamSource(0, m_pVB0, sizeof(XYZ_RHW_UV)); } finish = clock(); duration = (double)(finish - start) / CLOCKS_PER_SEC; if (file = fopen("C:\\data.txt", "w")) { fprintf(file, "20000 SetStreamSource functions took %.15f seconds\n", duration); fprintf(file, "Each SetStreamSource function took %.15f seconds\n", duration / 10000.0f / 2.0f); fclose(file); } I got: 20000 SetTexture's .050000000745058 1 SetTexture .000002499999937 20000 SetVertexShader's .059999998658895 1 SetVertexShader .000002999999879 Thanx Alot Edited by - tazzel3d on November 3, 2001 6:29:31 PM

Share this post

Link to post
Share on other sites