bff264b5fd
Fixed RtlCompareString and RtlCompareStringN, they were very wrong, for CompareString the params are struct ptrs not char ptrs Fixed a ton of clang-cl compiler warnings about unused variables, still many left. Fixed a lot of inconsistent override ones too
chss95cs@gmail.com
2022-10-30 10:47:09 -07:00
65b9d93551
Merge branch 'xenia-canary:canary_experimental' into canary_experimental
chrisps
2022-10-30 09:05:40 -07:00
f5cc54bdae
Fix building on clang-cl, it did not like the cxxopts selectany changes
chss95cs@gmail.com
2022-10-30 09:05:10 -07:00
550d1d0a7c
use much faster exp2/cos approximations in ffmpeg, large decrease in cpu usage on my machine on decoder thread properly byteswap r13 for spinlock Add PPCOpcodeBits stub out broken fpscr updating in ppc_hir_builder. it's just code that repeatedly does nothing right now. add note about 0 opcode bytes being executed to ppc_frontend Add assert to check that function end is greater than function start, can happen with malformed functions Disable prefetch and cachecontrol by default, automatic hardware prefetchers already do the job for the most part minor cleanup in simplification_pass, dont loop optimizations, let the pass manager do it for us Add experimental "delay_via_maybeyield" cvar, which uses MaybeYield to "emulate" the db16cyc instruction Add much faster/simpler way of directly calling guest functions, no longer have to do a byte by byte search through the generated code Generate label string ids on the fly Fix unused function warnings for prefetch on clang, fix many other clang warnings Eliminated majority of CallNativeSafes by replacing them with naive generic code paths. ^ Vector rotate left, vector shift left, vector shift right, vector shift arithmetic right, and vector average are included These naive paths are implemented small loops that stash the two inputs to the stack and load them in gprs from there, they are not particularly fast but should be an order of magnitude faster than callnativesafe to a host function, which would involve a call, stashing all volatile registers, an indirect call, potentially setting up a stack frame for the arrays that the inputs get stashed to, the actual operations, a return, loading all volatile registers, a return, etc Added the fast SHR_V128 path back in Implement signed vector average byte, signed vector average word. previously we were emitting no code for them. signed vector average byte appears in many games Fix bug with signed vector average 32, we were doing unsigned shift, turning negative values into big positive ones potentially
chss95cs@gmail.com
2022-10-30 08:48:58 -07:00
55877f4c61
[APU] Force buffer swap at the end of stream
Gliniak
2022-10-25 17:20:45 +02:00
6b11787c93
[APU] Fixed typo that prevented last packet in stream to be processed
Gliniak
2022-10-24 21:33:25 +02:00
fac2a89d0f
Disallow offset to be set before header, header size fix, audio channels crashfix
Gliniak
2022-10-24 19:40:21 +02:00
cdb40ddb28
[DXBC] Fix interpolator copying from v# to r# in PS
Triang3l
2022-10-18 13:12:20 +03:00
d8b7b3ecec
Fix bindless path in d3d12 that i broke in earlier commit (did not affect any users, thats a debug thing) Fix guest code profiler, it previously only worked with function precomp + all code you were about to execute already discovered Allow AndNot if type is V128
chss95cs@gmail.com
2022-10-16 07:48:43 -07:00
b41e5060da
Fix bindless path in d3d12 that i broke in earlier commit (did not affect any users, thats a debug thing) Fix guest code profiler, it previously only worked with function precomp + all code you were about to execute already discovered Allow AndNot if type is V128
chss95cs@gmail.com
2022-10-16 07:47:27 -07:00
22e52cbecd
Canary can now run on sandy bridge/e and ivy bridge/e Stubbed out OPCODE_AND_NOT, its fallback implementation if bmi1 was not supported was broken. it's difficult to tell where the actual issue is there.
chss95cs@gmail.com
2022-10-15 05:14:53 -07:00
d7fa8481af
Switch cxxopts over to version with selectany while i wait for the selectany change to be merged there
chss95cs@gmail.com
2022-10-15 03:49:12 -07:00
a495709344
Merge branch 'xenia-canary:canary_experimental' into canary_experimental
chrisps
2022-10-15 03:07:35 -07:00
efbeae660c
Drastically reduce cpu time wasted by XMADecoderThread spinning, went from 13% of all cpu time to about 0.6% in my tests Commented out lock in WatchMemoryRange, lock is always held by caller properly set the value/check the irql for spinlocks in xboxkrnl_threading
chss95cs@gmail.com
2022-10-15 03:07:07 -07:00
2dd6f33f4b
Fix debug/ui premake too
chss95cs@gmail.com
2022-10-08 10:34:50 -07:00
bcd57f8663
Merge branch 'xenia-canary:canary_experimental' into canary_experimental
chrisps
2022-10-08 10:11:30 -07:00
d8c94b1aee
Fix premake filter mistake that broke debug builds (and likely any build other than release)
chss95cs@gmail.com
2022-10-08 10:10:36 -07:00
8f7f7dc6ad
fixed wine crash from use of NtSetEventPriorityBoost add xe::clear_lowest_bit, use it in place of shift-andnot in some bit iteration code make is_allocated_ and is_enabled_ volatile in xma_context preallocate avpacket buffer in XMAContext::Setup, the reallocations of the buffer in ffmpeg were showing up on profiles check is_enabled and is_allocated BEFORE locking an xmacontext. XMA worker was spending most of its time locking and unlocking contexts Removed XeDMAC, dma:: namespace. It was a bad idea and I couldn't make it work in the end. Kept vastcpy and moved it to the memory namespace instead Made the rest of global_critical_region's members static. They never needed an instance. Removed ifdef'ed out code from ring_buffer.h Added EventInfo struct to threading, added Event::Query to aid with implementing NtQueryEvent. Removed vector from WaitMultiple, instead use a fixed array of 64 handles that we populate. WaitForMultipleObjects cannot handle more than 64 objects. Remove XE_MSVC_OPTIMIZE_SMALL() use in x64_sequences, x64 backend is now always size optimized because of premake Make global_critical_region_ static constexpr in shared_memory.h to get rid of wasteage of 8 bytes (empty class=1byte, +alignment for next member=8) Move trace-related data to the tail of SharedMemory to keep more important data together In IssueDraw build an array of fetch constant addresses/sizes, then pre-lock the global lock before doing requestrange for each instead of individually locking within requestrange for each of them Consistent access specifier protected for pm4_command_processor_declare Devirtualize WriteOneRegisterFromRing. Move ExecutePacket and ExecutePrimaryBuffer to pm4_command_buffer_x Remove many redundant header inclusions access xenia-gpu Minor microoptimization of ExecutePacketType0
chss95cs@gmail.com
2022-10-08 09:55:17 -07:00
bae63b95c5
Update to latest version of cxxopts
chss95cs@gmail.com
2022-09-30 06:51:25 -07:00
b4c175d8a3
Enable SDL_LEAN_AND_MEAN, SDL_RENDER_DISABLED, saves about 500kb in final exe
chss95cs@gmail.com
2022-09-29 07:26:38 -07:00
7e58a3b320
Fix compiler errors i introduced under clang-cl remove xe_kernel_export_shim_fn field of Export function_data, trampoline is now the only way exports get invoked Remove kernelstate argument from string functions in order to conform to the trampoline signature (the argument was unused anyway) Constant-evaluated initialization of ppc_opcode_disasm_table, removal of unused std::vector fields Constant-evaluated initialization of export tables name field on export is just a const char* now, only immutable static strings are ever passed to it Remove unused callcount field of export. PM4 compare op function extracted Globally apply /Oy, /GS-, /Gw on msvc windows Remove imgui testwindow code call, it took up like 300 kb
chss95cs@gmail.com
2022-09-29 07:04:17 -07:00
d0acd68369
Merge branch 'xenia-canary:canary_experimental' into canary_experimental
chrisps
2022-09-17 07:05:24 -04:00
eb8154908c
atomic cas use prefetchw if available remove useless memorybarrier remove double membarrier in wait pm4 cmd add int64 cvar use int64 cvar for x64 feature mask Rework some functions that were frontend bound according to vtune placing some of their code in different noinline functions, profiling after indicating l1 cache misses decreased and perf of func increased remove long vpinsrd dep chain code for conversion.h, instead do normal load+bswap or movbe if avail Much faster entry table via split_map, code size could be improved though GetResolveInfo was very large and had impact on icache, mark callees as noinline + msvc pragma optimize small use log2 shifts instead of integer divides in memory minor optimizations in PhysicalHeap::EnableAccessCallbacks, the majority of time in the function is spent looping, NOT calling Protect! Someone should optimize this function and rework the algo completely remove wonky scheduling log message, it was spammy and unhelpful lock count was unnecessary for criticalsection mutex, criticalsection is already a recursive mutex brief notes i gotta run
chss95cs@gmail.com
2022-09-17 04:04:53 -07:00
0fd4a2533b
Prevent clang-format from moving d3d12_nvapi above the require d3d12 headers
chss95cs@gmail.com
2022-09-11 14:35:33 -07:00
20638c2e61
use Sleep(0) instead of SwitchToThread, should waste less power and help the os with scheduling. PM4 buffer handling made a virtual member of commandprocessor, place the implementation/declaration into reusable macro files. this is probably the biggest boost here. Optimized SET_CONSTANT/ LOAD_CONSTANT pm4 ops based on the register range they start writing at, this was also a nice boost
chss95cs@gmail.com
2022-09-11 14:14:48 -07:00
9a6dd4cd6f
Merge branch 'xenia-canary:canary_experimental' into canary_experimental
chrisps
2022-09-05 09:08:46 -04:00
0c576877c8
Add constant folding for LVR when 16 aligned, clean up prior commit by removing dead test code for LVR/LVL/STVL/STVR opcodes and legacy hir sequence Delay using mm_pause in KeAcquireSpinLockAtRaisedIrql_entry, a huge amount of time is spent spinning in halo3
chss95cs@gmail.com
2022-09-04 11:44:29 -07:00
d372d8d5e3
nasty commit with a bunch of test code left in, will clean up and pr
chss95cs@gmail.com
2022-09-04 11:04:41 -07:00
f62ac9868a
Make portable default for new install
illusion0001
2022-08-31 12:01:19 -05:00
5476d5e422
Merge branch 'xenia-canary:canary_experimental' into canary_experimental
chrisps
2022-09-04 14:45:03 -04:00
2e5c4937fd
Add constant folding for LVR when 16 aligned, clean up prior commit by removing dead test code for LVR/LVL/STVL/STVR opcodes and legacy hir sequence Delay using mm_pause in KeAcquireSpinLockAtRaisedIrql_entry, a huge amount of time is spent spinning in halo3
chss95cs@gmail.com
2022-09-04 11:44:29 -07:00
c6010bd4b1
nasty commit with a bunch of test code left in, will clean up and pr
chss95cs@gmail.com
2022-09-04 11:04:41 -07:00
78c9a48bc2
also use vastcpy for shared memory page stuff
chss95cs@gmail.com
2022-08-28 14:52:12 -07:00
f31869092c
Fixed a bug with readback_resolve and readback_memexport that was responsible for a large portion of their overhead. readback_memexport and resolve are now usable for games, depending on your hardware. in my case games that were slideshows now run at like 20-30 fps, and my hardware isnt the best for xenia. add split_map class for mapping keys to values in a way that optimizes for frequent searches and infrequent insertions/removals remove jump table implementation of GetColorRenderTargetFormatComponentCount, it was appearing relatively high in profiles. instead pack the component counts into a single 32 bit word, which is indexed by shifting Add cvar to align all basic blocks to a boundary Add mmio aware load paths liberally apply XE_RESTRICT in ringbuffer related code Removed the IS_TRUE and IS_FALSE opcodes, they were pointless duplicates of COMPARE_EQ/COMPARE_NE and i want to simplify our set of opcodes for future backends More work on LVSR/LVSL/STVR/STVL opcodes Optimized X64 translated code emission, now only compute instrkey once Add code for pre-computing integer division magic numbers Optimized GetHostViewportInfo a little Move args for GetHostViewportInfo into a class, cache the result and compare for future queries. moved GetHostViewportInfo far lower on the profile Add (currently not functional, and very racy) asynchronous memcpy code. will improve it and actually use it in future commits. Add non-temporal memcpy function for huge page-aligned allocations. Used for copying to shared memory/readback hoist are_accumulated_render_targets_valid_ check out of loop in render_target_cache already bound check. Add stosb/movsb code for small constant memcpys/memsets that arent worth the overhead of memcpy/memset
chss95cs@gmail.com
2022-08-28 14:24:25 -07:00
b5ef3453c7
Disable most XOP code by default, the manual must be wrong for the shifts or we must be assembling them incorrectly, will return to it later and fix comparisons and select done by xop are fine though
chss95cs@gmail.com
2022-08-21 12:32:33 -07:00
b26c6ee1b8
Fix some more constant folding fabsx does NOT set fpscr turns out that our vector unsigned compare instructions are a bit wierd?
chss95cs@gmail.com
2022-08-21 10:27:54 -07:00
0ebc109d4d
add initial xop codepaths, still need to finish the rest of the compares, and then do shifts, rotates, and PERMUTE Add vector simplification pass, so far it only recognizes whether VECTOR_DENORMFLUSH is useless and optimizes them away Tag restgplr/savegplr/restvmx/savevmx/restfpr/savefpr with useful information, i intend to inline them (they tend to be the most heavily called guest functions)
chss95cs@gmail.com
2022-08-21 08:55:42 -07:00
d85bfc1894
Dont constant evaluate MAX with V128! Fix signed zeroes behavior for vmaxfp emulation, was causing a block in sonic to move perpetually, very slowly
chss95cs@gmail.com
2022-08-20 14:22:05 -07:00
457296850e
Add OPCODE_NEGATED_MUL_ADD/OPCODE_NEGATED_MUL_SUB Proper handling of nans for VMX max/min on x64 (minps/maxps has special behavior depending on the operand order that vmx does not have for vminfp/vmaxfp) Add extremely unintrusive guest code profiler utilizing KUSER_SHARED systemtime. This profiler is disabled on platforms other than windows, and on windows is disabled by default by a cvar Repurpose GUEST_SCRATCH64 stack offset to instead be for storing guest function profile times, define GUEST_SCRATCH as 0 instead, since thats already meant to be a scratch area Fix xenia silently closing on config errors/other fatal errors by setting has_console_attached_'s default to false Add alternative code path for guest clock that uses kusershared systemtime instead of QueryPerformanceCounter. This is way faster and I have tested it and found it to be working, but i have disabled it because i do not know how well it works on wine or on processors other than mine Significantly reduce log spam by setting XELOGAPU and XELOGGPU to be LogLevel::Debug Changed some LOGI to LOGD in places to reduce log spam Mark VdSwap as kHighFrequency, it was spamming up logs Make logging calls less intrusive for the caller by forcing the test of log level inline and moving the format/AppendLogLine stuff to an outlined cold function Add swcache namespace for software cache operations like prefetches, streaming stores and streaming loads. Add XE_MSVC_REORDER_BARRIER for preventing msvc from propagating a value too close to its store or from its load Add xe_unlikely_mutex for locks we know have very little contention add XE_HOST_CACHE_LINE_SIZE and XE_RESTRICT to platform.h Microoptimization: Changed most uses of size_t to ring_size_t in RingBuffer, this reduces the size of the inlined ringbuffer operations slightly by eliminating rex prefixes, depending on register allocation Add BeginPrefetchedRead to ringbuffer, which prefetches the second range if there is one according to the provided PrefetchTag added inline_loadclock cvar, which will directly use the value of the guest clock from clock.cc in jitted guest code. off by default change uses of GUEST_SCRATCH64 to GUEST_SCRATCH Add fast vectorized xenos_half_to_float/xenos_float_to_half (currently resides in x64_seq_vector, move to gpu code maybe at some point) Add fast x64 codegen for PackFloat16_4/UnpackFloat16_4. Same code can be used for Float16_2 in future commit. This should speed up some games that use these functions heavily Remove cvar for toggling old float16 behavior Add VRSAVE register, support mfspr/mtspr vrsave Add cvar for toggling off codegen for trap instructions and set it to true by default. Add specialized methods to CommandProcessor: WriteRegistersFromMem, WriteRegisterRangeFromRing, and WriteOneRegisterFromRing. These reduce the overall cost of WriteRegister Use a fixed size vmem vector for upload ranges, realloc/memsetting on resize in the inner loop of requestranges was showing up on the profiler (the search in requestranges itself needs work) Rename fixed_vmem_vector to better fit xenia's naming convention Only log unknown register writes in WriteRegister if DEBUG :/. We're stuck on MSVC with c++17 so we have no way of influencing the branch ordering for that function without profile guided optimization Remove binding stride assert in shader_translator.cc, triangle told me its leftover ogl stuff Mark xe::FatalError as noreturn If a controller is not connected, delay by 1.1 seconds before checking if it has been reconnected. Asking Xinput about a controller slot that is unused is extremely slow, and XinputGetState/SetState were taking up an enormous amount of time in profiles. this may have caused a bit of input lag Protect accesses to input_system with a lock Add proper handling for user_index>= 4 in XamInputGetState/SetState, properly return zeroed state in GetState Add missing argument to NtQueryVirtualMemory_entry Fixed RtlCompareMemoryUlong_entry, it actually does not care if the source is misaligned, and for length it aligns down Fixed RtlUpperChar and RtlLowerChar, added a table that has their correct return values precomputed
chss95cs@gmail.com
2022-08-20 11:40:19 -07:00
f551e59015
CI: Remove game patches
Margen67
2022-08-19 03:39:29 -07:00
7cc364dcb8
squash reallocs in command buffers by using large prealloced buffer, directly use virtual memory with it so os allocs on demand mark raw clock functions as noinline, the way msvc was inlining them and ordering the branches meant that rdtsc would often be speculatively executed add alternative clock impl for win, instead of using queryperformancecounter we grab systemtime from kusershared. it does not have the same precision as queryperformancecounter, we only have 100 nanosecond precision, but we round to milliseconds so it never made sense to use the performance counter in the first place stubbed out the "guest clock mutex"... (the entirety of clock.cc needs a rewrite) added some helpers for minf/maxf without the nan handling behavior
chss95cs@gmail.com
2022-08-14 13:42:08 -07:00
c9b2d10e17
alternative mutex impl on windows works but i really can't tell if it helps much. use larger size in deferred_command_list to cut down on resizes in big scenes on m:dur
chss95cs@gmail.com
2022-08-14 10:26:50 -07:00
a037bdb2e8
Point ffmpeg submodule to the branch with the nonrecursive split_radix_permutation
chss95cs@gmail.com
2022-08-14 09:20:04 -07:00
e5d01af6a6
trying to get new disruptorplus module path to be used
chss95cs@gmail.com
2022-08-14 09:16:40 -07:00
08f7a28920
Alternative mutex
chss95cs@gmail.com
2022-08-14 08:59:11 -07:00