XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

D3DX10CreateEffectFromFile in March 2008 SDK takes 12 parameters

Last post 03-26-2008 7:32 PM by yoedhana. 2 replies.
  • 03-24-2008 7:28 PM

    D3DX10CreateEffectFromFile in March 2008 SDK takes 12 parameters

    Hi,

    I have two questions regarding the parameter changes with D3DX10CreateEffectFromFile:

    1. What is the purpose of the 12th parameter in function D3DX10CreateEffectFromFile ?
    In file d3dx10async.h, D3DX10CreateEffectFromFile is declared as :

    #ifdef UNICODE
    #define D3DX10CreateEffectFromFile          D3DX10CreateEffectFromFileW
    #define D3DX10CreateEffectFromResource      D3DX10CreateEffectFromResourceW
    #else
    #define D3DX10CreateEffectFromFile          D3DX10CreateEffectFromFileA
    #define D3DX10CreateEffectFromResource      D3DX10CreateEffectFromResourceA
    #endif

    D3DX10CreateEffectFromFileW has this declaration:

    HRESULT WINAPI D3DX10CreateEffectFromFileW(LPCWSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
        ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
        ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);

    D3DX10CreateEffectFromFileA has this declaration:

    HRESULT WINAPI D3DX10CreateEffectFromFileA(LPCSTR pFileName, CONST D3D10_SHADER_MACRO *pDefines,
        ID3D10Include *pInclude, LPCSTR pProfile, UINT HLSLFlags, UINT FXFlags, ID3D10Device *pDevice,
        ID3D10EffectPool *pEffectPool, ID3DX10ThreadPump* pPump, ID3D10Effect **ppEffect, ID3D10Blob **ppErrors, HRESULT* pHResult);

    The last parameter, HRESULT* pHResult looks new. The DirectX documentation that comes with the installer describes D3DX10CreateEffectFromFile with only 11 parameters.

    2. LPCSTR pProfile requires the user to specify a shader model. Does this mean that I can only have one technique in my effect file, with CompileShader using the same shader model as D3DX10CreateEffectFromFile? The last SDK I used was February07, and D3DX10CreateEffectFromFile takes only 10 parameters, without the pProfile.

    Thanks for your answers.

  • 03-26-2008 7:26 PM In reply to

    Re: D3DX10CreateEffectFromFile in March 2008 SDK takes 12 parameters

    Answer

    I just left some feedback on the documentation bug. The last parameter is useful if you're using the D3DX thread pool to do threaded compilation, it's where to store the HRESULT when the compile is done. Otherwise the HRESULT that gets returned just tells you whether or not the job was successfully added to the pool.h

    pProfile is new because with Vista SP1 we shipped a new effects runtime, which you can use with the fx_4_1 target. So normally you would specify "fx_4_0" or "fx_4_1" in this case. Also note that you can compile effects from the D3DX10Compile* functions using these profile strings, rather than calling D3DX10CompileEffect*.

  • 03-26-2008 7:32 PM In reply to

    Re: D3DX10CreateEffectFromFile in March 2008 SDK takes 12 parameters

    Thanks for your reply. I will just leave the HRESULT* parameter NULL for now.
Page 1 of 1 (3 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG