Commit Graph

2503 Commits

Author SHA1 Message Date
Jules Blok 262c3b19ec PostProcessing: Add support for user-supplied anaglyph shaders.
There are lots of different anaglyph glasses out there and there may be even more creative uses for stereoscopic post-processing shaders.
2015-01-25 22:07:03 +01:00
Scott Mansell 61215e7180 Fix a buffer underrun in CalculateZSlope. 2015-01-25 20:31:20 +13:00
Lioncash 9cdfe889af Coding style cleanup from the zfreeze merge 2015-01-24 15:16:48 -05:00
Markus Wick ae514cb0f2 Merge pull request #1955 from degasus/master
TexCache: Rewrite the texID generation for paletted textures
2015-01-24 15:37:25 +01:00
degasus 51990fcdfa TexCache: Rewrite the texID generation for paletted textures
This changes the behavior if both texture are available. The old code did
try to load the modfied texID, the new code tries the unmodified texID first.
2015-01-24 13:58:20 +01:00
Markus Wick 4f6d0049a7 Merge pull request #1951 from Sonicadvance1/Remove_old_defines
Remove an old GLES define that I missed.
2015-01-24 13:38:26 +01:00
Tony Wasserka 43036af944 Merge pull request #1812 from phire/real_zfreeze
Add proper zfreeze support.
2015-01-24 13:29:57 +01:00
Scott Mansell 14baf038e7 Stop doing nastly shit to OpenGL stream buffers.
Instead we keep the loaded vertices in CPU memory.
2015-01-24 14:41:51 +13:00
Ryan Houdek 189528171b Remove an old GLES define that I missed. 2015-01-23 14:30:23 -06:00
magumagu 6659c15bed Remove EFB to RAM cache, and simplify code. 2015-01-23 10:48:15 -08:00
Scott Mansell 5510c86b81 Move Zfreeze code out individual backends into videoCommon
Also:
 * Implement support for per-vertex PosMatrixIndex
 * Only update zslope constant once when zfreeze is activated.
 * Added a bunch of comments.
2015-01-24 03:22:27 +13:00
Scott Mansell daf760b202 A few small cleanups based on code review. 2015-01-23 04:38:36 +13:00
Scott Mansell e88c02dece Ensure that ZSlopes save/restore state correctly.
Had to re-do *ShaderManager so they saved their constant arrays
instead of completly rebuilding them on restore state.
2015-01-23 03:32:31 +13:00
Scott Mansell 128d303656 Reduce number of divisions in screenspace transform.
This is closer to what the hardware does anyway.
2015-01-23 03:32:31 +13:00
NanoByte011 add59b3bea Fixes Mario Tennis Gimmick Courts and adds support for FastDepthCalc
- Calculate ZSlope every flush but only set PixelShader Constant on Reset Buffer when zfreeze
- Fixed another Pixel Shader bug in D3D that was giving me grief
2015-01-23 03:32:31 +13:00
Scott Mansell 6d5065c58d Fix pixelshader constant offsets. 2015-01-23 03:32:31 +13:00
Scott Mansell 88c7afd315 Make zfreeze use screenspace coordinates independant of IR.
OpenGL requires the y coordinates to be flipped.

Also refactored PixelGen code to remove duplicate code.
2015-01-23 03:32:31 +13:00
Scott Mansell 418296961c Fix various issues with zfreeze implemntation.
Results are still not correct, but things are getting closer.

 * Don't cull CULLALL primitives so early so they can be used as reference
        planes.
 * Convert CalculateZSlope to screenspace coordinates.
 * Convert Pixelshader to screenspace coordinates (instead of worldspace
        xy coordinates, which is totally wrong)
 * Divide depth by 2^24 instead of clamping to 0.0-1.0 as was done
        before.

Progress:
 * Rouge Squadron 2/3 appear correct in game (videos in rs2 save file
         selection are missing)
 * Shadows draw 100% correctly in NHL 2003.
 * Mario golf menu renders correctly.
 * NFS: HP2, shadows sometimes render on top of car or below the road.
 * Mario Tennis, courts and shadows render correctly, but at wrong depth
 * Blood Omen 2, doesn't work.
2015-01-23 03:32:31 +13:00
NanoByte011 613781c765 Cleanup and refactor of zfreeze port
Based on the feedback from pull request #1767 I have put in most of
degasus's suggestions in here now.

I think we have a real winner here as moving the code to
VertexManagerBase for a function has allowed OGL to utilize zfreeze now
:)

Correct use of the vertex pointer has also corrected most of the issue
found in pull request #1767 that JMC47 stated.  Which also for me now
has Mario Tennis working with no polygon spikes on the characters
anymore!  Shadows are still an issue and probably in the other games
with shadow problems.  Rebel Strike also seems better but random skybox
glitches can show up.
2015-01-23 03:32:31 +13:00
NanoByte011 937844b9e3 Initial port of zfreeze branch (3.5-1729)
Initial port of original zfreeze branch (3.5-1729) by neobrain into
most recent build of Dolphin.

Makes Rogue Squadron 2 very playable at full speed thanks to recent core
speedups made to Dolphin. Works on DirectX Video plugin only for now.

Enjoy!  and Merry Xmas!!
2015-01-23 03:31:54 +13:00
skidau d27bd9d291 Merge pull request #1885 from degasus/custom_texture
CustomTexture: new name format
2015-01-23 00:43:39 +11:00
NanoByte011 0a9257ad37 Cleaned up whitespace
Fixed Directional Attenuation (assumed, data was light dir vector already, but it was not!)
2015-01-21 22:30:41 -07:00
NanoByte011 f475e367f2 Lighting Attenuation Fixes 2015-01-21 15:55:32 -07:00
degasus 7cf4dd63e4 CustomTexture: fix texture format 2015-01-21 23:33:42 +01:00
degasus 1d0557a5e6 CustomTexture: use xxhash 2015-01-21 21:47:18 +01:00
degasus 84c8645d22 CustomTexture: Convert old format automatically 2015-01-21 21:22:55 +01:00
degasus f9ced4eb13 CustomTexture: also support the legacy format 2015-01-21 21:22:55 +01:00
degasus 62402efa6c CustomTexture: Mark textures with mipmaps 2015-01-21 21:22:55 +01:00
degasus ee9d05d67f CustomTexture: Use another file name with wildcards 2015-01-21 21:22:55 +01:00
degasus a353ead3cb CustomTexture: Use always safe texture hash 2015-01-21 21:22:55 +01:00
degasus eeaad06a07 CustomTexture: check for min/max index on paletted textures 2015-01-21 21:22:55 +01:00
Ryan Houdek 1c62c2f935 Merge pull request #1924 from degasus/xxhash
VideoCommon: xxhash
2015-01-21 14:19:35 -06:00
Ryan Houdek 80e6367e46 Merge pull request #1869 from Stevoisiak/GeneralConsistency
Minor consistency changes
2015-01-21 13:46:53 -06:00
Ryan Houdek 50d495b581 Merge pull request #1916 from mimimi085181/master
Make efb to texture less broken for paletted textures that are efb copies
2015-01-21 13:40:36 -06:00
Ryan Houdek 7fba4856ce Merge pull request #1931 from Sonicadvance1/Fix_PP_Config
Fix the Post Processing shader configuration dialog.
2015-01-21 13:29:01 -06:00
degasus 402fb4bd20 xxhash: Add cmake + VS files
Based on riking's PR.
2015-01-21 07:35:34 +01:00
Ryan Houdek d348bfea46 Fix the Post Processing shader configuration dialog.
On locales that don't use period as a separator this would break us.
For vector values in a configuration, we use comma as a separator which causes the configuration to balloon to massive sizes due to never saving them
correctly. Loading would then break since it would load a million configuration options.
Fixes issue #7569.
2015-01-20 16:40:46 -06:00
Jules Blok f40cd04a29 PixelShaderGen: Fix uninitialized variables. 2015-01-20 23:15:01 +01:00
Tillmann Karras 1dcf49237b VertexLoaderX64: support VAT.ByteDequant=0 2015-01-20 09:23:15 +01:00
Tillmann Karras 46ab5d63d6 VertexLoader: never reset alpha in 8888 colors
Fixes the opening menu of Xenoblade Chronicles.
2015-01-20 09:22:55 +01:00
Tillmann Karras 80617ec6bd VertexLoader: remove weird line 2015-01-20 01:53:52 +01:00
Tillmann Karras 873902b4a3 VertexLoader: remove non-JIT SSE code 2015-01-20 01:51:07 +01:00
Markus Wick 0d0f7ec662 Merge pull request #1894 from Armada651/exclusive-fix
D3D: Fix Dolphin immediately exiting exclusive fullscreen.
2015-01-19 23:29:43 +01:00
Jules Blok 332d5888eb VideoConfig: Add exclusive mode flag.
Allows the UI to easily check the current exclusive mode state.
This simplifies a few checks and prevents the user from ever getting stuck in fullscreen.
2015-01-19 22:55:21 +01:00
Tillmann Karras 804341d4fe VertexLoader: fix position offset bug 2015-01-19 17:38:40 +01:00
Tillmann Karras 4b323096ec VertexLoader_Position: remove old JIT ideas 2015-01-19 17:36:24 +01:00
Ryan Houdek 7e64869185 Merge pull request #1887 from Tilka/vertex_loader_jit
VertexLoader: rewrite x64 JIT
2015-01-18 19:48:14 -06:00
mimimi085181 0d3343d093 Make efb to texture less broken for paletted textures that are efb copies
Don't change the texID depending on the tlut_hash for paletted textures that are efb copies and don't have an entry in the cache for texID ^ tlut_hash. This makes those textures less broken when using efb to texture.

This is not really fixing those textures, but it's a step forward. The mini map in Twilight Princess for example is in grayscales with this and is more or less usable.
2015-01-19 01:31:41 +01:00
Tillmann Karras d3f49097c5 VertexLoaderX64: register symbol for code page 2015-01-18 23:20:44 +01:00
degasus 9f13a77799 TexCache: don't try to aggressive reuse the entry
As we pool them now, freeing and reallocating them is quite fast.
2015-01-18 19:58:33 +01:00
degasus 8565f02699 TexCache: use an unordered_multimap for the tex pool 2015-01-18 19:58:33 +01:00
degasus 4639d3b1bc TexCache: also incude textures within the render target pool 2015-01-18 19:47:48 +01:00
degasus 6cd6e6546f TexCache: merge texture and rendertarget factory function 2015-01-18 19:47:48 +01:00
degasus 615ae9f106 TexCache: remove PC_TexFormat
We only support rgba32 for a while now, so there is no need to have everything in common configureable.
2015-01-18 19:47:48 +01:00
Tillmann Karras bc5cf10ad5 VertexLoaderX64: optimize color conversions 2015-01-18 17:47:18 +01:00
Tillmann Karras 7d0cff05e9 VertexLoaderX64: make table lookup deterministic 2015-01-18 16:22:21 +01:00
Tillmann Karras 1855d56f1a VertexLoaderX64: fix a bunch of stuff
Suggestions by @degasus and @FioraAeterna.
2015-01-18 13:31:28 +01:00
Tillmann Karras dc01e261d1 VertexLoaderX64: fix duplicate register allocation
Thanks to @shuffle2 for noticing this.
2015-01-18 13:30:21 +01:00
Tillmann Karras f5545477e3 VertexLoaderX64: suggestions by @magumagu
- avoid register merges
- avoid redundant MOV
2015-01-18 13:30:19 +01:00
Tillmann Karras b27ba3802e VertexLoaderX64: implement pre-Haswell fallbacks 2015-01-18 13:29:34 +01:00
Tillmann Karras e82e9f97f5 VertexLoader: add new JIT 2015-01-18 13:29:34 +01:00
Tillmann Karras 20ded4c1e5 VertexLoader: remove old JIT 2015-01-18 12:59:33 +01:00
Tillmann Karras bec30068a6 VertexLoader_TextCoord: reorder function list 2015-01-18 12:59:33 +01:00
Tillmann Karras d86957944a VertexLoader_Color: clean up 2015-01-18 12:59:33 +01:00
Tillmann Karras 6a26771cd5 VertexLoader_Normal: use shorter notation 2015-01-18 12:59:33 +01:00
Tillmann Karras 20bc18cd5d VertexLoaderManager: make it nicer to read 2015-01-18 12:59:33 +01:00
Tillmann Karras b0df4b08ec VertexLoaderTester: fix a few problems 2015-01-18 12:59:33 +01:00
Tillmann Karras 2cedc0034d DataReader: turn WritePointer into GetPointer 2015-01-18 12:59:33 +01:00
mimimi085181 96bcb09fb2 Fix another small bug with the efb2ram cache
Textures that are directly next to each other were falsely detected as overlapping.
2015-01-17 19:10:00 +01:00
Markus Wick 7069450ce5 Merge pull request #1872 from degasus/texcache
Texcache cleanup 2
2015-01-13 22:45:49 +01:00
Markus Wick 980ce440ef Merge pull request #1813 from Armada651/convergence
Add UI for per-game stereoscopy settings.
2015-01-13 00:25:38 +01:00
Markus Wick 5be85cf928 Merge pull request #1814 from phire/worldspace_untangling
Move worldpos into it's own varying.
2015-01-12 22:59:21 +01:00
Stevoisiak cb86db7b68 Minor consistency changes
Mostly small changes, like capitalization and spelling
2015-01-12 15:18:18 -05:00
skidau 14ced85d85 Made the CPU thread wait for the GPU thread to swap, when XFB is enabled. May fix some of the "FIFO is overflowed by GatherPipe ! CPU thread is too fast!" errors. 2015-01-12 19:40:43 +11:00
degasus 22e06daf5c TexCache: recreate the entry on level missmatch 2015-01-11 23:11:04 +01:00
degasus a9eb08b85d TexCache: Choose texture based on mipmap count 2015-01-11 22:41:04 +01:00
degasus 744b1c1624 TexCache: rewrite level calculation 2015-01-11 22:23:35 +01:00
degasus d95e5e2b6f TexCache: create a const Config struct 2015-01-11 22:23:35 +01:00
degasus d640453274 TexCache: cleanup max texture level 2015-01-11 22:23:35 +01:00
degasus 1261f5f7f4 TextureCache: inline arguments into texture cache 2015-01-11 22:23:35 +01:00
degasus 2b47df07b6 TexCache: use c++11 syntax for std::map::erase 2015-01-11 22:23:35 +01:00
degasus 1c98a43203 TexCache: clean up frameCount handling 2015-01-11 22:23:35 +01:00
degasus 6ba613fbd3 TexCache: unify global variables 2015-01-11 22:23:35 +01:00
degasus 774596dbed TexCache: rename OverlapsMemoryRange 2015-01-11 22:23:35 +01:00
degasus dddcea5a9a TexCache: don't invalidate efb copys because of config changes
We'll loose data on invalidating them. So just keep them until a new copy is done.
A wrong scaled copy is better than no copy if the game doesn't creates a new one.
2015-01-11 22:23:35 +01:00
degasus 38f42da55a TexCache: remove expanded_width
This variable isn't use any more.
2015-01-10 12:22:03 +01:00
degasus 614d058db1 TexCache: don't load tex level 0 on creation
This reverts an optimization which isn't worth imo. Every texture uploads have to alloc vram and a staging buffer, so there is no need to do both in the same call.
2015-01-10 12:21:33 +01:00
degasus 8bdbe37c91 TexCache: Wipe pal hash 2015-01-10 11:55:16 +01:00
Markus Wick f0f8384639 Merge pull request #1785 from degasus/custom_texture
VideoCommon: Custom texture handling
2015-01-08 13:29:45 +01:00
Tillmann Karras 4d1face540 Fix indentation 2015-01-07 21:51:47 +01:00
Markus Wick d8d4c94e07 Merge pull request #1819 from Tilka/cmake
CMake: simplify some expressions
2015-01-06 09:27:59 +01:00
degasus 110d494070 VideoCommon: fix deterministic dual core 2015-01-03 21:50:51 +01:00
Tillmann Karras 6bcdb10eee CMake: simplify some expressions 2015-01-03 13:17:57 +01:00
Scott Mansell 1b771deb56 Move worldpos into it's own varying.
Previously it was packed into spare slots in clippos.xy and normal.w,
but it's ugly and more importantly it's causing bugs.

This was discovered during the debugging of a zfreeze branch, which
expected clippos.xy to be xy position coordinates in clipspace (as
the name suggested).

Turns out the stereoscopy shader had also run into this trap, modifying
clippos.x (introducing errors with per-pixel lighting).

This commit has been moved outside of the zfreeze PR for fast merging.
2015-01-03 09:23:09 +13:00
Jules Blok b816ee1f79 VideoConfig: Define a per-game minimum convergence value instead of a percentage boost. 2015-01-02 17:07:08 +01:00
skidau 9c6795c7b7 Merge pull request #1778 from JMC47/ReadIdleFix
Remove AtBreakpoint() from ReadIdle. Fixes Rogue Squadron 2 without breaking Gladius
2015-01-02 12:00:00 +11:00
Markus Wick ec4dfae333 Merge pull request #1747 from Armada651/intel-workaround
OGL: Work around Intel structures bug.
2015-01-01 21:41:09 +01:00
Markus Wick f5cddd4020 Merge pull request #1790 from Armada651/master
VideoConfig: Don't disable stereoscopy if Real XFB is enabled but not in use.
2014-12-30 12:30:23 +01:00
Jules Blok 0860c02258 VideoConfig: Don't disable stereoscopy if Real XFB is enabled but not in use. 2014-12-29 19:15:31 +01:00
Jules Blok b474c4229d VertexShaderManager: Turn off the epsilon hack for Nvidia 3D Vision. 2014-12-29 17:05:39 +01:00