Jump to content

  • Log In with Google      Sign In   
  • Create Account

D3DXCreateEffectFromFile major bug?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 ProgrammerDX   Members   -  Reputation: 175

Like
0Likes
Like

Posted 12 February 2013 - 10:36 PM

On some of my client's PC's, D3DXCreateEffectFromFile fails regardless of the content of the .fx file.

 

D3DXCreateEffectFromFile returns an undocumented HRESULT value: 0x8007007E

 

Parameter ppCompilationErrors is NULL so it's not possible to retrieve any further error information.

 

It fails on some PC's, but on most it's fine!

 

So, I have a downloaded an .exe of arbitrary tutorial that shows .fx files and supplied that to the client's with the problem, and that works just fine. That was build on a DirectX version from 2006/2007 (d3dx_30.dll). So it's not about shaders not being supported or something!

 

I then rebuild that tutorial's project on my IDE (DirectX SDK June 2010), supplied the .exe to the client's experiencing this bug and then the function bugs again!

 

So, then I thought it might be the different DirectX SDK's.

 

I decided to download an old DirectX SDK, in my case August 2007.

 

I compiled the .exe with the old DirectX SDK and then the .exe and effect runs just fine!

 

To Summarize

D3DXCreateEffectFromFile in SDK 2007: OK

D3DXCreateEffectFromFile in SDK 2010: UNKNOWN FAIL

 

What black sorcery is causing this!?


Edited by ProgrammerDX, 12 February 2013 - 10:51 PM.


Sponsor:

#2 ProgrammerDX   Members   -  Reputation: 175

Like
0Likes
Like

Posted 12 February 2013 - 11:04 PM

Ok now it get's even funnier.

 

My .exe that runs on DirectX June 2010 uses d3dx9_43.dll        -> D3DXCreateEffectFromFile    ERROR

My .exe that runs on DirectX August 2007 uses d3dx9_35.dll    -> D3DXCreateEffectFromFile   OK

 

So now the funny part:

I copy d3dx9_35.dll and rename it to d3dx9_43.dll, et voila, it works.

 

Definitely bug in DirectX SDK's


Edited by ProgrammerDX, 12 February 2013 - 11:05 PM.


#3 ProgrammerDX   Members   -  Reputation: 175

Like
0Likes
Like

Posted 12 February 2013 - 11:23 PM

K it's because I didnt redistribute Jun2010_D3DCompiler_43_x86.cab

 

dry.png

 

EDIT: full solution explanation below


Edited by ProgrammerDX, 13 February 2013 - 03:29 AM.


#4 Solid_Spy   Members   -  Reputation: 454

Like
0Likes
Like

Posted 13 February 2013 - 12:04 AM

I've been having problems with the effect library as well, in fact, I got an error on that same exact function. Where do you find d3dx9_43.dll?



#5 NewDisplayName   Members   -  Reputation: 359

Like
-1Likes
Like

Posted 13 February 2013 - 03:07 AM

Delay loading this dll should solve the problem.

Basically, use the effects if the dll loads successfully, otherwise use the D3D pipeline itself.

Above is applicable only when it isn't absolutely necessary to use effects.

This particular dll isn't necessarily present on all the machines.

It's generally present under system32 folder.

It's true that most distributables are shipping this dll to strictly use effects.



#6 ProgrammerDX   Members   -  Reputation: 175

Like
1Likes
Like

Posted 13 February 2013 - 03:25 AM

I resolved the problem.

 

It appears that for the June 2010 SDK (d3dx9_43.dll) and the one before that, Feb 2010 (d3dx9_42.dll), just supplying these dll's in the redistribute files to the end user is not enough to ensure that Effect class can be used.

 

Initially I believed supplying only the Jun2010_d3dx9_43_x86.cab redistribute file to the end user was enough. But for the mentioned SDKs it's not enough (special cases).

 

You need to supply all the Jun2010_*.cab files. (The one important to fix bug in this topic is Jun2010_D3DCompiler_43_x86.cab file)

 

So what I do now is just supply all the Jun2010_*.cab files as found in the \Microsoft DirectX SDK (June 2010)\Redist\   to the end-user. And the DSETUP.dll, dsetup32.dll, DXSETUP.exe, dxupdate.cab also found in that folder.

 

Then, force the client to execute DXSETUP.exe (to install the redist files) if LoadLibrary("d3dx9_43.dll") fails (test that in a launcher or something before running the actual game .exe).

 

So it was just a matter of not supplying all the right redistribute files to the end user because of a misunderstanding.

 

Problem is that it's not properly documented in MSDN and that there's no proper error message inside the function to tell you some files on the system are missing.


Edited by ProgrammerDX, 13 February 2013 - 03:28 AM.


#7 NightCreature83   Crossbones+   -  Reputation: 3037

Like
1Likes
Like

Posted 13 February 2013 - 03:46 AM

Btw that error code corresponds with this:

HRESULT: 0x8007007e (2147942526)
Name: ERROR_MOD_NOT_FOUND
Description: n/a
Severity code: Failed
Facility Code: FACILITY_WIN32 (7)
Error Code: 0x007e (126)

 

Which then leads to you having to check whether all the dlls that the application needs are present. Simple google fu would have found that from the error name.

When faced with an undocumented error code from a DX call it is likely this will actually be a WIN32 Error and these you can also look up on MSDN. The DX SDK also ships with a nice tool for translating error codes into readable errors which is in your SDK utils directory and is called DirectX Error Lookup, which I used to get the above info.


Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, Mad Max

#8 Lightness1024   Members   -  Reputation: 739

Like
0Likes
Like

Posted 13 February 2013 - 08:23 AM

your game has to run the installer using CreateProcess, or shell execute or equivalent, using this command line:

path-to-redistributable\dxsetup.exe /silent

cf.

http://msdn.microsoft.com/en-us/library/windows/desktop/ee416805(v=vs.85).aspx

and there are ways to make an installer embedding this step:

http://wix.sourceforge.net/manual-wix3/install_directx9.htm

not as on topic but interesting:

http://msdn.microsoft.com/en-us/library/windows/desktop/ee418797(v=vs.85).aspx






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS