New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better error when VertexFormat doesn't match shader #3235
Comments
I'll see if I can spend some time on this. The crash comes from here: Basically I need to catch that exception and report something useful to the user. I suspect I can at least report the vertex format in the |
I started to have a look at this, because I hit this issue myself and it took me a little bit of time to figure out - I imagine it's pretty confusing for beginners. XNA gives a nice error message:
I've got as far as adding a failing unit test. But unfortunately So I see two options:
I like option 1, but it does mean a change to MG's compiled effect format. What do you think? @tomspilman @theZMan |
I hate the idea of adding stuff into the format just for better error reporting. It means every effect is a little fatter and we use a little more memory to provide this feature. To me number 2 is a good option that will point users in the right direction without any additional overhead. |
Fair enough - I've created a PR with option 2. (I think I remember spotting it happen in your MVA presentation, and because I'd had it happen a couple of days before, I knew immediately what it was - but it definitely wasn't an intuitive error message.) |
It totally did and confused @theZMan . Glad to see a more obvious message now! |
During MVA demo had a cased where a models vertex format mismatched with the shader input format.
The error you get is below. @tomspilman says he can make that better.
An unhandled exception of type 'SharpDX.SharpDXException' occurred in SharpDX.dll
Additional information: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.
The text was updated successfully, but these errors were encountered: