amerkoleci / Vortice.Windows

.NET bindings for Direct3D12, Direct3D11, WIC, Direct2D1, XInput, XAudio, X3DAudio, DXC, Direct3D9 and DirectInput.
MIT License
1.01k stars 73 forks source link

SharpGen.Runtime.SharpGenException:“HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid arguments], Message: [参数错误。 ]” #441

Closed Hommee-45 closed 4 months ago

Hommee-45 commented 4 months ago

` private void BuildRootSignature() {

        DescriptorRange1 texTableRange = new DescriptorRange1(DescriptorRangeType.ShaderResourceView, 4, 0);
        RootDescriptorTable1 texTable = new RootDescriptorTable1(texTableRange);

        DescriptorRange1 texTableRange1 = new DescriptorRange1(DescriptorRangeType.ShaderResourceView, 5, 1);
        RootDescriptorTable1 texTable1 = new RootDescriptorTable1(texTableRange1);

        RootDescriptor1 rootDescriptor1 = new RootDescriptor1(0, 0);
        RootDescriptor1 rootDescriptor2 = new RootDescriptor1(1, 0);
        RootDescriptor1 rootDescriptor3 = new RootDescriptor1(0, 1);

        RootParameter1[] slotRootParameters = new[]
        {
            new RootParameter1(RootParameterType.ConstantBufferView, rootDescriptor1, ShaderVisibility.All),
            new RootParameter1(RootParameterType.ConstantBufferView, rootDescriptor2, ShaderVisibility.All),
            new RootParameter1(RootParameterType.ShaderResourceView, rootDescriptor3, ShaderVisibility.All),
            new RootParameter1(texTable, ShaderVisibility.All),
            new RootParameter1(texTable1, ShaderVisibility.All),
        };

        // A root signature is an array of root parameters.
        RootSignatureDescription1 rootSigDesc = new RootSignatureDescription1(
            RootSignatureFlags.AllowInputAssemblerInputLayout,
            slotRootParameters,
            GetStaticSamplers()
            );

        _rootSignature = Device.CreateRootSignature(rootSigDesc);
    }`

final code CreateRootSignature would throw a error

SharpGen.Runtime.SharpGenException:“HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid arguments], Message: [参数错误。 ]” Error1-2 Error1-1

amerkoleci commented 4 months ago

Enable d3d12 debug layer and native debugging so you can see whats wrong on native d3d12 side

Hommee-45 commented 4 months ago

这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

Hommee-45 commented 4 months ago

Enable d3d12 debug layer and native debugging so you can see whats wrong on native d3d12 side

Thanks for your replying!!How to enable d3d12 debug layer and native, do you have a link?