Commit Graph

146 Commits

Author SHA1 Message Date
Ivan Avdeev 1f9b489bdc Merge remote-tracking branch 'upstream/master' into vulkan-upstream-merge-20231102 2023-11-02 11:31:59 -04:00
Alibek Omarov bf6829189e wscript: move XASH_BUILD_COMMIT definition to libpublic, as this is the only place where it's used, for faster builds 2023-10-31 04:30:27 +03:00
Alibek Omarov 6c40104c66 public: better fix for ExtractFilePath 2023-10-28 19:31:17 +03:00
Alibek Omarov fe407fbe00 public: workaround when empty string is passed to COM_ExtractFilePath (should make safe COM_ExtractFilePath) 2023-10-28 11:06:18 +03:00
Ivan Avdeev 1d90bb1835 imagelib: format new ktx2 code to codestyle 2023-10-16 12:30:12 -04:00
Ivan 'provod' Avdeev 2e2e17b008 imagelib: vk: add support for BC4
Tested with KTX2 and ref_vk
Added to DDS too.
Not added to any other renderers.
2023-10-13 21:47:22 -04:00
Ivan Avdeev 91e20382ad imagelib: expand KTX2 support to other renderers
Only for BC5 and BC6H formats for now.

However, adding new formats is easy:
1. Copy format's definition from `VkFormat` to `ktx2.h`
2. Map it to `PF_` format in `Image_KTX2Format()`
3. Done
4. Really, that should be it.
5. I mean, most formats would require PF_ enum extension, but we're not
   going to support all of them right?
2023-10-13 10:32:50 -04:00
Ivan Avdeev 4158234fb2 rename ktx_ to ktx2_ for consistency 2023-10-12 12:51:58 -04:00
Ivan Avdeev 90119ae84a imagelib: add rudimentary KTX2 support
It only does a very basic header validation, and passes the entire file
as PF_KTX2_RAW format. This is to simplify KTX2 reading in ref_vk and
trying out different formats. KTX2 has support for >200 format, and
passing all of them through PF_ types is a non-starter.

The plan is to figure out which formats we want to support, and add
their support to imagelib/ktx2 incrementally, leaving the rest as
PF_KTX2_RAW, so ref_vk still can use them.
2023-10-12 12:38:35 -04:00
Alibek Omarov fcc6bba88a Merge upstream/master 2023-10-07 00:53:04 +03:00
Alibek Omarov 4031f5cb01 public: allow matching anything in matchpattern 2023-07-05 07:00:39 +03:00
Alibek Omarov 777dd3a03c public: add definitions for PowerPC
This doesn't mean we have a port but at least it allows building for ppc64el
2023-07-03 01:40:47 +03:00
Alibek Omarov aee5e46516 public: rewrite Q_strncpy with standard C functions, make it inlined to allow compiler remove unneeded checks
So far, passes all tests.
2023-06-27 17:30:09 +03:00
Alibek Omarov 0d89849cab public: move some simple functions to mathlib header. Remove assembler version specific for MSVC6 2023-06-25 13:32:06 +03:00
Alibek Omarov d962255ebe public: mathlib: remove unused RemapVal, ApproachVal 2023-06-25 13:25:51 +03:00
Alibek Omarov 996897e30e public: use standard uint32_t in place of dword 2023-06-13 06:57:24 +03:00
Alibek Omarov 93ee5b9446 public: crclib: simplify CRC32_ProcessByte 2023-06-13 06:57:24 +03:00
Alibek Omarov c0c8119040 public: crclib: rework CRC32 code (thanks to @Mr0maks for implementation) 2023-06-13 06:57:24 +03:00
Alibek Omarov 59412f3d92 public: define XASH_MOBILE_PLATFORM by XASH_SAILFISH (defined externally) 2023-06-02 06:18:17 +03:00
Alibek Omarov 8caa2d142f scripts: sailfish: initial SailfishOS support 2023-06-02 05:37:13 +03:00
Alibek Omarov d75dcd358e public: restore unused, removed in upstream Matrix4x4_SetOrigin. Actually used in Vulkan fork 2023-04-28 17:33:23 +03:00
Alibek Omarov 48176233bd public: move FOV calculating functions out of libpublic, as they are very specific to engine view 2023-04-26 05:22:34 +03:00
Alibek Omarov ff436ae100 public: crtlib: add safe COM_DefaultExtension and COM_ReplaceExtension 2023-04-26 05:20:45 +03:00
Alibek Omarov fbdd79644b public: test new COM_FileBase and compare it's results with old implementation (embedded into test itself) 2023-04-26 05:20:45 +03:00
Alibek Omarov ac39090f6e public: crtlib: add safe COM_FileBase implementation 2023-04-26 05:20:45 +03:00
Alibek Omarov 8f207362a5 public: remove Q_sprintf, and patch all code that used it to use Q_snprintf instead 2023-04-26 05:20:45 +03:00
Alibek Omarov b16fa8eddc public: remove Q_strcat and Q_strcpy, and patch the code that uses it 2023-04-26 05:20:45 +03:00
Alibek Omarov b333edeefe public: crtlib: remove unused Q_strlwr macro 2023-04-23 18:31:08 +03:00
Alibek Omarov 096ee34f67 public: remove Q_vsprintf, replace by proper Q_vsnprintf proper calls
Fixes weird off by one error caused by glibc updates? I didn't tracked
what causes it exactly but replacing it seems to work. Anyway, we should
remove all 99999 hacks in libpublic.
2023-04-23 18:19:28 +03:00
Alibek Omarov 49936120ca public: tests: add new test to check return values of Q_Architecture/PlatformStringByID and Q_buildnum 2023-04-17 19:11:16 +03:00
Alibek Omarov e4a5b95e81 public: build: split Q_buildnum to separate function that calculates build number from arbitrary date string 2023-04-17 19:10:40 +03:00
Alibek Omarov 84fc8d4281 public: build: fix naming for 32-bit RISCV with double precision float ABI 2023-04-17 19:09:59 +03:00
Alibek Omarov e9da3e2976 public: build: reorder enums by probability, rename ARCHITECTURE_ ABI macros to just ARCH_ for easier matching 2023-04-17 06:37:08 +03:00
Alibek Omarov 339c08d89f public: add basic test for our strcpy, strcmp and strcat functions 2023-04-13 19:56:31 +03:00
Alibek Omarov 2fb19a0cfd public: matrixlib: cleanup unused functions 2023-04-03 05:14:59 +03:00
Alibek Omarov 550ced9c36 ref: gl: cleanup unused functions in frustum 2023-04-03 05:05:32 +03:00
Alibek Omarov 37e3cf7e86 public: crtlib: remove unused functions 2023-04-03 02:46:23 +03:00
Alibek Omarov 53987f47e2 engine: client: use alternative ease-in ease-out function in sound fade 2023-03-30 04:40:54 +03:00
Alibek Omarov 19a785a98a public: mathlib: convert rsqrt to use float_bits_t union 2023-03-14 21:29:35 +03:00
Alibek Omarov b96bfcfe7a public: mathlib: convert FloatToHalf and HalfToFloat to use float_bits_t union 2023-03-14 21:29:35 +03:00
Alibek Omarov 412c635499 public: add float_bits_t union to access float as 32-bit signed or unsigned integer 2023-03-14 21:29:35 +03:00
Alibek Omarov fb6e310eab public: move va() function back to engine, it's not recommended to use in shared modules 2023-03-13 02:44:59 +03:00
Alibek Omarov 5c1e06ae74 public: crclib: optimize COM_HashKey, implement typical djb hashing as this function is used for hashtables with string lookup 2023-03-13 02:37:19 +03:00
fgsfds 7424b29e56 engine: initial psvita build support 2023-03-11 07:09:14 +03:00
Alibek Omarov 3c64d2ad80 public: build: don't confuse other libcs with built with glibc game libraries by specifying them into separate platform, like Android 2023-03-11 05:45:11 +03:00
Alibek Omarov 3765686077 public: make va() buffer size public 2023-03-11 05:28:17 +03:00
Alibek Omarov f4069de7f2 engine: move SlerpBones, CalcBonePosition/Quaternion from engine to libpublic 2023-02-13 05:23:13 +03:00
fgsfds 0e7ebf6d44 Merge branch 'master' of https://github.com/FWGS/xash3d-fwgs into switch_newer 2023-02-08 00:56:20 +01:00
Alibek Omarov 03a7c67731 public: build: revert arm64 renaming to aarch64, we shouldn't enforce naming changes without a reason 2023-02-08 00:03:15 +03:00
fgsfds 25a1cb8ce7 Nintendo Switch support (again) 2023-02-05 02:09:32 +01:00