From 14683c79093098aa41e2b0d42e4e5f59f4b8bca6 Mon Sep 17 00:00:00 2001 From: routersys Date: Thu, 2 Jul 2026 13:58:23 +0900 Subject: [PATCH] =?UTF-8?q?HlslKernelEmitter=E3=81=AE=E5=BA=A7=E6=A8=99?= =?UTF-8?q?=E5=8E=9F=E7=82=B9=E3=81=A8=E5=87=BA=E5=8A=9B=E3=81=AE=E5=88=87?= =?UTF-8?q?=E3=82=8A=E6=8D=A8=E3=81=A6=E3=82=92=E6=A4=9C=E8=A8=BC=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaScript.Tests/KernelHlslEmitterTests.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/LuaScript.Tests/KernelHlslEmitterTests.cs b/LuaScript.Tests/KernelHlslEmitterTests.cs index ec9d11b..ad3a638 100644 --- a/LuaScript.Tests/KernelHlslEmitterTests.cs +++ b/LuaScript.Tests/KernelHlslEmitterTests.cs @@ -31,6 +31,21 @@ namespace LuaScript.Tests Assert.Contains("inB", hlsl); } + [Fact] + public void CoordinatesUsePixelCenterOrigin() + { + string hlsl = HlslKernelEmitter.Emit(Extract(Grayscale)); + Assert.Contains(" - 0.5;", hlsl); + } + + [Fact] + public void OutputTruncatesToMatchCpuKernel() + { + string hlsl = HlslKernelEmitter.Emit(Extract(Grayscale)); + Assert.Contains("float oR = floor(clamp((", hlsl); + Assert.Contains("float oA = floor(outA) / 255.0;", hlsl); + } + [Fact] public void ThresholdEmitsTernary() {