Generate every HLSL swizzle and mixed constructor; fix intrinsic types
tools/generate-swizzles.ps1 writes the checked-in src/CultMath/Swizzles.g.cs
as partial structs plus a partial math: for float2/3/4, int2/3/4 and bool2/3/4
every swizzle of length 2-4 including repeats, in xyzw and rgba naming, with
setters only on non-repeating masks, plus single-component r/g/b/a. double2/3
get lengths 2-3 (there is no double4). Every HLSL mixed constructor
(float4(float2, float2), float4(float, float2, float), copy forms, ...) exists
as a struct constructor and, for float/int/bool, a math function. The
hand-written swizzles and mixed constructors it supersedes are deleted.
Matrices store private rows and return ref float2/float3 from the row
indexer ([UnscopedRef], polyfilled for netstandard2.1), so m[1][2] = s
compiles as in HLSL; _mRC are get/set properties over the rows. Equality and
hashing stay value-based.
Intrinsics follow HLSL: sign returns int/intN and yields 0 for NaN; step is
x >= y ? 1 : 0 so NaN yields 0; any/all accept float and int vectors;
min/max/abs on int vectors return int vectors, and abs(int) returns int.
Strips the UTF-8 BOMs this branch added to math.cs, CultMath.csproj and
HlslSemanticsTests.cs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 13:57:02 +02:00
|
|
|
<Project Sdk="Microsoft.NET.Sdk">
|
2026-05-08 01:49:44 +01:00
|
|
|
|
|
|
|
|
<PropertyGroup>
|
2026-07-12 19:33:59 +01:00
|
|
|
<TargetFrameworks>net8.0;netstandard2.1</TargetFrameworks>
|
2026-05-08 01:49:44 +01:00
|
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
|
|
|
<Nullable>enable</Nullable>
|
2026-07-12 19:33:59 +01:00
|
|
|
<LangVersion>latest</LangVersion>
|
2026-05-08 01:49:44 +01:00
|
|
|
<RootNamespace>CultMath</RootNamespace>
|
|
|
|
|
<AssemblyName>CultMath</AssemblyName>
|
2026-08-26 17:35:51 +02:00
|
|
|
<PackageId>GameCult.Math</PackageId>
|
Release CultMath 0.2.4: erf and erfinv reach the Unity package
math.erf/math.erfinv (source, tests, README) already landed on main via
87b95ae, b688cb2, fc9ce97, 4cdc02b, 6e8362b, cc71f17. This is the release
step 0.2.3 skipped needing: bump the package version, rebuild the tracked
Unity DLL/pdb deterministically, and add the CHANGELOG.md this package
never had (docs/semver-policy.md names this exact gap).
- packages/cultmath/src/CultMath/CultMath.csproj: Version 0.2.3 -> 0.2.4.
- packages/cultmath/unity/org.gamecult.cultmath/package.json: 0.2.3 -> 0.2.4.
- packages/cultmath/unity/org.gamecult.cultmath/CHANGELOG.md: new, [0.2.4]
entry only (Added: erf, erfinv). Earlier versions are not backfilled, per
the semver policy's own ruling on this package's pre-existing gap.
- packages/cultmath/unity/org.gamecult.cultmath/Runtime/Plugins/CultMath.dll
and .pdb: rebuilt via packages/cultmath/scripts/build-unity-package.ps1
(dotnet build, netstandard2.1, Release, --no-incremental, no Source Link).
Built on Windows; the assembly is platform-neutral IL. The script's own
determinism check (fresh build hash == tracked hash) and its version-parity
check (package.json version == assembly FileVersion) both pass.
- No HLSL mirror change: erf/erfinv are C#-only, and
packages/cultmath/shaders/CultMath.hlsl already matches the copy under
unity/org.gamecult.cultmath/Shaders/CultMath.hlsl byte for byte.
Verified independent of build-unity-package.ps1's own checks: a scratch
console app loaded the tagged cultmath-unity-v0.2.3 DLL and this build's
fresh DLL into separate AssemblyLoadContexts and diffed their public
surface. Only two members were added (math.erf(float), math.erfinv(float)),
none removed; AssemblyVersion/FileVersion/InformationalVersion match apart
from the 0.2.3 -> 0.2.4 bump; TargetFrameworkAttribute is unchanged
(.NETStandard,Version=v2.1). erf/erfinv round-trip and domain-edge behavior
(erfinv(+-1) = +-Infinity, erfinv(1.5) = NaN) verified by invoking the
loaded methods directly.
dotnet test packages/cultmath/tests/CultMath.Tests -c Release: 102 passed,
0 failed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 19:02:40 +02:00
|
|
|
<Version>0.2.4</Version>
|
2026-05-08 01:49:44 +01:00
|
|
|
<Description>Clean-room C# math shaped for HLSL-style renderer code.</Description>
|
|
|
|
|
<Authors>GameCult</Authors>
|
|
|
|
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
|
|
|
|
<NoWarn>$(NoWarn);CS8981</NoWarn>
|
2026-06-03 02:58:56 +01:00
|
|
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
2026-09-14 14:27:44 +02:00
|
|
|
<!-- The Unity DLL is committed beside its source, so its bytes must not name a commit. -->
|
|
|
|
|
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
2026-05-08 01:49:44 +01:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
|
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
|
2026-06-10 21:22:43 +01:00
|
|
|
<None Include="..\..\shaders\CultMath.hlsl" Pack="true" PackagePath="contentFiles\any\any\shaders\CultMath.hlsl" CopyToOutputDirectory="PreserveNewest" />
|
2026-05-08 01:49:44 +01:00
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
</Project>
|