Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualMeltac

Posted 25 May 2012 - 08:57 AM

I tried replacing the used D3DCompiler_43.dll with the Win 8 SDK's d3dcompiler_44.dll (renamed it of course), but it didn't speed up anything at all.

Are there maybe any other files that I need to copy over in order to get the new compiler running without fxc.exe? And does the new compiler even speed up DX9 shaders?


Could anybody give some additional information that might help sorting out why the new compiler doesn't increase compilation speed in my case?

EDIT:
After further investigation, I've found that compilation time depends heavily on the code order. Consider the following example (simplified):
	 // 1. Do some basic color calculations and store them into the local variable "Color"

	 // 2. Create fake reflections
	 #ifdef WET_OBJREFLECT
	 Color = objreflect(Color, viewspace_P, uv, dist_factor, wind, WET_OBJMAXCOL, WET_OBJMAXREF);
	 #endif
	
	 // 3. Add blur to everything
	 #ifdef WET_REFBLUR
	 float contrib=1.h;
	 float total_blur = amount * WET_REFBLUR; // e_barrier.y * 1000; //1000 * (e_kernel.x-0.4); // --> 0.401
	 float f=0.f;
	 float inc=total_blur/WET_REFBLURQUALITY;
	 float3 sum = 0;
	 for (int i=0;i<WET_REFBLURQUALITY;i++){sum+=gaussblur(uv,f);contrib++;f+=inc;}
	 Color.rgb += (sum/contrib) - tex2D(s_image,uv); 
	 #endif	

This version takes nearly 6 seconds to compile, whereas the compilation time is only around 3 seconds if I swap code block 2 and 3 (applying blur BEFORE reflections).

As you can see these two code blocks do not depend directly on each other, both of them just modify the previously calculated Color, like simple process stack. So why compiles that code twice as fast when order is swapped?

#1Meltac

Posted 25 May 2012 - 04:09 AM

I tried replacing the used D3DCompiler_43.dll with the Win 8 SDK's d3dcompiler_44.dll (renamed it of course), but it didn't speed up anything at all.

Are there maybe any other files that I need to copy over in order to get the new compiler running without fxc.exe? And does the new compiler even speed up DX9 shaders?


Could anybody give some additional information that might help sorting out why the new compiler doesn't increase compilation speed in my case?

PARTNERS