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

IDxcCompilerArgs binding is wrong #447

Closed DeadMG closed 3 months ago

DeadMG commented 3 months ago

To reproduce, use IDxcUtils::BuildArguments. Then use the Arguments property on IDxcCompilerArgs. You will get out garbage.

It seems like the binder is treating the result as a string, when it is an array of strings.

amerkoleci commented 3 months ago

Can you share a repro case please?

DeadMG commented 3 months ago

Can do this evening

DeadMG commented 3 months ago
namespace VorticeRepro
{
    internal class Program
    {
        static void Main()
        {
            using (var utils = Vortice.Dxc.Dxc.CreateDxcUtils())
            using (var args = utils.BuildArguments("test.hlsl", "test1", "lib_6_3", ["test2"], []))
            {
                Console.WriteLine(args.Arguments);
            }
        }
    }
}

This simple sample should produce some command line arguments, but instead, "??O" was printed. Looking at Arguments in the original C++ API, it is an array of strings rather than a single string, which is probably the issue.

amerkoleci commented 3 months ago

Fixed by https://github.com/amerkoleci/Vortice.Windows/commit/420b46aafa8b8c9e38ca1a115e104aa3125c5dba

Thanks for repro case, version 3.5.6 beta is comming