Commit Graph

394 Commits

Author SHA1 Message Date
Jules Blok 4042945ee5 Merge branch 'stable' 2015-06-13 01:12:12 +02:00
degasus c375111076 Options: merge SCoreStartupParameter into SConfig 2015-06-12 19:07:45 +02:00
Matthew Parlane 5cce640f48 Anisotropic Filtering option is now correct in D3D
Values are saved/loaded as 0,1,2,3,4 but need to be used as 1,2,4,8,16
This was correct for OGL but not D3D
2015-06-10 22:32:46 +12:00
Jules Blok 75fef8e26f D3D: Implement Z pokes. 2015-06-07 15:33:30 +02:00
Jules Blok cfc23560d9 D3D: Set the viewport to the full target size when doing EFB pokes. 2015-06-07 13:32:00 +02:00
Jules Blok ef1dfa8bcb VideoBackends: Allow the viewport to use the full depth range. 2015-06-06 03:37:46 +02:00
JosJuice 95a2abc1ce Use PanicAlertT instead of PanicAlert when appropriate
I tried to change messages that contained instructions for users,
while avoiding messages that are so technical that most users
wouldn't understand them even if they were in the right language.
2015-06-04 13:25:06 +02:00
Jules Blok ca7801da44 D3D: Invert initial depth buffer clear. 2015-05-26 15:31:36 +02:00
galop1n 2975e53091 D3D: Depth range inversion.
Credits go to Galop1n for designing this technique and to BhaaLseN for cleaning up the commit.
2015-05-26 15:31:31 +02:00
Tillmann Karras 30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
Tillmann Karras 268f52e054 Add missing license headers 2015-05-25 13:11:47 +02:00
Jules Blok e31982474c OGL: Depth range inversion. 2015-05-22 23:52:22 +02:00
Jules Blok 88cc91030e VertexShaderGen: Use correct depth output when glClipControl is supported. 2015-05-22 23:52:21 +02:00
Jules Blok 05f42f94a0 OGL: Use floating point arithmetic to scale the depth value. 2015-05-20 14:22:30 +02:00
Markus Wick 695a72c24c Merge pull request #2414 from Armada651/depth-clamp
VideoBackends: Clamp depth to uint24 range.
2015-05-19 14:44:34 +02:00
Jules Blok ef78941042 VideoBackends: Clamp depth to uint24 range. 2015-05-18 23:22:28 +02:00
Jules Blok f7151a2a5c Revert "D3D: Use a 32-bit floating point depth buffer."
This reverts commit a224c604a3.
2015-05-16 22:16:31 +02:00
Jules Blok a224c604a3 D3D: Use a 32-bit floating point depth buffer. 2015-05-08 14:32:22 +02:00
Jules Blok 84a5f4abb0 VideoBackends: Use the new divisor when clearing the depth buffer. 2015-05-08 14:32:22 +02:00
Jules Blok 1a409a2e16 VideoBackends: Clamp Z peek values. 2015-05-08 14:32:21 +02:00
Jules Blok 0f2c72f0f8 VideoCommon: Clamp integer conversions. 2015-05-08 14:32:16 +02:00
Jules Blok b0770e2a0c VideoBackends: Floor depth values in depth copy shaders. 2015-05-08 14:29:30 +02:00
Jules Blok c4f85a38e6 VideoBackends: Use proper floating point depth precision. 2015-05-08 14:29:29 +02:00
shuffle2 268b8fd26f Merge pull request #2026 from mrgreywater/d3d-debugbreak
D3D: More debug information and break on error
2015-05-07 19:29:21 -07:00
Jules Blok 24594a7888 PixelShaderCache: Fix MSAA depth copy shader. 2015-05-06 12:43:35 +02:00
Jules Blok 7a1252f7e5 VideoBackends: Implement depth copy shaders with integer math. 2015-05-05 00:40:25 +02:00
Yuriy O'Donnell df5750edfd D3D: Replaced explicit _BitScanForward with LeastSignificantSetBit 2015-05-03 21:14:29 +02:00
Yuriy O'Donnell 2b664f5d89 D3D: StateManager::Apply no longer iterates through every texture and sampler slot
Now using bit scan through dirty slot masks.
2015-04-29 20:08:00 +02:00
Lioncash 9eb608c9da Merge pull request #2301 from lioncash/const
General: Apply the const specifier where applicable
2015-04-16 23:13:39 -04:00
Lioncash 63393570fb PerfQueryBase: Move common implementation variables into base class 2015-04-15 19:22:16 -04:00
Lioncash b0613bb1c8 General: Apply the const specifier where applicable 2015-04-15 02:04:03 -04:00
Lioncash bdde6b2a7c D3D: Remove dependency on wxWidgets
This hasn't been necessary for ages
2015-04-14 22:27:03 -04:00
Shawn Hoffman ad64336137 quiet some warnings which appear on vs2015.
quieted warnings include shadowed variable names and integer extensions.
2015-03-15 19:28:47 -07:00
degasus 35373c5185 TextureCache: load all mipmap levels from custom textures
This drops the "feature" to load level 0 from the custom texture
and all other levels from the native one if the size matches.
But in my opinion, when a custom texture only provide one level,
no more should be used at all.
2015-03-02 00:09:09 +01:00
Tillmann Karras f75187db3e Add missing newlines at EOF 2015-03-01 17:17:09 +01:00
degasus 967eaad8df VideoCommon: rename efb2tex and efb2ram 2015-02-24 23:10:13 +01:00
Jules Blok c180174e4a D3D: Use the correct format when resolving the EFB depth texture. 2015-02-21 11:50:19 +01:00
magumagu c0a4760f0e Decode EFB copies used as paletted textures.
A number of games make an EFB copy in I4/I8 format, then use it as a
texture in C4/C8 format.  Detect when this happens, and decode the copy on
the GPU using the specified palette.

This has a few advantages: it allows using EFB2Tex for a few more games,
it, it preserves the resolution of scaled EFB copies, and it's probably a
bit faster.

D3D only at the moment, but porting to OpenGL should be straightforward..
2015-02-19 15:09:27 -08:00
mr.greywater c43da7e00b D3D: replace memset, fix warning 2015-02-12 14:45:05 +01:00
mr.greywater 442b7ba99c D3D: Add debug object name for efb encoder pixel shader 2015-02-12 14:34:36 +01:00
mr.greywater b5ffba3291 D3D: Added GetDebugObjectName and parameter checking in SetDebugObjectName 2015-02-12 14:34:35 +01:00
mr.greywater 3d3a68a2f0 D3D: Add break on error in debug build 2015-02-12 14:34:34 +01:00
magumagu 0f96a0104e Merge pull request #1752 from Buddybenj/clean-up
Clean Up
2015-02-10 11:39:14 -08:00
mr.greywater 2434b531f3 D3D: Fixed crash rendering EFB textures with MSAA
Rendering EFB textures currently crashes with the D3D backend when MSAA is enabled, because the depth texture wasn't correctly resolved. An example for a crash would be starting Pokemon Snap with D3D and MSAA enabled.
2015-02-08 21:03:15 +01:00
skidau c18c50a0e1 Merge pull request #1904 from magumagu/d3d-allow-nooutput-adapter
D3D: allow selecting adapters with no outputs.
2015-02-04 13:09:27 +11:00
magumagu 0030ad9ecf Fix D3D regression from PR1948.
Make sure we don't have a texture bound as both an ShaderResourceView and
a RenderTargetView; this causes rendering glitches.

This isn't really the right place to do this... but I'm not sure
how the code should be structured.
2015-01-27 18:25:35 -08:00
Markus Wick beaa9905a6 Merge pull request #1966 from magumagu/unify-efb-encode
Unify EFB encoding shader generation
2015-01-27 23:14:18 +01:00
Markus Wick da31314775 Merge pull request #1970 from magumagu/d3d-cleanup
D3D: delete unnecessary code.
2015-01-27 22:26:46 +01:00
Markus Wick 43605f8716 Merge pull request #1948 from magumagu/remove-efb-cache
Remove EFB to RAM cache, and simplify code.
2015-01-27 09:42:15 +01:00
magumagu 897b678d24 D3D: delete unnecessary code. 2015-01-26 10:58:32 -08:00
magumagu 33259c272b Remove some debugging junk. 2015-01-25 23:11:36 -08:00
magumagu cb05730127 Use linear sampling in ScaleByHalf mode. 2015-01-25 23:05:23 -08:00
magumagu cb5d3fce4f Fix stupid mistake. 2015-01-25 21:20:25 -08:00
magumagu 6c1bdfe04c More work. 2015-01-25 19:57:07 -08:00
magumagu ef75f3005d WIP. 2015-01-25 15:49:35 -08:00
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
skidau d7a8752228 Merge pull request #1920 from CarlKenner/fix3dxfb
Fix 3D XFB
2015-01-25 15:44:06 +11:00
Benjamin Przybocki 4f324ad742 Clean Up 2015-01-24 17:10:21 -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
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 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
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
CarlKenner 4768d0f0a8 This fixes stereoscopic 3D with XFB enabled, for example in the intro in Animal Crossing GameCube NTSC.
The maths appears to give crazy impossible answers without this fix, but the cause is all the ints being "promoted" to unsigned because of the single unsigned division at the end.
2015-01-20 03:42:58 +10:30
Ryan Houdek 7e64869185 Merge pull request #1887 from Tilka/vertex_loader_jit
VertexLoader: rewrite x64 JIT
2015-01-18 19:48:14 -06: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 68d204e877 D3D: remove unused variable 2015-01-18 12:59:33 +01:00
magumagu 7d5abb4eb4 D3D: allow selecting adapters with no outputs.
The result might be a little iffy in complicated situations (i.e. you have
three graphics cards and monitors hooked up to two of them), but we really
need better UI for such cases anyway.
2015-01-17 14:27:11 -08:00
Jules Blok 8d69658a9d Add exclusive mode OSD messages. 2015-01-17 16:11:17 +01:00
Jules Blok b87fddb027 D3D: Allow borderless fullscreen to be turned on/off during gameplay. 2015-01-17 16:11:12 +01:00
Jules Blok 803bea5004 D3D: Fix Dolphin immediately exiting exclusive fullscreen. 2015-01-16 16:01:29 +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 0932282caf Merge pull request #1818 from ZephyrSurfer/master
Fix scaling in Virtual XFB.
2015-01-13 07:58:54 +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 1c98a43203 TexCache: clean up frameCount handling 2015-01-11 22:23:35 +01:00
Markus Wick 6c46f27709 Merge pull request #1501 from degasus/texture_creation
D3D: remove load texture on creation optimization
2015-01-11 01:01:18 +01:00
mimimi085181 56e93f8fdd Update size_in_bytes of texture cache entries when copying efb to ram 2015-01-10 13:47:52 +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
Jules Blok 399b6248d1 D3D: Further improve exclusive fullscreen state checking. 2015-01-05 00:01:22 +01:00
Jules Blok 3b9c070ee0 D3D: Only try to apply exclusive mode when the renderer is in focus. 2015-01-04 16:42:16 +01:00
Patrick A. Ferry 069a0864c0 Scale the offset to the IR scale
The offset between fbStride and fbWidth will need to be scaled by IR
scale.
2015-01-03 22:05:22 +00:00
Patrick A. Ferry eebd7da443 Fix stretching with Virtual XFB in D3D
This change matches the behaviour of OpenGL.

This should make Ty the Tasmanian Tiger 3 stretch across the whole
screen. There are other games with this same issue but I have not any.

See issue #6750 for details
2015-01-03 01:28:49 +00:00
Jules Blok 26a9afa0e7 Anaglyph: Use matrices instead of vectors. 2015-01-02 14:32:42 +01:00
Jules Blok 491de39325 PixelShaderCache: Implement Dubois algorithm in anaglyph shader. 2015-01-02 03:06:11 +01:00
Jules Blok 29e05c5ff8 Stereo3D: Don't rely on GetEFBLayers() when dealing with shaders.
Shaders may be compiled before the FramebufferManager is initialized.
2014-12-29 11:19:55 +01:00
Jules Blok e1dc033113 Renderer: Cosmetics. 2014-12-28 18:35:23 +01:00
Jules Blok 89de7e0526 Renderer: Invalidate the FramebufferManager if the XFB mode is changed.
Fixes incorrect texture sizes after switching XFB modes.
2014-12-28 18:26:25 +01:00
Jules Blok 730a6e5f4b D3D: Fix Virtual XFB viewport.
Looks like I was incorrect about swapping the bottom and top members.
2014-12-28 17:34:19 +01:00
Jules Blok 81d1b7f0c2 XFBEncoder: Cosmetics. 2014-12-28 16:30:48 +01:00
Jules Blok d7037ae492 PixelShaderCache: Don't use GetDimensions() for the sample count.
This function is bugged on Windows 7, and statically declaring the sample count is trivial anyway.
2014-12-27 14:45:15 +01:00
Jules Blok 833513f384 XFBEncoder: Sample the first layer of the resolved EFB texture.
Using the multisampled EFB texture is invalid, as the XFB encoder does not have a multisampling shader.
2014-12-25 12:09:35 +01:00
Jules Blok af8ac328e5 Renderer: Use old method of calculating the source rectangle. 2014-12-25 02:37:22 +01:00