Commit Graph

6058 Commits

Author SHA1 Message Date
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
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