GPU/SW: Enable SIMD path and make default

This commit is contained in:
Stenzek 2024-09-21 21:00:40 +10:00
parent 19698559c3
commit 54e5d93165
No known key found for this signature in database
3 changed files with 4 additions and 12 deletions

View File

@ -51,12 +51,6 @@
<ClCompile Include="gpu_sw.cpp" /> <ClCompile Include="gpu_sw.cpp" />
<ClCompile Include="gpu_sw_backend.cpp" /> <ClCompile Include="gpu_sw_backend.cpp" />
<ClCompile Include="gpu_sw_rasterizer.cpp" /> <ClCompile Include="gpu_sw_rasterizer.cpp" />
<ClCompile Include="gpu_sw_rasterizer_avx2.cpp">
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<AdditionalOptions Condition="$(Configuration.Contains(Clang))">%(AdditionalOptions) -mavx2</AdditionalOptions>
<ExcludedFromBuild Condition="'$(Platform)'!='x64'">true</ExcludedFromBuild>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="gte.cpp" /> <ClCompile Include="gte.cpp" />
<ClCompile Include="dma.cpp" /> <ClCompile Include="dma.cpp" />
<ClCompile Include="gpu.cpp" /> <ClCompile Include="gpu.cpp" />

View File

@ -67,7 +67,6 @@
<ClCompile Include="justifier.cpp" /> <ClCompile Include="justifier.cpp" />
<ClCompile Include="gdb_server.cpp" /> <ClCompile Include="gdb_server.cpp" />
<ClCompile Include="gpu_sw_rasterizer.cpp" /> <ClCompile Include="gpu_sw_rasterizer.cpp" />
<ClCompile Include="gpu_sw_rasterizer_avx2.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="types.h" /> <ClInclude Include="types.h" />

View File

@ -47,7 +47,7 @@ namespace GPU_SW_Rasterizer::SIMD {
#define USE_VECTOR 1 #define USE_VECTOR 1
#include "gpu_sw_rasterizer.inl" #include "gpu_sw_rasterizer.inl"
#undef USE_VECTOR #undef USE_VECTOR
} } // namespace GPU_SW_Rasterizer::SIMD
#endif #endif
// Initialize with default implementation. // Initialize with default implementation.
@ -78,10 +78,9 @@ void GPU_SW_Rasterizer::SelectImplementation()
#if defined(CPU_ARCH_SSE) || defined(CPU_ARCH_NEON) #if defined(CPU_ARCH_SSE) || defined(CPU_ARCH_NEON)
const char* use_isa = std::getenv("SW_USE_ISA"); const char* use_isa = std::getenv("SW_USE_ISA");
// Default to scalar for now, until vector is finished. // AVX2/256-bit path still has issues, and I need to make sure that it's not ODR'ing any shared
use_isa = use_isa ? use_isa : "Scalar"; // symbols on top of the base symbols.
#if defined(CPU_ARCH_SSE) && defined(_MSC_VER) && 0
#if defined(CPU_ARCH_SSE) && defined(_MSC_VER)
if (cpuinfo_has_x86_avx2() && (!use_isa || StringUtil::Strcasecmp(use_isa, "AVX2") == 0)) if (cpuinfo_has_x86_avx2() && (!use_isa || StringUtil::Strcasecmp(use_isa, "AVX2") == 0))
{ {
SELECT_ALTERNATIVE_RASTERIZER(AVX2); SELECT_ALTERNATIVE_RASTERIZER(AVX2);