From 8f6c3105efd27757d214da1f54a03a20a0ae2e49 Mon Sep 17 00:00:00 2001 From: routersys Date: Sat, 4 Jul 2026 17:27:58 +0900 Subject: [PATCH] =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=88=86=E5=B2=90=E3=82=AB?= =?UTF-8?q?=E3=83=BC=E3=83=8D=E3=83=AB=E3=81=AESIMD=E4=B8=80=E8=87=B4?= =?UTF-8?q?=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/KernelSimdEquivalenceTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/LuaScript.Tests/KernelSimdEquivalenceTests.cs b/LuaScript.Tests/KernelSimdEquivalenceTests.cs index ecf5619..c41682d 100644 --- a/LuaScript.Tests/KernelSimdEquivalenceTests.cs +++ b/LuaScript.Tests/KernelSimdEquivalenceTests.cs @@ -24,6 +24,7 @@ namespace LuaScript.Tests [InlineData("for y=0,obj.h-1 do for x=0,obj.w-1 do local r,g,b,a=obj.getpixel(x,y) obj.setpixel(x,y,((r>128 and g<64) or (not (b>200))) and 255 or 0,g,b,a) end end")] [InlineData("for y=0,obj.h-1 do for x=0,obj.w-1 do local r,g,b,a=obj.getpixel(x,y) obj.setpixel(x,y,(r>=200) and 255 or 0,(g<=50) and 255 or 0,(b==0) and 255 or ((b~=0) and 100 or 0),a) end end")] [InlineData("local pd=obj.getpixeldata() for y=0,pd.height-1 do for x=0,pd.width-1 do local i=(y*pd.width+x)*4 local r=pd:get(i+1) local g=pd:get(i+2) local b=pd:get(i+3) pd:set(i+1,r*3) pd:set(i+2,g-300) pd:set(i+3,b*2-255) end end")] + [InlineData("for y=0,obj.h-1 do for x=0,obj.w-1 do local r,g,b,a=obj.getpixel(x,y) local v=(r+g+b)/3 local o=0 if v>170 then o=255 elseif v>85 then o=128 else o=r end obj.setpixel(x,y,o,o,o,a) end end")] public void SimdBlockMatchesScalarRow(string script) { var program = KernelExtractor.TryExtract(script);