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

Started by
1 comment, last by DieterVW 14 years, 1 month ago
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]
Advertisement
come on! 5 questions, and nobosy knows an answer? You do not have to answer to all. :)
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

This topic is closed to new replies.

Advertisement