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

gjaegy

Member Since 02 Jun 2004
Offline Last Active Dec 07 2012 07:34 AM
-----

Topics I've Started

D3D10, effects and VS2012

07 December 2012 - 06:20 AM

I am very confused at the moment, I have switched to visual studio 2012.

I am using speed tree, which relies on the effect library. I am using D3D10.

I can successfully compile the effects using D3DCompile() and the "fx_4_0" profile.

However, now D3D10CreateEffectFromMemory() doesn't like the compiled effect anymore, and return E_FAIL. I have no other information but this error code.

I had a look at the Effects11 library, but it requires a ID3D11Device.

Any idea ?

strategy for automatic shader compilation caching

04 April 2012 - 05:29 AM

Hi,

I am trying to reduce the load time of my game.

Right now, I compile all the shader at runtime, when the game is started, which takes quite some time.

I use D3DX10CompileFromMemory to compile my shaders.

I am thinking about writing the content of the blob returned by this function on disk, the first time the shader is being compiled, and re-use it next time the game is started.

This is very straightforward.

However, what I also would like to achieve, is to automatically detect any change in the shader source, and re-compile the shader if any change occured.

So, my initial idea was to save two files, the source code version used for compilation, and the resulting compiled shader blob.
At runtime, I would load the shader source file, and compare it with the source version used for compilation. If there is no difference, i can use the pre-compiled blob, otherwise I compile the shader again.

However, this approach gets a bit more complicated when considering "#include" directives, along with the usage of a "ID3D10Include" object.

The only way I see would be to manually resolve all the #include" directives, in order to get a "#include"-free HLSL source code I could use to compare the current version with the pre-compiled cache version.

Is there any other option I haven't seen ? How do you guys handle this problem ?

PARTNERS