Pass const ref parameters as in parameters in C# bindings

_amend in parameters
This commit is contained in:
2025-12-06 00:01:28 +02:00
parent dde07bac8d
commit d7eebb699c
14 changed files with 29 additions and 19 deletions

View File

@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
namespace Flax.Build.Bindings
{
@@ -1041,7 +1042,12 @@ namespace Flax.Build.Bindings
if (isGetter)
propertyInfo.Getter = functionInfo;
else
{
propertyInfo.Setter = functionInfo;
// Setter value parameter should always be const, forces bindings to pass value as "in" instead of "ref"
CollectionsMarshal.AsSpan(functionInfo.Parameters)[0].IsConst = true;
}
propertyInfo.DeprecatedMessage = functionInfo.DeprecatedMessage;
propertyInfo.IsHidden |= functionInfo.IsHidden;