Commit Graph

49 Commits

Author SHA1 Message Date
Gliniak
ce9a82ccf8 Merge branch 'master' of https://github.com/xenia-project/xenia into canary_experimental 2023-09-01 18:20:29 +02:00
Triang3l
53f98d1fe6 [GPU/D3D12] Memexport from anywhere in control flow + 8/16bpp memexport
There's no limit on the number of memory exports in a shader on the real
Xenos, and exports can be done anywhere, including in loops. Now, instead
of deferring the exports to the end of the shader, and assuming that export
allocs are executed only once, Xenia flushes exports when it reaches an
alloc (allocs terminate memory exports on Xenos, as well as individual ALU
instructions with `serialize`, but not handling this case for simplicity,
it's only truly mandatory to flush memory exports before starting a new
one), the end of the shader, or a pixel with outstanding exports is killed.

To know which eM# registers need to be flushed to the memory, traversing
the successors of each exec potentially writing any eM#, and specifying
that certain eM# registers might have potentially been written before each
reached control flow instruction, until a flush point or the end of the
shader is reached.

Also, some games export to sub-32bpp formats. These are now supported via
atomic AND clearing the bits of the dword to replace followed by an atomic
OR inserting the new byte/short.
2023-05-05 21:32:02 +03:00
chss95cs@gmail.com
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

Add TextureCache::RequestTextures for batch invocation of LoadTexturesData

Add TextureCache::LoadTexturesData for reducing the number of times we release and reacquire the global lock.
Ideally you should hold the global lock for as little time as possible, but if you are constantly acquiring and releasing it you are actually more likely to have contention
Add already_locked param to ObjectTable::LookupObject to help with reducing lock acquire/release pairs
Add missing checks to XAudioRegisterRenderDriverClient_entry. this is unlikely to fix anything, it was just an easy thing to do
Add NtQueryEvent system call implementation. I don't actually know of any games that need it.
Instead of using std::vector + push_back in KeWaitForMultipleObjects and xeNtWaitForMultipleObjectsEx use a fixed size array of 64 and track the count. More than 64 objects is not permitted by the kernel. The repeated reallocations from push_back were appearing unusually high on the profiler, but were masked until now by waitformultipleobjects natural overhead
Pre-lock the global lock before looking up each handle for xeNtWaitForMultipleObjectsEx and KeWaitForMultipleObjects.
Pre-lock before looking up the signal and waiter in NtSignalAndWaitForSingleObjectEx
add missing checks to NtWaitForMultipleObjectsEx
Support pre-locking in XObject::GetNativeObject
2022-10-08 09:55:17 -07:00
Triang3l
b2b1d7b518 [GPU] More accurate vertex kill + PsParamGen/point documentation 2022-04-27 23:10:56 +03:00
Triang3l
5519dbb39f [GPU] Shader control flow documentation improvements 2022-04-27 21:34:08 +03:00
Triang3l
b42680abf7 [GPU] Shader ALU refactoring + documentation
Mainly move instruction info from the ShaderTranslator to xe::gpu::ucode for future use in the CPU shader interpreter
2022-04-27 20:52:20 +03:00
Triang3l
fea430f1f9 [GPU] Fix scalar c[#+aL], shader docs/refactoring 2022-04-13 23:08:19 +03:00
Triang3l
d6188c5d7e [GPU] Reuse base+index*stride in vfetch_mini instead of reloading the index GPR
The wheel shader in 4D530910 does vfetch_full to r0 with the index from r0.x, and then vfetch_mini.
Thanks @Gliniak for the finding :3
Also small formatting cleanup in commented-out code.
2022-01-09 14:58:38 +03:00
Triang3l
fdec0ab332 [Code] Make union usage more consistent 2021-11-03 20:45:09 +03:00
Triang3l
e720e0a540 [Code] Remove game names from code comments (most of at least) 2021-09-05 21:27:40 +03:00
Triang3l
f39020700a [GPU] Cleanup: XEPACKED -> static_assert_size/alignas 2021-05-16 14:03:36 +03:00
Triang3l
c7fbe0e6d5 [GPU] Scale gradients by SSAA factor 2020-12-20 16:35:15 +03:00
Triang3l
e6fa0ad139 [GPU] Dynamic r# count via shader modifications + refactoring 2020-12-19 16:14:54 +03:00
Triang3l
8bcfcf6452 [GPU] Update v_mad_legacy_f32 comment 2020-12-10 12:39:02 +03:00
Triang3l
9a4643d0f2 [GPU] Non-ROV f24 trunc/round, host shader modifications, cache dir 2020-12-07 22:31:46 +03:00
Triang3l
feb8258a5e [DXBC] Multiplication signed zero handling 2020-10-30 22:14:38 +03:00
Triang3l
4bb0ca0e09 [GPU] Move all xenos.h to gpu::xenos, disambiguate Dimension/TextureDimension 2020-07-11 15:54:22 +03:00
Triang3l
8a64861ec0 [DXBC] New tfetch: pre-swizzle signs, additive LOD + refactoring 2020-06-06 19:12:34 +03:00
Triang3l
aa73d652ba [DXBC] OpenGL snorm vfetch because why not 2020-05-24 19:25:35 +03:00
Triang3l
3879ff29b3 [DXBC/GPU] vfetch to new codegen, signed vfetch offset, fix AND with system flags 2020-05-23 17:15:11 +03:00
Triang3l
814990f686 [DXBC] ALU scalar ops to new codegen 2020-05-10 20:57:33 +03:00
Triang3l
b79ba69548 [DXBC] ALU vector ops to new codegen 2020-05-10 16:33:39 +03:00
Triang3l
3aa0ce3096 [GPU] Shader translator refactoring (mostly ALU), fixes for disassembly round trip and write masks 2020-05-08 23:57:51 +03:00
Triang3l
f7ad631057 [GPU] ucode doc: revert one accidentally changed character 2020-04-26 17:01:01 +03:00
Triang3l
07e4f84c2b [GPU] ucode doc: A2xx ALU names, DX9 rules, cube 2020-04-26 16:53:13 +03:00
Triang3l
a9ed73bdd1 [GPU] Remove most hardcoded register/instruction layouts from common and D3D12 code 2019-10-20 19:40:37 +03:00
Triang3l
84a8dc91e4 [D3D12] Filtering between array texture layers 2019-09-03 10:14:25 +03:00
Triang3l
da280347c4 Merge branch 'master' into d3d12 2018-11-22 21:01:05 +03:00
Margen67
896ac4a682 Update documentation.
- Convert http to https, provide archive link when possible.
- Made CPU-JIT.png more readable on dark themes;
Added a white background so there isn't black text on a black
background.
2018-11-22 09:20:09 -06:00
Triang3l
aef0675c31 [GPU] Don't ignore vector instructions with side effects when they write to nowhere 2018-10-23 22:46:03 +03:00
Triang3l
2b03a9e095 [GPU] Synchronize GPU frontend with the D3D12 branch 2018-10-22 23:28:52 +03:00
Triang3l
2a98d29eda [D3D12] DXBC: Most of tfetch 2018-09-11 22:57:08 +03:00
Triang3l
db87efdfaa [D3D12] DXBC: Most scalar opcodes 2018-09-05 16:38:47 +03:00
DrChat
55d2c03943 [GPU] Rename a few misnamed vfetch fields 2017-12-18 17:24:52 -06:00
Ben Vanik
95d3a9c345 Minor clang warning fixes. 2016-01-01 06:01:22 +00:00
Ben Vanik
51a8002629 Moving GL backend to new shader translator.
This seems to make a lot of things better, but may also break things.
Cleanup to follow.
2015-12-06 00:48:41 -08:00
Ben Vanik
2b3b423776 Mostly complete new GLSL translator (modulo flow control). 2015-12-05 17:44:06 -08:00
Ben Vanik
0058cae901 Adding pseudo code for all ucode ops from AMD docs. 2015-12-05 03:10:45 -08:00
Ben Vanik
d2f7cc1602 Reworking translator code to be pretty sexy. 2015-11-29 16:55:42 -08:00
Ben Vanik
65130edaa1 First pass ShaderTranslator base type, able to disasm in msft style. 2015-11-28 16:19:04 -08:00
Ben Vanik
2f1d49aa32 xenia-gpu mostly clang clean. 2015-07-19 21:48:47 -07:00
Ben Vanik
5bd7833e87 More clang fixes. xenia-kernel is clean. 2015-07-19 21:29:06 -07:00
Ben Vanik
ecd4af10c9 Fixing some clang warnings/errors. 2015-07-15 23:26:58 -07:00
Ben Vanik
e3220f7ae6 Code cleanup: moving poly/ into xenia/base/ 2015-05-02 03:42:51 -07:00
Ben Vanik
30f7effa73 Code cleanup: removing common.h 2015-05-02 01:25:59 -07:00
Ben Vanik
795df80687 Possibly right const addressing and more shader instructions. 2015-03-15 11:20:19 -07:00
Ben Vanik
00e4a4fe1b Fix #include format. 2015-01-31 22:49:47 -08:00
Ben Vanik
8b8d692f06 Partial shader instr predication. 2015-01-01 22:55:10 -08:00
Ben Vanik
577ab0a4f1 Main window, empty GPU files. 2014-12-31 19:26:53 -08:00