Skip to content
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

shader compilation fails #11

Open
Mathias-Fuchs opened this issue Mar 19, 2019 · 4 comments
Open

shader compilation fails #11

Mathias-Fuchs opened this issue Mar 19, 2019 · 4 comments

Comments

@Mathias-Fuchs
Copy link

Mathias-Fuchs commented Mar 19, 2019

Hello! I can build the getting started sample fine, using the nuget version 4.5.0 of velgrid, but .net core host seems to crash during the spirv shader compilation:

$ dotnet run

Unhandled Exception: SharpDX.SharpDXException: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: Falscher Parameter.

   at SharpDX.Result.CheckError()
   at SharpDX.Direct3D11.Device.CreateVertexShader(IntPtr shaderBytecodeRef, PointerSize bytecodeLength, ClassLinkage classLinkageRef, VertexShader vertexShaderOut)
   at SharpDX.Direct3D11.VertexShader..ctor(Device device, Byte[] shaderBytecode, ClassLinkage linkage)
   at Veldrid.D3D11.D3D11Shader..ctor(Device device, ShaderDescription description) in C:\projects\veldrid\src\Veldrid\D3D11\D3D11Shader.cs:line 33
   at Veldrid.D3D11.D3D11ResourceFactory.CreateShaderCore(ShaderDescription& description) in C:\projects\veldrid\src\Veldrid\D3D11\D3D11ResourceFactory.cs:line 60
   at Veldrid.SPIRV.ResourceFactoryExtensions.CreateFromSpirv(ResourceFactory factory, ShaderDescription vertexShaderDescription, ShaderDescription fragmentShaderDescription, CrossCompileOptions options)
   at Veldrid.SPIRV.ResourceFactoryExtensions.CreateFromSpirv(ResourceFactory factory, ShaderDescription vertexShaderDescription, ShaderDescription fragmentShaderDescription)
   at GettingStarted.Program.CreateResources() in C:\Users\Dell\source\repos\K3D_Mesher\MF\Visualizer2\main.cs:line 111
   at GettingStarted.Program.Main(String[] args) in C:\Users\Dell\source\repos\K3D_Mesher\MF\Visualizer2\main.cs:line 59

This happens in the line

            _shaders = factory.CreateFromSpirv(vertexShaderDesc, fragmentShaderDesc);

Any help appreciated! MF

@mellinoe
Copy link
Owner

Have you made any modifications to the example code? I'm able to run the GettingStarted project under D3D11 without the above problem. The error indicates that the VertexLayoutDescription might have been modified from what is in the repo -- is that the case?

@Mathias-Fuchs
Copy link
Author

Hello mellinoe, thanks for answer.
No, I can't seem to find any difference. It alsow works on Linux.
The vertex layout is still

VertexLayoutDescription vertexLayout = new VertexLayoutDescription(
                new VertexElementDescription("Position", VertexElementSemantic.TextureCoordinate, VertexElementFormat.Float2),
                new VertexElementDescription("Color", VertexElementSemantic.TextureCoordinate, VertexElementFormat.Float4)
                );

and the class VertexLayoutDescription hasn't changed either.

@Mathias-Fuchs
Copy link
Author

Any new thoughts on this issue?
It keeps nagging me ....

@mostafa901
Copy link

mostafa901 commented Aug 8, 2019

yep. Same here... could it be the reason if i have DirectX12 not 11 under windows 10?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants