Jump to content
  • Advertisement
Sign in to follow this  
WuTz

[DX10]Effect pools, Effects from Memory and #include....

This topic is 3163 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! I've got a problem! My first question is: When I use a #include in my Effect, and when I precompile that, do I have to tell the CreateEffectFromMem function where the Header is? Because it is precompiled... :) The second is: When I create a Effect from memory, can I use an EffectPool? And the third is: Must the EffectPool File the same as it was when I precompiled the Child-Effect? And the fourth: When I try to compile my shader, the VertexLayout-Creation breaks with the message, that the number of um... "Things" ist wrong or so. The InputLayout. And the fifth: I get an InvalidArg error, when I want to create my shader with an #include + pool from memory :( EDIT: You may need to know, that the effect header is saved as a file, right in the same folder as the .exe is... [Edited by - WuTz on February 22, 2010 3:53:20 PM]

Share this post


Link to post
Share on other sites
Advertisement
come on! 5 questions, and nobosy knows an answer? You do not have to answer to all. :)

Share this post


Link to post
Share on other sites
Info passed along:

Quote:

1. No. There is no use of headers after the effect is compiled. All the information is in the compiled effect.
2. Yes. However, you will likely have to write your own include handler (ID3D10Include). I’m not sure if a default include handler is used which looks in the same directory as pSrcFileName, but I’m guessing not.
3. Technically, you don’t even have to use a shared header file to use Effect Pools. If two variables of the same name and type are both marked shared in the child file and pool file, they will be treated as a single object. The file can be modified, but make sure that all shared objects are exactly the same (don’t change the type/layout/etc).
4. I don’t understand this question. Can you give a more detailed explanation?
5. It’s likely because you need to implement an include handler (ID3D10Include *pInclude). When compiling from memory, there is no file system access, so the compiler doesn’t know where to look for “myheader.fx”. The compiler will then push that responsibility to the application through the ID3D10Include interface. The compiler will ask pInclude to find “myheader.fx” and return its contents. You can write this class however you like – it can open the file from a directory on disk, it can return a pointer to memory, it can even auto-generate the contents if you so please.

- Ian

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!