Skip to content

Commit

Permalink
Windows ISPC (#5166)
Browse files Browse the repository at this point in the history
* Windows ISPC 
* updating the ispc as per dan.
* update the config and add tag line
* Code cleanup ..
* Update the readme
  • Loading branch information
derwin12 authored Jan 30, 2025
1 parent 2a1b172 commit 3d0cafb
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 8 deletions.
13 changes: 13 additions & 0 deletions README.windows
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,16 @@ Here are the steps to Code::Blocks for Editing .wxs files in Windows.
by double-clicking on the .cbp file in the xLights directory.
Then Open a Dialog, Panel, or Frame in the Left Panel to edit it.


Instructions for Setting up ISPC for Windows
============================================

ISPC is a compiler for a variant of the C programming language, with extensions for "single program, multiple data" (SPMD) programming.
It is used in xLights for the generation of AVX1, AVX2, SEE2 and SSE4 optimized code.

a) Download ISPC from
https://github.com/ispc/ispc/releases/download/v1.25.3/ispc-v1.25.3-windows.zip

b) Extract the zip file to a folder of your choice.

c) Add the path to the ISPC executable to your PATH environment variable.
59 changes: 59 additions & 0 deletions xLights/Xlights.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1065,8 +1065,15 @@ xcopy "$(SolutionDir)..\bin64\Vamp\" "$(TargetDir)Vamp\" /e /y /i /r
<ClInclude Include="effects\FX.h" />
<ClInclude Include="effects\GuitarEffect.h" />
<ClInclude Include="effects\GuitarPanel.h" />
<ClInclude Include="effects\ispc\ButterflyFunctions.ispc.h" />
<ClInclude Include="effects\ispc\ISPCComputeUtilities.h" />
<ClInclude Include="effects\ispc\LayerBlendingFunctions.ispc.h" />
<ClInclude Include="effects\ispc\PinwheelFunctions.ispc.h" />
<ClInclude Include="effects\ispc\PlasmaFunctions.ispc.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="effects\ispc\SpacialColors.ispc.h" />
<ClInclude Include="effects\KaleidoscopeEffect.h" />
<ClInclude Include="effects\KaleidoscopePanel.h" />
<ClInclude Include="effects\LinesEffect.h" />
Expand Down Expand Up @@ -1521,6 +1528,58 @@ xcopy "$(SolutionDir)..\bin64\Vamp\" "$(TargetDir)Vamp\" /e /y /i /r
<ItemGroup>
<Text Include="..\documentation\xlDo Commands.txt" />
</ItemGroup>
<ItemGroup>
<CustomBuild Include="effects\ispc\LayerBlendingFunctions.ispc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<FileType>Document</FileType>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ispc.exe "%(FullPath)" --target=avx2-i32x16 --target=avx1-i32x16 --target=sse4.2-i32x8 --target=sse2-i32x8 --arch=x86_64 -o "$(IntDir)%(Filename).obj"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename).obj</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(InputPath)</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ispc.exe "%(FullPath)" --target=avx2-i32x16 --target=avx1-i32x16 --target=sse4.2-i32x8 --target=sse2-i32x8 --arch=x86_64 -o "$(IntDir)%(Filename).obj"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(FileName).obj</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(InputPath)</AdditionalInputs>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="effects\ispc\ButterflyFunctions.ispc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ispc.exe "%(FullPath)" -o "$(IntDir)%(Filename).obj" --target=avx2-i32x16 --target=avx1-i32x16 --target=sse4.2-i32x8 --target=sse2-i32x8 --arch=x86_64</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename).obj</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(InputPath)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename).obj</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(InputPath)</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ispc.exe "%(FullPath)" -o "$(IntDir)%(Filename).obj" --target=avx2-i32x16 --target=avx1-i32x16 --target=sse4.2-i32x8 --target=sse2-i32x8 --arch=x86_64</Command>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="effects\ispc\PinwheelFunctions.ispc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
<FileType>Document</FileType>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(InputPath)</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(InputPath)</AdditionalInputs>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ispc.exe "%(FullPath)" -o "$(IntDir)%(Filename).obj" --target=avx2-i32x16 --target=avx1-i32x16 --target=sse4.2-i32x8 --target=sse2-i32x8 --arch=x86_64</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ispc.exe "%(FullPath)" -o "$(IntDir)%(Filename).obj" --target=avx2-i32x16 --target=avx1-i32x16 --target=sse4.2-i32x8 --target=sse2-i32x8 --arch=x86_64</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename).obj</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename).obj</Outputs>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="effects\ispc\PlasmaFunctions.ispc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ispc.exe "%(FullPath)" -o "$(IntDir)%(Filename).obj" --target=avx2-i32x16 --target=avx1-i32x16 --target=sse4.2-i32x8 --target=sse2-i32x8 --arch=x86_64</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename).obj</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(InputPath)</AdditionalInputs>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ispc.exe "%(FullPath)" -o "$(IntDir)%(Filename).obj" --target=avx2-i32x16 --target=avx1-i32x16 --target=sse4.2-i32x8 --target=sse2-i32x8 --arch=x86_64</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename).obj</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(InputPath)</AdditionalInputs>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
10 changes: 10 additions & 0 deletions xLights/Xlights.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -2203,6 +2203,10 @@
<ClInclude Include="effects\ispc\LayerBlendingFunctions.ispc.h">
<Filter>Effects\ispc</Filter>
</ClInclude>
<ClInclude Include="effects\ispc\ButterflyFunctions.ispc.h" />
<ClInclude Include="effects\ispc\PinwheelFunctions.ispc.h" />
<ClInclude Include="effects\ispc\PlasmaFunctions.ispc.h" />
<ClInclude Include="effects\ispc\SpacialColors.ispc.h" />
</ItemGroup>
<ItemGroup>
<Filter Include="Models">
Expand Down Expand Up @@ -2262,4 +2266,10 @@
<Filter>automation</Filter>
</Text>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="effects\ispc\LayerBlendingFunctions.ispc" />
<CustomBuild Include="effects\ispc\ButterflyFunctions.ispc" />
<CustomBuild Include="effects\ispc\PinwheelFunctions.ispc" />
<CustomBuild Include="effects\ispc\PlasmaFunctions.ispc" />
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions xLights/effects/ButterflyEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@

#include "../Parallel.h"

#ifndef __WXMSW__
#include "ispc/ButterflyFunctions.ispc.h"
#define HASISPC
#endif

ButterflyEffect::ButterflyEffect(int i) : RenderableEffect(i, "Butterfly", butterfly_16, butterfly_24, butterfly_32, butterfly_48, butterfly_64)
{
Expand Down
2 changes: 0 additions & 2 deletions xLights/effects/PinwheelEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@

#include "../Parallel.h"

#ifndef __WXMSW__
#include "ispc/PinwheelFunctions.ispc.h"
#define HASISPC
#endif

PinwheelEffect::PinwheelEffect(int id) : RenderableEffect(id, "Pinwheel", pinwheel_16, pinwheel_24, pinwheel_32, pinwheel_48, pinwheel_64)
{
Expand Down
2 changes: 0 additions & 2 deletions xLights/effects/PlasmaEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
#include "../Parallel.h"


#ifndef __WXMSW__
#include "ispc/PlasmaFunctions.ispc.h"
#define HASISPC
#endif


PlasmaEffect::PlasmaEffect(int id) : RenderableEffect(id, "Plasma", plasma_16, plasma_24, plasma_32, plasma_48, plasma_64)
Expand Down
2 changes: 0 additions & 2 deletions xLights/effects/ispc/ISPCComputeUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

ISPCComputeUtilities ISPCComputeUtilities::INSTANCE;

#ifndef __WXMSW__
#define HASISPC
#endif


#ifdef HASISPC
Expand Down

0 comments on commit 3d0cafb

Please sign in to comment.