diff --git a/graphics/nvidia-texture-tools/Makefile b/graphics/nvidia-texture-tools/Makefile index cc86f9665a1f..cc806d3d0b57 100644 --- a/graphics/nvidia-texture-tools/Makefile +++ b/graphics/nvidia-texture-tools/Makefile @@ -1,37 +1,36 @@ PORTNAME= nvidia-texture-tools PORTVERSION= 2.1.2 CATEGORIES= graphics MAINTAINER= amdmi3@FreeBSD.org COMMENT= Texture Tools with support for DirectX 10 formats WWW= https://github.com/castano/nvidia-texture-tools LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE ONLY_FOR_ARCHS= i386 amd64 powerpc powerpc64 armv6 aarch64 powerpc64le # see src/nvcore/nvcore.h -BROKEN_aarch64= error: use of undeclared identifier '__builtin_ia32_emms' USES= cmake compiler:c++11-lang CMAKE_ON= NVTT_SHARED \ NVCORE_SHARED \ NVTHREAD_SHARED \ NVIMAGE_SHARED USE_GITHUB= yes GH_ACCOUNT= castano USE_LDCONFIG= yes CFLAGS_i386= -msse -msse2 PORTDOCS= ChangeLog README.md OPTIONS_DEFINE= DOCS post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} .for f in ${PORTDOCS} ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR} .endfor .include diff --git a/graphics/nvidia-texture-tools/files/patch-extern_CMP__Core_source_cmp__math__vec4.h b/graphics/nvidia-texture-tools/files/patch-extern_CMP__Core_source_cmp__math__vec4.h new file mode 100644 index 000000000000..5ac0334928b4 --- /dev/null +++ b/graphics/nvidia-texture-tools/files/patch-extern_CMP__Core_source_cmp__math__vec4.h @@ -0,0 +1,25 @@ +--- extern/CMP_Core/source/cmp_math_vec4.h.orig 2020-08-24 06:27:21 UTC ++++ extern/CMP_Core/source/cmp_math_vec4.h +@@ -322,10 +322,12 @@ class Vec4 (public) + }; + + #include +-#include "xmmintrin.h" + #include + #include + ++#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) ++#include "xmmintrin.h" ++ + // SSE Vec4 + #ifdef _LINUX + class CMP_SSEVec4f +@@ -419,6 +421,8 @@ class __declspec(align(16)) CMP_SSEVec4f (public) + }; + + }; ++ ++#endif + + typedef Vec4 CMP_Vec4f; + typedef Vec4 CMP_Vec4d; diff --git a/graphics/nvidia-texture-tools/files/patch-src_nvcore_Debug.cpp b/graphics/nvidia-texture-tools/files/patch-src_nvcore_Debug.cpp new file mode 100644 index 000000000000..03bc35017897 --- /dev/null +++ b/graphics/nvidia-texture-tools/files/patch-src_nvcore_Debug.cpp @@ -0,0 +1,15 @@ +--- src/nvcore/Debug.cpp.orig 2020-08-24 06:27:21 UTC ++++ src/nvcore/Debug.cpp +@@ -628,6 +628,12 @@ namespace + # elif NV_CPU_X86 + ucontext_t * ucp = (ucontext_t *)secret; + return (void *)ucp->uc_mcontext.mc_eip; ++# elif NV_CPU_PPC ++ ucontext_t * ucp = (ucontext_t *)secret; ++ return (void *)ucp->uc_mcontext.mc_srr0; ++# elif NV_CPU_ARM_64 ++ ucontext_t * ucp = (ucontext_t *)secret; ++ return (void *)ucp->uc_mcontext.mc_gpregs.gp_elr; + # else + # error "Unknown CPU" + # endif diff --git a/graphics/nvidia-texture-tools/files/patch-src_nvcore_Debug.h b/graphics/nvidia-texture-tools/files/patch-src_nvcore_Debug.h new file mode 100644 index 000000000000..652605757a48 --- /dev/null +++ b/graphics/nvidia-texture-tools/files/patch-src_nvcore_Debug.h @@ -0,0 +1,11 @@ +--- src/nvcore/Debug.h.orig 2020-08-24 06:27:21 UTC ++++ src/nvcore/Debug.h +@@ -166,7 +166,7 @@ namespace nv + namespace nv + { + inline bool isValidPtr(const void * ptr) { +- #if NV_CPU_X86_64 || POSH_CPU_PPC64 || NV_CPU_AARCH64 ++ #if NV_CPU_X86_64 || POSH_CPU_PPC64 || NV_CPU_ARM_64 + if (ptr == NULL) return true; + if (reinterpret_cast(ptr) < 0x10000ULL) return false; + if (reinterpret_cast(ptr) >= 0x000007FFFFFEFFFFULL) return false; diff --git a/graphics/nvidia-texture-tools/files/patch-src_nvtt_icbc.h b/graphics/nvidia-texture-tools/files/patch-src_nvtt_icbc.h new file mode 100644 index 000000000000..5959f1c8e852 --- /dev/null +++ b/graphics/nvidia-texture-tools/files/patch-src_nvtt_icbc.h @@ -0,0 +1,66 @@ +--- src/nvtt/icbc.h.orig 2020-08-24 06:27:21 UTC ++++ src/nvtt/icbc.h +@@ -1195,7 +1195,7 @@ union VFloat { + constexpr int VEC_SIZE = 4; + + union VFloat { +- vectro float v; ++ vector float v; + float e[4]; + VFloat() {} + VFloat(vector float v) : v(v) {} +@@ -1221,7 +1221,11 @@ ICBC_FORCEINLINE VFloat vload(const float * ptr) { + } + + ICBC_FORCEINLINE VFloat vload(const float * ptr) { +- return vec_ld(ptr) ++#if defined(__VSX__) ++ return vec_xl(0, ptr); ++#else ++ return vec_ld(0, ptr); ++#endif + } + + ICBC_FORCEINLINE VFloat operator+(VFloat a, VFloat b) { +@@ -1245,7 +1249,7 @@ ICBC_FORCEINLINE VFloat vrcp(VFloat a) { + vector float diff = vec_nmsub( estimate, v.vec, vec_splats( 1.0f ) ); + return vec_madd(diff, estimate, estimate ); + #else +- return vec_div(vec_splats(1),a); ++ return vec_div(vec_splats(1.0f), a); + #endif + } + +@@ -1276,7 +1280,7 @@ ICBC_FORCEINLINE VFloat lane_id() { + } + + ICBC_FORCEINLINE VFloat lane_id() { +- return (VFloat){ 0, 1, 2, 3 }; ++ return (vector float){ 0, 1, 2, 3 }; + } + + ICBC_FORCEINLINE VMask operator> (VFloat A, VFloat B) { return { vec_cmpgt(A, B) }; } +@@ -1291,6 +1295,23 @@ ICBC_FORCEINLINE VFloat vselect(VMask mask, VFloat a, + // mask ? b : a + ICBC_FORCEINLINE VFloat vselect(VMask mask, VFloat a, VFloat b) { + return vec_sel(a, b, mask); ++} ++ ++ICBC_FORCEINLINE bool all(VMask mask) { ++ return vec_all_ne(mask.v, vec_splats(0u)); ++} ++ ++ICBC_FORCEINLINE bool any(VMask mask) { ++ return vec_any_ne(mask.v, vec_splats(0u)); ++} ++ ++ICBC_FORCEINLINE uint mask(VMask mask) { ++ const vector unsigned int movemask = { 1, 2, 4, 8 }; ++ const vector unsigned int highbit = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 }; ++ ++ vector unsigned int bits = vec_and(vec_cmpeq(vec_and(mask.v, highbit), highbit), movemask); ++ ++ return bits[0] | bits[1] | bits[2] | bits[3]; + } + + ICBC_FORCEINLINE int reduce_min_index(VFloat v) {