Skip to main content
Home Forums General Silverlight New Features in Silverlight 3 Catastrophic failure when accessing a shader
3 replies. Latest Post by TomGiam on July 7, 2009.
(0)
TomGiam
Participant
788 points
220 Posts
07-05-2009 11:51 AM |
I have one pixel shader working fine from SL, but my second one is giving me this error:
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
I can't seem to find any problems with the file:
{
}
The OpacityEdge.ps file is in the ImageEffects folder.
I use it like this:
oe.Off = 0.025;
photo.Effect = oe; //Error occurs here
Thanks
Tom
ksleung
Contributor
5366 points
1,028 Posts
07-05-2009 1:26 PM |
From the look of it I didn't see anything wrong, so just some generic suggestions...
Did you try to see if your shader compiles and runs in Shazzem? If it does, maybe you want to compare the difference between your C# code and Shazzem's auto-generated one. Also, take a look to see whether the .ps file is really accessible (i.e. try to read it into a stream to see whether you succeed).
07-05-2009 2:01 PM |
Yes, I use Shazzam to compile and run all of my shaders. The C# output from Shazzam is:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3053
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// A: Comment out the following line if you are not passing in the shader and remove the shader parameter from the constructor
// Uri u = new Uri(@"pack://application:,,,/bandedswirl.ps");
// PixelShader = new PixelShader() { UriSource = u };
// Must initialize each DependencyProperty that's affliated with a shader register
// Ensures the shader initializes to the proper default value.
You are right about suspecting the access to the .ps file. I got the same error in my first shader when I gave it the wrong path to the .ps file.
However, this one looks correct... so I'm still looking into it. I'll need to implement a read to make sure.
07-07-2009 8:16 AM |
I found the problem...
I had forgotten to set the build action to "Content" for the .ps file.