Commit Graph

913 Commits

Author SHA1 Message Date
patrickvl 311e1037a6 Move D3DDevice_SelectVertexShader implementation to XbVertexShader.cpp 2020-04-30 14:49:10 +02:00
patrickvl ddc5d14c52 Move g_VertexShaderSource macro towards VertexShaderSource.cpp (in preparation for the next commit, that's going to use it) 2020-04-30 14:48:04 +02:00
patrickvl e94be42c40 Fix compile warning on not-supported LOG_TEST_CASE macro argument
Fix compile warning on implicit type cast
2020-04-30 14:39:02 +02:00
patrickvl 7bab062ff5 Move D3DDevice_SetVertexShaderConstant implementation to XbVertexShader.cpp 2020-04-30 14:36:59 +02:00
patrickvl 5a222185a3 Move D3DDevice_SetVertexShader implementation to XbVertexShader.cpp 2020-04-30 14:28:32 +02:00
patrickvl ea5f494a8e Move DEBUG_D3DRESULT macro towards XbD3D8Logging.h (in preparation for the next commit, that's going to use it) 2020-04-30 14:27:17 +02:00
patrickvl cc7e1a4069 Fix compile warning on not-supported LOG_TEST_CASE macro arguments 2020-04-30 14:21:13 +02:00
patrickvl 3db98e4e90 Move implementation of D3DDevice_LoadVertexShader towards XbVertexShader.cpp 2020-04-30 13:58:27 +02:00
patrickvl 848f4eeee3 Hide vertex slots behind GetCxbxVertexShaderSlotPtr (which also logs out of range test cases) 2020-04-29 19:08:15 +02:00
patrickvl c1b58dafb9 Remove everything related to no-longer-set HostFVF variable 2020-04-29 15:14:27 +02:00
Anthony Miles a2b5d2c466 Improve shader slot emulation 2020-04-27 11:18:16 +12:00
Anthony Miles eaa095e8a2 - Rename VertexShaderInfo to VertexDeclaration
- Move declaration related fields to CxbxVertexShader.Declaration
2020-04-26 22:01:22 +12:00
RadWolfie c27da955ab replace placeholder to working emulate_system variable set 2020-04-17 14:54:01 +02:00
RadWolfie d2f104f251 change KB/MB to KiB/MiB 2020-04-14 20:24:19 -05:00
RadWolfie 1a1019b85c replace hardcode 384 to blocks_reserved_t plus add comments 2020-04-14 20:24:19 -05:00
RadWolfie 897bc182f8 use enum class for XbeType to resolve warnings 2020-04-14 20:24:19 -05:00
RadWolfie 55f84cd67e move functions into their own locations 2020-04-14 20:24:19 -05:00
RadWolfie 2ead1e0fe0 move address ranges into AddressRanges header file 2020-04-14 20:24:18 -05:00
RadWolfie af3858c0d8 add todo comments 2020-04-14 20:24:18 -05:00
RadWolfie fb7398d7c9 Get maximum reserve memory ranges from host.
Plus more fixup to manage reliable memory design on loader launch and emulator.
2020-04-14 20:24:18 -05:00
RadWolfie 8a33562dc8 fix standalone persisted memory support 2020-04-14 20:24:18 -05:00
RadWolfie b20a970b1d fix shared memory reboot loss 2020-04-14 20:24:18 -05:00
RadWolfie 7fca148bc6 implement toggle loader project in GUI 2020-04-14 20:24:18 -05:00
RadWolfie 0f38209e4b use std map pairs instead of string for cli usage
Plus enable individual memory shared settings and lock data file path hash whenever in used.
2020-04-14 20:24:18 -05:00
ergo720 11c046e0aa Suppress warning 4200 (alternative method) 2020-04-14 20:24:18 -05:00
ergo720 446b7efc29 Fix memory manager crashing upon second reboot 2020-04-14 20:24:18 -05:00
ergo720 f1255cb89b Allow the memory manager to work again with the non-loader approach 2020-04-14 20:24:18 -05:00
ergo720 52f0d6f03b Updated memory functions to work with the loader 2020-04-14 20:24:18 -05:00
PatrickvL affc999d70 Loader : Use CxbxMessageBox (a wrapper for Windows' MessageBox API) wherever possible, to avoid repeating the TEXT("Cxbx-Reloaded") caption everywhere, and a different argument-order allowing default argument values and thus more compact code. 2020-04-14 20:24:17 -05:00
patrickvl f283dff3b6 Loader : Deduplicate code via new CreateSettings() 2020-04-14 20:24:17 -05:00
PatrickvL 254e666bfe Loader : Shared implementation for termining guiProcessID (and "2nd GUI" mode?!) 2020-04-14 20:24:17 -05:00
patrickvl 170b971a8e Loader : Deduplicate code via new CreateSettings() 2020-04-14 20:24:17 -05:00
patrickvl 890a5ffd2f Loader : Merge LaunchEmulation() into CxbxKrnlMain() 2020-04-14 20:24:17 -05:00
patrickvl 37f5a751a1 Loader : Moved HandleFirstLaunch() and LaunchEmulation() towards shared source file (CxbxKrnl.cpp), and call it from our DLL's Emulate() function. 2020-04-14 20:24:17 -05:00
PatrickvL bf115fe7ab Complete Emulation DLL project by adding all Cxbx source files (except GUI-related stuff). Entire solution builds again with this.
Next steps :
- Actually getting the emulation DLL to work
- Complete CxbxGUI project by adding all Cxbx GUI-related source files
2020-04-14 20:24:17 -05:00
PatrickvL 93c8514700 Loader : Initial drop of a separate *empty* GUI project (probably won't compile either) 2020-04-14 20:24:17 -05:00
patrickvl 420d689d82 Cleaned up of the loader project, added environment checks and documented it somewhat. 2020-04-14 20:24:16 -05:00
PatrickvL ca6423b484 Reviving my more-than-a-year-old Loader branch, by copying over various things (nothing functional yet) 2020-04-14 20:24:16 -05:00
RadWolfie 739e1928a2 change filter log output to always output 2020-04-13 03:28:58 -05:00
= 63563763dd vsh: reduce number of instructions required to handle bounds checking 2020-04-13 03:10:23 -05:00
= 8850b52d88 prevent missing polygons with AMD GPU 2020-04-13 03:10:23 -05:00
darkf eb2bc2dbc8 Use proper constant for XMP_STATUS_RELEASE_CXBXR 2020-04-07 15:32:31 -07:00
darkf 743b3cbdbb Remove unused extern "C" comments 2020-04-07 03:24:00 -07:00
darkf bcbdd4c4e0 EmuFile: Fix string being passed as %s formatter 2020-04-07 02:44:40 -07:00
darkf 3a5552e899 EmuKrnlEx: Fix std::atomic usage 2020-04-07 02:44:40 -07:00
darkf 95f6966a43 PVOID casts where necessary 2020-04-07 02:44:39 -07:00
darkf 21733cc594 EmuKrnlLogging: Work around EXCEPTION_DISPOSITION macros in MinGW 2020-04-07 02:44:39 -07:00
darkf 1309f25c7b Patches: Explicitly construct xbox_patch_t 2020-04-07 02:44:39 -07:00
darkf 4eff9b9dab Get D3D stuff mostly compiling on Clang 2020-04-07 02:44:39 -07:00
darkf c64cbfe482 EmuFS: Construct fs_instruction_t by name 2020-04-07 02:44:39 -07:00
darkf daab20a944 Cast to proper type in case 2020-04-07 02:44:39 -07:00
darkf c821ac0f02 XbPixelShader: Use empty local to avoid undefined behavior 2020-04-07 02:44:39 -07:00
darkf b2a5f304bf Use standard C++ enum forward declarations 2020-04-07 02:44:39 -07:00
darkf a3a1849e6a Use GNU alignment attributes in XbConvert 2020-04-07 02:44:39 -07:00
darkf b8be2efa97 Include missing headers 2020-04-07 02:44:39 -07:00
darkf fed6245e48 Fix erroneous macro definitions 2020-04-07 02:44:38 -07:00
darkf d20537fe5b Remove extern "C" linkage in Emu*, otherwise we get namespace collisions 2020-04-07 02:44:38 -07:00
RadWolfie 661774a8b7 another fixup for FlushEx and worker thread 2020-03-28 02:35:59 -05:00
RadWolfie 959bb22dfc add debug message for buffer/stream release functions 2020-03-28 01:50:46 -05:00
PatrickvL 1bc861ac52
Merge pull request #1852 from LukeUsher/clear_sw_interrupt_flag
kernel: Clear IRR register on software interrupt processing
2020-03-24 15:19:08 +01:00
Luke Usher 637e562080 kernel: Clear IRR register on software interrupt processing
Fixes a hang that can occur due to an infinite loop of interrupts under
certian conditions.
2020-03-24 14:05:53 +00:00
RadWolfie aca3c17440 replace printf and forward EmuLogEx with INIT str to EmuLogInit 2020-03-21 23:06:44 -05:00
RadWolfie da9e727330 fix missing calls to DSStream_Packet_Process 2020-03-13 23:49:49 -05:00
RadWolfie 178ec004c8 another flush async fix 2020-03-13 23:47:23 -05:00
RadWolfie 145e827d68 update SynchPlayback debug log more verbose 2020-03-13 13:33:38 -05:00
RadWolfie 0bf0e32df0 fix Discontinuity and GetStatus 2020-03-13 13:33:34 -05:00
RadWolfie 4a27006ce6 fix audio flush async worker 2020-03-13 13:33:25 -05:00
Luke Usher 951520ece1
Merge pull request #1835 from RadWolfie/fix-wfx-format-sanity
Fix Sanity and Organize wfxformat into Functions
2020-02-26 06:49:59 +00:00
RadWolfie b2d5b5c7e8 fix sanity and organize wfxformat into functions 2020-02-20 23:12:54 -06:00
Anthony Miles 605c31af46 Remove GetViewportOffsetAndScale patches 2020-02-16 19:47:56 +13:00
Anthony Miles f48b9478ac D3DDevice_GetVertexShaderType 2020-02-16 19:46:29 +13:00
Anthony Miles d056bbf308 Remove D3DDevice_GetVertexShaderSize patch 2020-02-16 19:41:48 +13:00
Anthony Miles 0c6a13e975 Create VSHCACHE logging code for the shader cache 2020-02-08 19:50:26 +13:00
Anthony Miles 553ff18dff Reduce log spam. The vertex declaration is already logged 2020-02-08 19:50:26 +13:00
Anthony Miles 2506c9d395 Move shader setting logic into a method 2020-02-08 19:50:25 +13:00
Anthony Miles c8de83922a VertexShaderSource manages creation and caching of vertex shaders
Shaders are compiled asynchronously
2020-02-08 19:50:25 +13:00
Luke Usher 38b03b3fe3
Merge pull request #1821 from NZJenkins/vsh_split
Move D3D9-specific vertex shader code out of XbVertexShader
2020-02-07 09:01:09 +00:00
Luke Usher 339473e63b
Merge pull request #1827 from NZJenkins/fix_hlsl_vreg_init
Fix argument order in HLSL lerp call
2020-02-07 08:56:45 +00:00
Anthony Miles fd68ee4d1f - Fix argument order in HLSL lerp call
- Renaming for clarity
2020-02-07 19:50:59 +13:00
Anthony Miles 484f46db59 - drop some parameters from EmuCompileShader
- when the shader is empty, expect success with no compiled shader output
2020-02-04 20:51:32 +13:00
Anthony Miles 9cea5bfe9a Move D3D9-specific vertex shader code out of XbVertexShader 2020-02-04 20:51:32 +13:00
RadWolfie c6d9eac9f4 disable XAudioCreateAdpcmFormat patch 2020-02-02 11:21:01 -06:00
RadWolfie 9780a63644 minor fixes for DirectSound plugin 2020-02-02 11:21:01 -06:00
RadWolfie 187c53eaf9 add LOGRENDER_MEMBER_ARRAY_TYPE feature to logging file 2020-01-27 22:20:15 -06:00
RadWolfie a513cea260 fix audio log crash from titles below 4039 build 2020-01-27 22:14:30 -06:00
RadWolfie 51ffcb5015 add WAVEFORMATEXTENSIBLE struct to logging file 2020-01-27 22:14:04 -06:00
RadWolfie 1197152b5a fix audio stream flush functions 2020-01-24 17:23:08 -06: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
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
RadWolfie a375faba51 fix audio frequency by set only given frequency value instead of from host function 2020-01-11 02:04:39 -06: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 b581073f07 remove duplicate log reports 2020-01-08 18:30:26 -06: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
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
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 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 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
PatrickvL adc065b0bc Revert "TMP mechassault hack"
This reverts commit d616e94c117d3e1f0e8ce35bfc97d9f845d3c5b7.
2019-12-18 20:12:24 +01:00
PatrickvL 325e663c9f Further cleanup 2019-12-18 20:12:24 +01:00
PatrickvL ac36e6a0d4 Avoid using uninitialized class members 2019-12-18 20:12:24 +01:00
PatrickvL ebbb8e961f Moved a few functions to a better suitable location, and marked a few class functions 'static' 2019-12-18 20:12:24 +01:00
PatrickvL 18a27a64de Refactor vertex shader decoding types and functions into a class 2019-12-18 20:12:23 +01:00
patrickvl eeced5f0a9 Removed one unnecessary intermediate vertex shader decoding layer 2019-12-18 20:12:23 +01:00
patrickvl 5fe0a16cc6 Renamed vertex shader hlsl file, and prepared it for future extensions to behave closer to specifications (nothing changed for now) 2019-12-18 20:12:23 +01:00
patrickvl cc594ca8d7 Further simplifications in vertex shader decoding to intermediate instructions 2019-12-18 20:12:22 +01:00
Anthony Miles 9ee7bb451f Fix logp z component 2019-12-18 20:12:22 +01:00
Anthony Miles f9e5f51815 Fix dph src1.w double-add 2019-12-18 20:12:22 +01:00
Anthony Miles 1cebf018e2 Use int instead of uint for compatibility with optimizer level 0 2019-12-18 20:12:21 +01:00
Anthony Miles f8b1e35482 fix pInstruction typo 2019-12-18 20:12:21 +01:00
Anthony Miles ab1061634d TMP mechassault hack 2019-12-18 20:12:21 +01:00
Anthony Miles 0aa0dce8fb Hack to make sure pre-transformed and regular geometry go into the same coordinate space 2019-12-18 20:12:20 +01:00
PatrickvL ec2032bf0d Made sure that intermediate vertex shader instructions are never empty
Move A0_X indexing boolean from per-parameter to per-instruction, where it belongs.
2019-12-18 20:12:20 +01:00
PatrickvL ff1412b3d9 Use an HLSL accessor function for reading constant registers, allowing Xbox-native negative indices and out-of-bounds handling. This makes the generated HLSL look closed to the original Xbox vertex shader assembly. 2019-12-18 20:12:20 +01:00
PatrickvL d74e5947ee Refactor vertex shader microcode conversion to intermediate isntructions, fixing pairing bugs like ignore MAC R1 writes 2019-12-18 20:12:20 +01:00
PatrickvL 50a51657b0 Force A0's X mask during decoding (in VshAddInstructionMAC_ARL) instead of HLSL conversion (in OutputHlsl)
Also applied Unix EOL style (again)
2019-12-18 20:12:20 +01:00
Anthony Miles 619b276d81 Generate more accurate viewport values, so we can reverse transforms in the vertex shader more generally 2019-12-18 20:12:19 +01:00
Anthony Miles 5d2ef854fb Remove popups about register usage, now that HLSL is used 2019-12-18 20:12:19 +01:00
Anthony Miles b9db301791 Add LOG_TEST_CASE for writes to constants 2019-12-18 20:12:19 +01:00
Anthony Miles 136083d72a SetVertexData4f support 2019-12-18 20:12:19 +01:00
patrickvl ba5d25e2ed Only disassemble HLSL under debug log level
Fix arl by forcing .x mask on a0 parameter
2019-12-18 20:12:19 +01:00
patrickvl b330198fe6 Reorder vertex shader code 2019-12-18 20:12:19 +01:00
patrickvl 1365d2e7e1 Vertex shader HLSL : More commenting, reordering, renaming and fixing 2019-12-18 20:12:18 +01:00
patrickvl cb95bbb46f Make sure HLSL scalar outputs are replicated 2019-12-18 20:12:17 +01:00
patrickvl a0de74ffd9 Make sure all HLSL parameters regardless their swizzle, are cast to float4 before the actual calculation commences 2019-12-18 20:12:17 +01:00
patrickvl 8ed16b9f5a Reorder vertex shader decoding code 2019-12-18 20:12:15 +01:00
PatrickvL 07ceaf96d5 Avoid all implicit typecast warnings, by casting all HSLS calculations to a float4, and apply the output mask to that as well 2019-12-18 20:12:15 +01:00
PatrickvL 339af7b500 Pass mask as argument into the opcode defines.
Also fixed a few HLSL issues that crept in the previous commit
2019-12-18 20:12:15 +01:00
PatrickvL 5b2ff4e278 Simpler determination of used parameters per opcode 2019-12-18 20:12:14 +01:00
PatrickvL 127e51302e Wrap (or replace) HLSL functions with defines, so that destination swizzles work as expected without too much syntax deviation.
Also adjusted a few hlshl functions to be more accurate
2019-12-18 20:12:14 +01:00
PatrickvL 46fbfad52d Remove assembly version and replace regex with dedicated streaming 2019-12-18 20:12:14 +01:00
PatrickvL c039562e7f Reformat HLSL code
Prefer HLSL functions over #defines
Avoid implicit conversion warnings in HLSL template code
Move scalar W selection towards HLSL helper function
Apply scalar component fixup after instead of before conversion to HLSL
2019-12-18 20:12:14 +01:00
Anthony Miles 200b7c493e Use log2, exp2 2019-12-18 20:12:14 +01:00
Anthony Miles bd55f17f0d - Move ILU ops together
- Some ops use the .w component by default. Ensure they will use w instead of x, if the default xyzw swizzle was used
2019-12-18 20:12:14 +01:00
Anthony Miles 59c8ee936f Add line numbers to shader debug 2019-12-18 20:12:14 +01:00
Anthony Miles 05f1f90603 fixup texcoord comments 2019-12-18 20:12:13 +01:00
Anthony Miles b61bfd32af - Use MAC defines, remove functions
- Fix truncation compiler warning in x_dp3
2019-12-18 20:12:12 +01:00
Anthony Miles eaa7bbca41 At debug log level, log shader warnings even if the shader compiled 2019-12-18 20:12:12 +01:00
PatrickvL a9d3b5cdde Better hlsl consistency 2019-12-18 20:12:12 +01:00
PatrickvL c1ba533455 Include the hlsl code as a raw string
Make all Xbox VSh opcodes consistent (using an x_ function or macro)
Replace switch statements with table lookups, making the code much more compact
2019-12-18 20:12:11 +01:00
Anthony Miles e372a80a8d Workaround bad masks on single component outputs 2019-12-18 20:12:09 +01:00
Anthony Miles a258d5d759 file location hack 2019-12-18 20:12:09 +01:00
Anthony Miles 5d21af8a0e Implement more HLSL functions 2019-12-18 20:12:09 +01:00
Luke Usher 19f0affd21 Negate Screen Space Transforms instead of deleting from shader 2019-12-18 20:12:08 +01:00
Anthony Miles fd1555535e HACK
Get HLSL compiling
2019-12-18 20:12:08 +01:00
Anthony Miles 8382adfaab fixup dp3, dph 2019-12-18 20:12:08 +01:00
Anthony Miles 620c98da80 Interpret r12 as oPos 2019-12-18 20:12:08 +01:00
Anthony Miles 2102bffee2 Ensure dp3 and dph use float3 dot products 2019-12-18 20:12:08 +01:00
Anthony Miles 551516a52a fix typo 2019-12-18 20:12:08 +01:00
Anthony Miles 65f6ff3497 fix missing bracket 2019-12-18 20:12:08 +01:00
Anthony Miles c3fbc46b7c c() bounds check 2019-12-18 20:12:07 +01:00
Anthony Miles ef3b5d7217 Fix bias typo 2019-12-18 20:12:07 +01:00
Anthony Miles 650174ea83 - Reverse screenspace transform properly
- Move Xbox variable 'a' inside main
- Fix rcc reversed clamp
2019-12-18 20:12:07 +01:00
Anthony Miles 780cb6c578 fix rcc typo 2019-12-18 20:12:07 +01:00
Anthony Miles 504b8ddba6 Fix swizzle behaviour 2019-12-18 20:12:06 +01:00
Anthony Miles b24ea2309c Fix HLSL debug logging 2019-12-18 20:12:05 +01:00
Anthony Miles 3cd2f73332 Apply scaling hack 2019-12-18 20:12:05 +01:00
Anthony Miles c6242b798c remove junk files 2019-12-18 20:12:03 +01:00
Anthony Miles 21712cb4de Implement remaining xbox functions 2019-12-18 20:12:03 +01:00
Anthony Miles 389e50a570 more hlsl 2019-12-18 20:12:03 +01:00
Anthony Miles da6fc5f35c TMP more stuff 2019-12-18 20:12:02 +01:00
Anthony Miles 62015b1499 initial 2019-12-18 20:12:02 +01:00
Luke Usher be42ab7a0f Nasty hack to fix hl2 crash during switch to ingame 2019-12-17 19:45:30 +00:00
Luke Usher b62333551c kernel: Define and init IdexChannelObject 2019-12-16 21:53:02 +00:00
patrickvl b76f4c5d5a Fixed black texture regression in Bloodrayne (and possibly all other reported cases); Turned out to be an oversight (GetHostBaseTexture 2nd argument is not the TextureStage, but D3DUsage, dug!). I had to re-do each change line by line, testing as I went, to find this... Ah well, at least it didn't have anything to do with the new cache! 2019-12-01 17:16:57 +01:00
patrickvl ce191a66e0 Fixed incorrect assumption : Xbox doesn't have a D3DCOMMON_VIDEOMEMORY flag at all, so we can't identify resources with it either! 2019-12-01 15:41:34 +01:00
PatrickvL 8664e6cc3d Potential fix for the "CreateCubeTexture Failed!" regression, by restoring GetHostBaseTexture to it's previous behaviour (if this works, I'll create a separate issue with all relevant detail so that we can follow-up on this later) 2019-11-28 17:00:50 +01:00
PatrickvL 01bd2d026e Lower impact of this PR by storing a few things that won't hurt much 2019-11-28 16:27:39 +01:00
PatrickvL de1b815542 Split up resource cache in two, one for paletized textures (which gets pruned when it overflows),
one for all other resources (which cache doesn't prune, like it did not do before, too).

This way, only paletized textures get pruned from their specialized cache, while other resources,
including render-targets (which can't be paletized) will stay resident in the general cache (which won't overflow).

Doing it this way, probably fixes the reported black texture regressions,
but it might also lead to less of a performance increase than before.
2019-11-28 15:56:31 +01:00
PatrickvL b03551535c Changed our resource cache key into a struct, to greatly reduce the chance of hash collisions.
This can solve part of the reported regressions (but there's more, like not-pruneing render targets).
2019-11-26 15:22:43 +01:00
PatrickvL e281d1e490 Renamed EmuD3DActiveTexture into g_pXbox_SetTexture 2019-11-25 15:55:09 +01:00
PatrickvL db45305a5f Call PruneResourceCache() once per draw (in CxbxUpdateNativeD3DResources instead of in EmuVerifyResourceIsRegistered), this might prevents black textures. 2019-11-25 15:55:08 +01:00
PatrickvL d09381c5a3 Prepare for setting surfaces as active SetTexture's (disabled for now).
Consequences of this change :
GetHostBaseTexture won't be called on X_D3DCOMMON_TYPE_SURFACE anymore.
GetHostTexture became obsolete because of this,

Also corected a few typo's & made bits of code simpler.
2019-11-25 15:55:08 +01:00
PatrickvL 1b2b320b36 Avoid scaling factor rounding issues, by always applying g_RenderScaleFactor as a multiplier (never as a divisor). 2019-11-25 15:55:08 +01:00
PatrickvL 1332ba3ef0 Revert unintentional change 2019-11-25 15:55:07 +01:00
PatrickvL f5bc947964 Minor code cleanups 2019-11-25 15:55:07 +01:00
PatrickvL 3be6429300 Cater for actual palette size 2019-11-25 15:55:06 +01:00
PatrickvL 5d3cae890c Include a palette hash in the texture lookup key, instead of patching Palette_Lock functions and freeing textures when setting palette's.
To avoid overflowing the resource cache, PruneResourceCache now applies cache eviction as well.
2019-11-25 15:55:06 +01:00
PatrickvL 67068303de
Merge pull request #1789 from PatrickvL/correct_d3d_enums
Corrected old ordering of D3DTOP enum elements.
2019-11-25 15:54:10 +01:00
Anthony Miles 100be789e2 Implement extra log component calculations 2019-11-22 19:18:29 +13:00
PatrickvL 6ba97108c6 Corrected old ordering of D3DTOP enum elements.
This fixes alpha texture blending on titles that use D3D XDK 3948 and older
2019-11-21 11:43:12 +01:00
PatrickvL 068cefe444
Merge pull request #1772 from LukeUsher/nic-debugging
Fix IP network traffic
2019-11-20 17:09:20 +01:00
PatrickvL 7cac893aa6
Merge branch 'develop' into expp_handling 2019-11-20 17:02:55 +01:00
Luke Usher 8be7402227
Merge pull request #1783 from PatrickvL/impl
Introduce two CxbxImpl_*'s for as-yet unimplemented functions.
2019-11-20 15:56:40 +00:00
Luke Usher 81bf7e06c7
Merge pull request #1771 from PatrickvL/correct_render_state_info
Corrections in render state information
2019-11-20 15:54:10 +00:00
patrickvl 8aef04f83a Comment-only change, no function impact;
Re-orded render state verification comments incrementally, like this:
"Verified [absent in X, ]present in Y[ , removed in Z]" (whereby X < Y < Z).

This makes these comments easier to read and understand.
2019-11-20 16:38:29 +01:00
PatrickvL db90d6a8b8 Verified all render states; Updated D3DRS_MULTISAMPLEMODE to 4039 (might even be 4034) 2019-11-19 17:40:50 +01:00
PatrickvL ae05bdba58 Correct D3DRS_MULTISAMPLERENDERTARGETMODE from 4039 to 4034.
This has no functional impact anyway, since there's no host renderstate associated with this (and later) render states.
2019-11-19 15:52:34 +01:00
PatrickvL ae3fbc67c7 Rename g_SetStreamSources into g_Xbox_SetStreamSource (which better reflects it's contents) 2019-11-18 17:57:02 +01:00
PatrickvL 9cf3591393 Turn Cxbx version define into a variable
This is intended to reduce the number of files that need to be
recompiled when updating a repository.
2019-11-18 14:44:44 +01:00
PatrickvL 5814eaa7fd Do the extended availability check of render states everywhere it might have an impact. 2019-11-18 12:06:48 +01:00
patrickvl d5a5e9fc9a Disable X_D3DRS_MULTISAMPLETYPE in a simpler way, which also allows for easier disabling of other render states as well (would the need ever arise). 2019-11-17 16:17:10 +01:00
patrickvl 2c46324320 Replaced two literal numbers by their corresponding symbols (no functional change, just an improvement that was due) 2019-11-16 22:32:49 +01:00
PatrickvL 477ab534c5 This commit solved the fact that X_D3DRS_MULTISAMPLEMODE replaces the older X_D3DRS_MULTISAMPLETYPE (which was available below 4039).
This allows restoring X_D3DRS_MULTISAMPLEMODE back to 4361 where it belongs (as far as we know).

Adjusted X_D3DRS_MULTISAMPLERENDERTARGETMODE to XDK 4039 (was 4242)

Made comments on DxbxRenderStateInfo and _X_D3DRENDERSTATETYPE consistent again.

Also use X_D3DRS_* FIRST / LAST defines wherever applicable.

This is a subset of work done earlier in 67cfc36fca
2019-11-16 21:48:15 +01:00
patrickvl 8dfb3e20c2 Introduced CxbxImpl_SetStreamSource, and simplified it's storage.
Also some renaming and comments (all this copied over from Vsh_unpatching)
2019-11-16 17:12:20 +01:00
patrickvl 2012d86522 Introduce two CxbxImpl_*'s for as-yet unimplemented functions. 2019-11-16 14:44:29 +01:00
Anthony Miles 4c4b0f4022 Use xbox, host, prefixes 2019-11-16 22:51:29 +13:00
Anthony Miles 22e6fe58e0 Add shader comments 2019-11-16 21:04:32 +13:00
Anthony Miles 56b78fbdfe expp returns 1 in the w component 2019-11-16 21:04:32 +13:00
Anthony Miles 8902118a66 Use const 2019-11-16 21:04:32 +13:00
PatrickvL e47fe0787a Co-ordinate usage of reserved registers 2019-11-16 21:03:21 +13:00
PatrickvL b3671fe0e4 Read Fog color through GetXboxRenderState (not via host GetRenderState), just like all other states.
Also updated a few random comments and stuff mentioning the now-obsolete EmuMappedD3DRenderState.
Removed unused code and replaced manual conversion of DWORD to 4 ARGB floats by using D3DXCOLOR.
2019-11-15 17:59:16 +01:00
Anthony Miles c5b0457dec - Reserve a scratch register, and avoid interfering with registers reserved for undeclared v
- Assume 32 registers are available for simplicity
- Reserve space for all 16 v registers
2019-11-15 21:05:29 +13:00
Anthony Miles 3b787aeef5 Update expp instruction handling 2019-11-14 22:28:03 +13:00
Luke Usher 829177f57a Better implementation of RtlAssert 2019-11-12 20:14:27 +00:00
Luke Usher 6b08ee81cc Fix kernel event handling 2019-11-12 20:14:27 +00:00
Luke Usher 8bf71bd7df
Merge pull request #1769 from PatrickvL/nv2a_callbacks
Support Xbox Direct3D "read" callback events
2019-11-12 10:48:05 +00:00
Anthony Miles f9e8bb64f6 Make sure we truncate the contents of the 'a' register, so it isn't rounded to the nearest integer 2019-11-12 22:33:50 +13:00
Luke Usher 1a64cbd2f4 Revert "Disable Read callbacks again"
This reverts commit d0655335d3.
2019-11-09 22:57:31 +00:00
Luke Usher 7bd88cfb14 Fix a crash caused by double-free of g_pD3DDevice
This was only a problem for release builds, as the code for this was
disabled in Debug builds.

This fixes the crash when booting halo: It was unrelated to the (now
disabled) callbacks
2019-11-09 22:55:44 +00:00
PatrickvL d0655335d3 Disable Read callbacks again 2019-11-07 18:30:48 +01:00
PatrickvL 9aea68534e Merge pull request #1763 from PatrickvL/variable_renaming
Small code-cleanup
2019-11-07 16:20:02 +01:00
PatrickvL d1d0700504 Introduce host CPU idle wait function.
Introduce host GPU flushing functionality.
Put Xbox callbacks into a queue instead of keeping around only one.
Use host GPU query events to emulate callback events at roughly the same time when the NV2A Xbox GPU would.
All this can be (programmatically) disabled by a g_bHack_DisableHostGPUQueries boolean (later, this could be made configurable).
2019-11-05 15:29:03 +01:00
PatrickvL b36286a237 Move Xbox callback insertion and handling into separate functions, and call them where appropriate. 2019-11-05 15:25:05 +01:00
patrickvl 364499cda0 Reordered Direct3D global variables 2019-11-02 17:03:06 +01:00
patrickvl 54bd0e2a18 Change NULL into nullptr or xbnullptr or xbnull, depending the situation 2019-11-02 16:24:37 +01:00
patrickvl e41d684cfa Renamed global variables (taken from Vsh_unpatching), removed (or commented-out) unused variables, and additional comments 2019-11-02 16:24:36 +01:00
Fred Hallock 8ae612fdb7 Add support for relative Xbe paths (#1766)
* Fixed an issue where the Xbe path needs to be absolute. I added a call to std::filesystem::absolute to resolve the path to absolute at the earliest that it is accessed from __argv so that there is no chance for it to cause a problem.
2019-11-02 09:41:13 +00:00
PatrickvL 7508ec190e Comment-only change : Make "test-case" comment mentions consistent 2019-10-28 09:40:03 +01:00
patrickvl fa76ffe140 Finally fixed Indiana Jones regressions (BaseVertexIndex mustn't be enlarged when drawing indexed quads through a converted index buffer).
Also some renaming
2019-10-28 09:31:43 +01:00
patrickvl 91575822a8 Corrected arguments for indexed quad draws 2019-10-28 09:31:42 +01:00
patrickvl 4591e40712 Potential fix for Indiana Jones regression? 2019-10-28 09:31:42 +01:00
patrickvl ec25283551 Addressed code review remarks, by adding explanations in comments and renaming a few arguments 2019-10-28 09:31:41 +01:00
patrickvl eb9f610780 Move LowIndex and HighIndex values into DrawContext, GetVerticesInBuffer doesn't need to determine HighIndex again. Because of this, GetVerticesInBuffer has been removed, and the determination was inlined into CxbxVertexBufferConverter::Apply() 2019-10-28 09:31:41 +01:00
patrickvl 29ab156d44 Fix GetVerticesInBuffer for indexed draws, this might actually fix missing geometry.
Draw closing line (for a line loop) through vertex copies (to avoid a potential performance penalty when the old, index-based approach spanned over many indices).

Renamed a few variables to make their contents and purpose more clear
2019-10-28 09:31:40 +01:00
patrickvl 2504de39c8 Turned ConvertedIndexBuffer into a class that in it's destructor releases the host index buffer.
With that, added poor-mans IndexBuffer cache eviction.
Moved our way of calling CreateIndexBuffer into it's own function.
Condensed generation of quad-to-triangle index data into one function.
Renamed a bunch of variables, and added a few comments.
2019-10-28 09:31:40 +01:00
patrickvl 3d58eba6b8 Cleanup, additional testcases and one fix for a corner-case (closing line-loops should take BaseVertexIndex into account) 2019-10-28 09:31:40 +01:00
patrickvl fce300d25a Small fixes, but not for the regression, yet. 2019-10-28 09:31:39 +01:00
patrickvl fedd9fbf67 Cleaned up and expanded upon commented test-case 2019-10-28 09:31:38 +01:00
patrickvl a26560a8ee Documented a few more known test-cases 2019-10-28 09:31:07 +01:00
patrickvl 14091b03a4 Speed up drawing indexed quads, by converting the indices (from ABCD quads to ABC+CDA triangles), and doing one call with those indices (instead of drawing each quad separately) 2019-10-28 09:30:29 +01:00
patrickvl af35d9b161 Dumping of vertex declaration now also shows the number of streams (like before it was extracted into it's own function).
Also commented on vertex shader temporary register counts and r12+oPos behavior
2019-10-19 15:57:20 +02:00
patrickvl 0366e647a5 Dump vertex shader separately from conversion 2019-10-19 14:55:20 +02:00
literalmente-game f8e660aa40
Add missing dcl statement
Fixes blank shader compilation
2019-10-17 03:44:54 -03:00
Luke Usher 3c497362e4
Merge pull request #1746 from PatrickvL/fix_vertex_decl_skip_token
Fix vertex conversion when skip tokens are present in the Xbox vertex declaration
2019-10-16 13:01:38 +01:00
Luke Usher 1914e17078 Typo 2019-10-14 16:29:18 +01:00
patrickvl 6ef5b21144 Fix vertex conversion when skip tokens are present in the Xbox vertex declaration. 2019-10-14 14:56:32 +02:00
Luke Usher 4646c14c29 Restore fog hack: Fixes Silent Hill 2 2019-10-14 08:01:15 +01:00
Luke Usher dae0d84f9b Fix an issue with reading FOGCOLOR in a pixel shader 2019-10-12 19:21:24 +01:00
Luke Usher b0ace63021 Fix smashing drive intro 2019-10-12 13:48:34 +01:00
Luke Usher f2235ab522 Fix missing fog in DolphinClassic 2019-10-11 08:42:03 +01:00
Luke Usher c79b11109f Fix crash in pixel shaders caused undefined behavior in LTCG handler 2019-10-08 16:24:47 +01:00
Luke Usher 9537158007 Fix nasty bug with LTCG D3DDevice_SetPixelShader_0 2019-10-07 17:03:54 +01:00
Luke Usher 58e0416a96 another typo 2019-10-07 15:58:27 +01:00
Luke Usher de2b891d60 Typo 2019-10-06 21:13:34 +01:00
Luke Usher fdbd9fb2ab Add removed patches to unused-patches file. 2019-10-06 17:21:16 +01:00
Luke Usher 94c79876d2 Fix broken pixel shaders (Rallisport Challenge, etc) 2019-10-06 17:21:00 +01:00
Luke Usher 5d0b44303c Fix a regression with XDK 4432 (Buffy and others) 2019-10-05 14:50:50 +01:00
Luke Usher 422e95db88 Remove all RenderState/TextureState Patches, bar one.
With this work, all of these patches are no longer required, and
instead, are replaced with a RenderStateConverter and
TextureStateConverter object

One single render state patch (D3DDevice_SetRenderState_Simple) is still
required, as that bypasses the D3D__RenderStates array in some XDK
versions.
2019-10-03 19:03:37 +01:00
Luke Usher 31078f7307 Add support for Xbox Controller S 2019-09-29 14:47:59 +01:00
RadWolfie f38dc91075 replace std's wstring_convert to SDL's iconv library 2019-09-26 10:19:01 -05:00
RadWolfie b4457c3605 replace experimental filesystem to std filesystem 2019-09-25 13:53:02 -05:00
PatrickvL a6c0353c5b Fix a large part of XTL-hell (#1731)
* Rename g_CurrentXboxVertexShaderHandle to g_Xbox_VertexShader_Handle

* Remove CxbxDrawContext.XboxVertexShaderHandle field, and replaced reads from this field by g_Xbox_VertexShader_Handle (since all writes to this field used that as source)

* Removed commented-out #include's

* Removed duplicate DEF_VSH_* defines, replaced usage by existing X_D3DVSD_*() defines.

* Removed commented-out #include's from src/vsbc

* Removed nearly all "namespace XTL"-wrappers around #includes; Instead, wrap applicable contents of these included files in namespace XTL. Removed all now-obsolete "XTL::" prefixes.

* Moved all host D3D9 symbols outside of namespace XTL (finally!)

* Removed all "using namespace XTL;" occurences (except one, which is marked with a TODO)

* Restored Unix EOL style (to avoid large diffs with upstream)

* Moved CxbxInitAudio outside XTL namespace (this was the last Cxbx* symbol in XTL)

* Removed final "using namespace XTL" occurence by cleaner wrapping of logging intrinsics inside and outside namespace XTL.

* Prefix a few Xbox types with X_ (and avoid compile-error by removing the now-obsolete duplicate of X_D3DCALLBACK).
Also nicely indent all Direct3D9 alias defines, introduced when porting from Direct3D8. Who knows, one day we might re-define them once again to port to more recent Direct3D versions?

* Made EmuXTL.h obsolete, by #include'ing specific headers instead of it.

* Removed unused #include's of EmuFS.h

* Remove #pragma once, when there's already an include guard present.

* Delete EmuXTL.h and XOnline.cpp, keep but disable XOnline.h for documentation purposes.

* Fix all compiler warnings that have no functional impact. What's left requires more research

* Remove GetVersion, retain Wine check
2019-09-24 16:25:52 -05:00
Luke Usher fa38cd41b2
Merge pull request #1730 from RadWolfie/fix-delay-input
Implement Input Initialize Latency Timer & Device Emulation Status
2019-09-20 16:29:37 +01:00
RadWolfie d5f79df0b7 implement input initialize latency timer and device emulation status 2019-09-17 11:45:11 -05:00
PatrickvL 0c470044fb Removed never-set union field : X_D3DVertexShader.CxbxVertexShaderHandle to avoid using garbage data. 2019-09-17 09:57:57 +02:00
PatrickvL 456906b6b4 Removed written-only field : CxbxVertexShader.HostDeclarationSize 2019-09-17 09:51:57 +02:00
RadWolfie 796561dd6c
Merge pull request #1725 from PatrickvL/moving_d3d_types
* Moved XbPushBuffer.h, XbVertexBuffer.h and XbVertexShader.h outside the XTL namespace.
Moved Cxbx-specific types from XbD3DTypes.h towards appropriate above header files.
Fixed up all XTL-hell that resulted from this.

* Moved XbConvert.h outside the XTL namespace.
Fixed up all XTL-hell that resulted from this.

* Moved XbPixelShader.h outside the XTL namespace.
Fixed up all XTL-hell that resulted from this.

* Moved XbState.h outside the XTL namespace.
Fixed up all XTL-hell that resulted from this.
2019-09-14 15:06:41 -05:00
PatrickvL fee97614c2
Merge pull request #1726 from NZJenkins/king_kong2
Detect and remove register redefinitions in vertex declarations
2019-09-14 09:43:34 +02:00
PatrickvL a407b40f46 Moved XbState.h outside the XTL namespace.
Fixed up all XTL-hell that resulted from this.
2019-09-13 14:35:02 +02:00
PatrickvL 7aa793b6b7 Moved XbPixelShader.h outside the XTL namespace.
Fixed up all XTL-hell that resulted from this.
2019-09-13 13:37:41 +02:00
PatrickvL a6dd0c49a6 Addressed review-comment (removing unneeded XTL namespace prefix) 2019-09-13 13:07:07 +02:00
Anthony Miles 07d53c0e2b fixup commit
- free pXboxDeclarationCopy
- use bitset instead of array
- include method in sort
2019-09-13 20:46:19 +12:00
PatrickvL 98c89ec656 Moved XbConvert.h outside the XTL namespace.
Fixed up all XTL-hell that resulted from this.
2019-09-12 17:46:16 +02:00
patrickvl 32e155e1ba Moved XbPushBuffer.h, XbVertexBuffer.h and XbVertexShader.h outside the XTL namespace.
Moved Cxbx-specific types from XbD3DTypes.h towards appropriate above header files.
Fixed up all XTL-hell that resulted from this.
2019-09-12 17:46:16 +02:00
RadWolfie b01a6c97cf
Merge pull request #1722 from PatrickvL/vsh_cleanup
Moving, reordering, renaming and other cleanup of D3D symbols
2019-09-12 10:30:12 -05:00
PatrickvL eb4db9a27a Moving, reordering, renaming and other cleanup of D3D symbols (all taken from my Vsh_unpatching branch) 2019-09-12 09:34:58 +02:00
Anthony Miles 1d6fd7e851 Detect and remove register redefinitions 2019-09-12 18:56:27 +12:00
Anthony Miles 6b5f4036c1 Initialize pCurrentvertexShaderStreamInfo to nullptr 2019-09-11 22:26:49 +12:00
Luke Usher 614e7e4b9f Fix crash on CopyRects failure 2019-09-09 22:12:46 +01:00
PatrickvL 278d511794 Lots of cleanup regarding vertex declarations and shaders (#1709) 2019-09-06 10:56:53 -05:00
ergo720 d8b0075c93 New input gui (#1713) 2019-09-05 16:10:09 -05:00
Luke Usher 294447bba8 Fix CopyRects when upscaling is used 2019-09-05 19:23:18 +01:00
Luke Usher ef78455516 Fix CreateTexture errors 2019-09-04 18:45:12 +01:00
Luke Usher f76408a03d Fix an issue where converting a texture to a render-target would sometimes fail 2019-09-04 18:26:54 +01:00
Luke Usher 8c55274cb3 Fix CopyRects in Crash Bandicoot: WoC (and others) 2019-09-04 18:26:48 +01:00
Luke Usher b236e94935 Fix a nasty bug where CopyRects never worked! 2019-09-04 18:26:14 +01:00
Kyle Niewiada 9be770163e Align structure to correctly map Xapi controller capabilities 2019-08-28 17:11:43 -04:00
Luke Usher f48f267c89 Fix an issue where D3DDevice_SetRenderTarget would fail, if called on a
surface we didn't previously create as a Render Target

The Xbox ignores the D3DUSAGE_RENDERTARGET flag, but the host *requires*
it.

We can't determine if a surface is a render target until the game calles
D3DDevice_SetRenderTarget, so if we encounter a call on a non-render
target, we can fix the situation and recreate it as such

Fixes the 'Graffiti Select' menu in JSRF
2019-08-25 14:40:15 +01:00
PatrickvL fce723c93b
Merge pull request #1704 from LukeUsher/fix-copyrects
Fix CopyRects between textures, on GPU
2019-08-25 15:22:04 +02:00
PatrickvL a77403b7b6
Merge pull request #1703 from LukeUsher/fix-level-face-surface
Fix surface level/face mapping without patches!
2019-08-25 15:14:52 +02:00
Luke Usher a031875793 Fix CopyRects between textures, on GPU 2019-08-25 14:00:41 +01:00
PatrickvL c3f6233ca2
Merge pull request #1702 from LukeUsher/move-container-type-check
Move pixel container type check to GetHostBaseTexture
2019-08-25 14:52:11 +02:00
Luke Usher de1bc00334 Fix surface level/face mapping without patches! 2019-08-25 13:46:07 +01:00
Luke Usher 6c30058a40 Move pixel container type check to GetHostBaseTexture 2019-08-25 13:40:43 +01:00
Luke Usher a4338e08f3 Unpatch D3DResource_Release, detect freeing of resources via DestroyResource instead 2019-08-25 13:35:59 +01:00
Luke Usher afe76e0bba Update XbSymbolDatabase to latest version as of today 2019-08-25 12:28:21 +01:00
Luke Usher 548eeba924 Remove LockFS from the functions that don't require locking 2019-08-16 20:15:38 +01:00
Luke Usher 688238c40b
Merge pull request #1688 from NZJenkins/framerate_key
Frame limiter toggle
2019-08-03 08:19:20 +01:00
Anthony Miles a38138db52 Frame limiter toggle and F9 debug key binding 2019-08-02 22:13:17 +12:00
Anthony Miles 11f005b14c Remove extra UnlockFS() call 2019-08-02 19:42:47 +12:00
Anthony Miles 5e1851fcad Preserve caller esp value 2019-08-02 19:42:47 +12:00
PatrickvL f62030a548
Merge pull request #1683 from LukeUsher/vertex-shader-register-tweaks
Vertex shader register tweaks
2019-07-29 11:30:09 +02:00
Luke Usher 31253815e1 Define constants + fix typos 2019-07-29 09:19:10 +01:00
Luke Usher ab3b8f84ae Fix potential stack corruption, thanks revel8n 2019-07-28 14:26:43 +01:00
Luke Usher cdd962e5a4 3925 alpha test hack 2019-07-28 14:26:43 +01:00
Luke Usher d2e65f0e67 Fix vOffset/vScale overwritten by nv2a constants 2019-07-28 14:26:19 +01:00
Anthony Miles 99f4c460b8 Improve LockFS performance 2019-07-27 11:22:41 +12:00
Luke Usher 35ce3e7fb1 Treat all vertex registers as 'User Defined' 2019-07-25 16:23:39 +01:00
Luke Usher ae4dbce372 Comment out warnings that pollute the log 2019-07-25 12:11:59 +01:00
Luke Usher 6ced176977 Cleanup + R12 oPos readback 2019-07-25 07:39:24 +01:00
Luke Usher bcc7f0c650 Remove R12 replace hack: VS2_X has enough registers 2019-07-25 07:14:53 +01:00
Luke Usher b62b8341cc 3925 fog disable hack 2019-07-24 18:37:03 +01:00
Luke Usher 6326602232 Writeback vertex attributes 2019-07-24 18:34:39 +01:00
Luke Usher fb871f283f Prevent new R registers being trashed 2019-07-24 15:36:56 +01:00
Luke Usher 893a25baf2 Pass default values at SetVertexShader time 2019-07-24 15:26:50 +01:00
Luke Usher 5bfb98c312 Read registers not present in vertex buffers from SetVertexData4f registers 2019-07-24 14:39:58 +01:00
Luke Usher 8d8e256697 Update SetVertexData4f to write it's input to shader constants 2019-07-24 12:00:32 +01:00
Luke Usher b5cec3e8fc Cleanup Register Usage detection + Remove incorrect Xbox->PC mappings (From D3D8to9) 2019-07-24 11:52:19 +01:00
Luke Usher 931970068c Fix when CreateDevice doesn't call SetRenderTarget
This allows for the Xbox backbuffer location to be properly determined, even in titles that do not call
SetRenderTarget at all!

Tt also fixes the situation where games didn't call SetRenderTarget internally within CreateDevice.

This works because GetRenderTarget always returns the assigned render target, which immediately after
CreateDevice, is *always* the backbuffer.

This allows us to reliably determine the default backbuffer and depth stencil, even without a CreateDevice call.

This fixed a regresion in Shin Megami Tensei: Nine , and has potential to fix some more blackscreen issues.
2019-07-21 12:37:06 +01:00
RadWolfie d4f8ec93bf
Merge pull request #1679 from ergo720/error_log_lv
Add error log level to logging system
2019-07-20 22:20:45 -05:00
ergo720 fd4bcb39ff Added error log level 2019-07-20 21:53:15 +02:00
Luke Usher 4a3f9a19a4 Allow LoadVertexShaderProgram to work in games without their own CreateVertexShader function 2019-07-20 11:56:13 +01:00
RadWolfie e646eada8d fix universal error message output 2019-07-20 01:47:46 -05:00
ergo720 7f70c88917 Fix a bug in KiTimerMtx.Acquired (#1675) 2019-07-20 00:36:53 +02:00
RadWolfie 0c334de398
Merge pull request #1674 from ergo720/d3d_resource_crash_fix
Fix a crash in JSRF
2019-07-19 15:08:09 -05:00
ergo720 19984db979 Fix a crash in JSRF 2019-07-19 21:17:42 +02:00
RadWolfie 99fc299611
Merge pull request #1672 from LukeUsher/fix-shader-constants
Fix shader constants: It's per-function not per-XDK
2019-07-19 13:56:51 -05:00
PatrickvL 69ebe1b4ba
Merge pull request #1669 from LukeUsher/work-around-for-missing-destroyresource-patch
Workaround & LOG_TEST_CASE for missing DestroyResource patch
2019-07-19 10:08:17 +02:00
PatrickvL 8cba41744f
Merge pull request #1670 from LukeUsher/ltcg-fixes
Improve some LTCG specific patches
2019-07-19 10:07:38 +02:00
Anthony Miles 0ea66ea0d8 Avoid tight loop in LockFS. Fixes Prince of Persia 2 slowdown during loading screen 2019-07-19 18:42:59 +12:00
Anthony Miles 63996f87eb Avoid tight loop in interrupt thread. Alleviates some stutter in Panzer Dragoon Orta 2019-07-19 18:41:50 +12:00
Anthony Miles 9c4277ae9b Avoid tight loop in DirectSound thread worker 2019-07-19 18:41:14 +12:00