Commit graph

6147 commits

Author SHA1 Message Date
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
PatrickvL
18a630bb78
Merge pull request #1800 from LukeUsher/half-life-2-hack
Fix when titles attempt to find the XBEH header in memory
2019-12-17 22:28:34 +01:00
Luke Usher
be42ab7a0f Nasty hack to fix hl2 crash during switch to ingame 2019-12-17 19:45:30 +00:00
PatrickvL
8ebeeeb24c
Merge pull request #1799 from LukeUsher/fix-mechassault
kernel: Define and init IdexChannelObject
2019-12-16 23:47:29 +01:00
Luke Usher
b62333551c kernel: Define and init IdexChannelObject 2019-12-16 21:53:02 +00:00
RadWolfie
d0da11cb1e
Merge pull request #1796 from LukeUsher/eeprom-serial-number
Eeprom Config: Correctly render Serial Number as Numeric Text, not HEX
2019-12-14 13:20:23 -06:00
Luke Usher
23540f01b4 Eeprom Config: Correctly render Serial Number as Numeric Text, not HEX 2019-12-14 19:15:58 +00:00
RadWolfie
7e46adb95e
Merge pull request #1797 from LukeUsher/minor-nic-fix
nvnet: Accept only broadcast and targeted traffic, not multicast
2019-12-14 13:13:19 -06:00
Luke Usher
d1018cb773 nvnet: Accept only broadcast and targeted traffic, not multicast
Fixes XNET warnings when using Debug XDK libraries
2019-12-14 11:25:35 +00:00
Luke Usher
63bc65ece2
Merge pull request #1791 from PatrickvL/hash_palete_in_texture_key
Speed up paletized texture
2019-12-02 08:04:41 +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