Commit Graph

6135 Commits

Author SHA1 Message Date
Luke Usher 96211645e7
Merge pull request #1823 from RadWolfie/fix-audio-stream-flush
Fix Audio Stream Flush(Ex) Functions
2020-01-27 11:46:37 +00:00
RadWolfie 1197152b5a fix audio stream flush functions 2020-01-24 17:23:08 -06:00
Luke Usher d870b0c8e3
Merge pull request #1820 from RadWolfie/fix-audio-stream-packets
Fix Audio Stream Packets Process
2020-01-24 08:35:03 +00:00
RadWolfie a31f5f7e34 fix Gauntlet Dark Legacy intro videos by sleep longer 2020-01-22 12:20:06 -06:00
RadWolfie 6aae3548e6 improve stream's packets process 2020-01-22 12:20:06 -06:00
RadWolfie 8fb60f6806 put dsstream's packet functions into its own file 2020-01-22 12:13:13 -06:00
RadWolfie 54421832e5 fix audio stream's packet larger than host buffer size 2020-01-22 12:13:13 -06:00
RadWolfie 08691c24e1
Merge pull request #1818 from LukeUsher/fix-lrp-shader-hang
Fix hang in WWE Raw 2 after previous PR
2020-01-16 17:02:15 -06:00
Luke Usher f2ae91785c psh: skip FixOverusedRegisters on all LRP instructions 2020-01-16 22:24:20 +00:00
Luke Usher b64fcff530 Fix hang in WWE Raw 2 after previous PR 2020-01-16 20:57:23 +00:00
Luke Usher 3b06181c0c
Merge pull request #1811 from PatrickvL/avoid_lrp_error
Prevent error X5765 on pixel shader LPR opcode
2020-01-16 09:15:05 +00:00
Luke Usher 2c38dd6fe8
Merge pull request #1815 from RadWolfie/fix-default-audio-frequency
Fix Default Audio Frequency
2020-01-13 08:24:07 +00:00
RadWolfie a375faba51 fix audio frequency by set only given frequency value instead of from host function 2020-01-11 02:04:39 -06:00
Luke Usher 195795bd23
Merge pull request #1814 from RadWolfie/organize-directsound-plugin
Organize DirectSound Plugin (Part 1)
2020-01-10 17:34:07 +00:00
RadWolfie 7199f44cbb extend HLE DSOUND relative log modules 2020-01-08 18:30:26 -06:00
RadWolfie a57156fe4e split classes into their own files 2020-01-08 18:30:26 -06:00
RadWolfie 044d53c74f HOTFIX: add static in XADPCM.h file 2020-01-08 18:30:26 -06:00
RadWolfie b581073f07 remove duplicate log reports 2020-01-08 18:30:26 -06:00
PatrickvL 496de1218c
Merge pull request #1813 from LukeUsher/fix-hlsl-stack-overflow
Fix a crash when converting certain, large vertex shaders
2020-01-02 00:16:34 +01:00
Luke Usher e937bc13d9 Fix a crash when converting certain, large vertex shaders
This allows DOA3 to play again after it was broken by the HLSL work.

The cause of the crash was a Stack Overflow when compiling the shader,
caused by allocating a large object on the stack.

Instead, this commit allocates the XboxVertexShaderDecoder on the heap
instead, which thanks to the unique_ptr smart pointer, automatically
gets freed when it goes out of scope.
2020-01-01 22:29:28 +00:00
Luke Usher f101389704
Merge pull request #1812 from PatrickvL/trampoline_optimization
Trampoline optimization
2019-12-31 18:52:26 +00:00
PatrickvL cb4d27728c This moves construction of lookup strings outside call-locations towards a central LookupTrampolines() function, reducing the overhead of calling a trampoline down to a minimum. 2019-12-31 12:04:06 +01:00
patrickvl 36569f0d2e This prevents "error X5765: Dest register for LRP cannot be the same as first or third source register" in WWE RAW2.
A little background information :

When compiling pixel shaders, to facilitate later optimizations, FixOverusedRegisters() inserts MOV opcodes reading from constant, vertex color or texture registers, and writing to a free R register slot.

In this case, this transformed :

````
lrp r0, c0,r2,c1
````

into

````
mov r0, c0
lrp r0, r0,r2,c1
````

Not only introduces this a completely useless additional MOV (to R0, which is overwritten by the next LRP opcode), but it also results in LRP reading from R0, which is the same register it's writing to, which seems to be forbidden.

This fix prevents that from happening, by not-inserting a MOV when this situation would arise.

It's possible there exist more such scenario's, but let's tackle them when they are reported.

As for the other change in this commit : Instead of repeating a nearly identical while-loop three times, this loop is now wrapped in a for-loop, that handles all three versions (for PARAM_C, PARAM_V and PARAM_T type registers).
2019-12-26 14:56:28 +01:00
RadWolfie 8fd6253ad1
Merge pull request #1809 from PatrickvL/d3d-visibility-test_pvl
Implement BeginVisibilityTest, EndVisibilityTest and GetVisibilityTestResult
2019-12-25 12:13:24 -06:00
patrickvl a21cb8f0fd Clearer LOG_TEST_CASE message 2019-12-25 17:11:37 +01:00
PatrickvL e79a4e4131
Merge pull request #1808 from RadWolfie/sync-xbsymboldatabase
Update to Latest XbSymbolDatabase API Change
2019-12-25 16:37:11 +01:00
RadWolfie 5a5c3b67a5 update to latest XbSymbolDatabase API change 2019-12-25 09:08:41 -06:00
PatrickvL 0d43bc19aa Continue with Voxel9's work, and extend it with support for multiple indexed occlusion queries 2019-12-25 16:02:23 +01:00
Voxel9 fd2a0506af Add an explanation for the GetData while loop in GetVisibilityTestResult 2019-12-23 20:10:45 +00:00
Voxel9 1727b7e22b Add D3D query nullptr check for GetVisibilityTestResult 2019-12-23 18:52:48 +00:00
Voxel9 566136c195 Add checks for EndVisibilityTest 2019-12-23 18:44:19 +00:00
Voxel9 d45101a7f5 Check whether CreateQuery succeeds before accessing output 2019-12-22 23:37:02 +00:00
Voxel9 81b1e87594 Move, assign and prefix global query variable appropriately 2019-12-22 22:30:54 +00:00
Voxel9 f1db14b053 Implement BeginVisibilityTest, EndVisibilityTest and GetVisibilityTestResult 2019-12-22 20:00:36 +00:00
Luke Usher 806227e824
Merge pull request #1805 from PatrickvL/HLSL_fixes
HLSL fixes
2019-12-22 15:31:15 +00:00
patrickvl f97a642bc9 Fixed XDK Fog sample over-saturation by literally saturating all COLOR-semantic outputs (oD0, oD1, oB0 and oB1)!
Also updated the ARL bias, applied the frexp intrinsic to our LOGP function and updated LIT according to 6e3a387c01/src/Shader/ShaderCore.cpp (L1168)
2019-12-22 16:15:35 +01:00
Luke Usher 76d45fdd63
Merge pull request #1801 from PatrickvL/vsh_hlsl_pvl
Port to HLSL (High Level Shader Language) vertex shaders
2019-12-19 20:38:16 +00:00
Luke Usher f23c9adae1 Fix vertex state shader compilation in Spy vs Spy^ 2019-12-19 19:34:46 +00:00
PatrickvL 56af31aede Remove unneeded HostDeclarationSize 2019-12-19 18:16:36 +01:00
PatrickvL 270462d22c Replaced Parameter.Active with ParamCount 2019-12-19 17:12:52 +01:00
patrickvl f9410dace0 Added Register out-of-range LOG_TEST_CASE's
Named consistently CXBX specific vertex shader constants
2019-12-19 00:50:43 +01:00
patrickvl 1f83a28a01 Trigger test case popup (instead of just log) when vertex shader can't be compiled (which gives us valuable feedback for now).
Removed obsolete hostTemporaryRegisterCount variable
2019-12-18 22:56:28 +01:00
patrickvl f3d8120c6f Revert unrelated changes
Made RegVIsPresentInDeclaration a class XboxVertexDeclarationConverter protected data member.
2019-12-18 22:45:46 +01:00
patrickvl d28b4836fd Halve the selection of input attrbibute or constant, using lerp.
For this, made sure that the crossover value (as set in SetOverrideFlags) is either 0 or 1.

Also replaced the v0..v15 defines by actual variables. Instead, manually unrolled the initialization code via a concatenating define.
2019-12-18 21:45:44 +01:00
patrickvl 499297993c Remove IsMAC and replace it in HLSL generation with it's underlying condition 2019-12-18 20:12:25 +01:00
PatrickvL c3ad911049 Removed temporary CMake entries 2019-12-18 20:12:25 +01:00
PatrickvL 9634329033 Avoid regex_replace by cutting up HLSL template into two raw strings. 2019-12-18 20:12:25 +01:00
Anthony Miles 016f8361b5 Remove dummy shader fallback 2019-12-18 20:12:25 +01:00
Anthony Miles 13df253853 regex_replace first occurrence only 2019-12-18 20:12:25 +01:00
Anthony Miles 949aecd862 Set optimization level 0 2019-12-18 20:12:24 +01:00