BinomialLLC / basis_universal

Basis Universal GPU Texture Codec
Apache License 2.0
2.72k stars 267 forks source link

compiling with clang on windows with sse #279

Open malytomas opened 2 years ago

malytomas commented 2 years ago

Steps to reproduce:

mkdir build
cd build
cmake -T ClangCL -DSSE:BOOL=ON .. # use visual studio with clang cl and enable sse
cmake --build . --config debug

Requires visual studio 2019 with clang cl installed (component of visual studio). I have not tried it with standalone llvm installation.

Errors:

encoder/cppspmd_sse.h(365,9): error : always_inline function '_mm_cvtepu8_epi32' requires target feature 'sse4.1', but would be inlined into function 'load_rgba32' that is compiled without support for 'sse4.1'
encoder/cppspmd_sse.h(343,9): error : always_inline function '_mm_mullo_epi32' requires target feature 'sse4.1', but would be inlined into function 'mullo_epi32' that is compiled without support for 'sse4.1'
encoder/cppspmd_sse.h(164,9): error : always_inline function '_mm_blendv_ps' requires target feature 'sse4.1', but would be inlined into function 'blendv_mask_ps' that is compiled without support for 'sse4.1'
encoder/cppspmd_sse.h(304,9): error : always_inline function '_mm_min_epi32' requires target feature 'sse4.1', but would be inlined into function 'min_epi32' that is compiled without support for 'sse4.1'
encoder/cppspmd_sse.h(274,9): error : always_inline function '_mm_shuffle_epi8' requires target feature 'ssse3', but would be inlined into function 'shuffle_epi8' that is compiled without support for 'ssse3'
richgel999 commented 2 years ago

Got it - can you try the included .SLN? That likely will fix it. Note the code does compile with clang under Linux - this is just a compiler option issue.

malytomas commented 2 years ago

I integrate basis_universal using cmake add_subdirectory and git submodule. The provided .sln is unusable for me.

richgel999 commented 2 years ago

OK thank you so much. I will be integrating v1.16 any day now (we're waiting for final approval), then I will go through the PR's and merge them in.