Commit Graph

394 Commits

Author SHA1 Message Date
Lioncash f295182833 VideoBackends: Simplify initialization and deinitialization of resources
Approximately three or four times now, the issue of pointers being
in an inconsistent state been an issue in the video backend renderers
with regards to tripping up other developers.

Global (ugh) resources are put into a unique_ptr and will always have a
well-defined state of being - null or not null
2015-12-20 22:40:37 -05:00
hdcmeta 50b9ab4541 Set g_vertex_manager to nullptr on DX11 backend shutdown.. OGL backend already does this 2015-12-20 17:02:36 -08:00
degasus e26d9f7c35 MSAA: Store samples in ini files. 2015-12-15 09:41:01 +01:00
Stenzek 5dcd3cd4fd D3D: Fix crash when taking screenshot with crop enabled
This was due to specifying negative source coordinates for the texture copy, which must lie within the bounds of the source and destination textures.

The behavior now is to clamp the copy region to [0 <= size <= backbuffer size], resulting in a copy region that can be smaller than the backbuffer, but never larger.
2015-12-09 02:38:24 +10:00
degasus fc00598785 NativeVertexFormat: Inline Initialize in contructor
They were only called at once, so no need to seperate them.

This also removes the only dereference of the NativeVertexFormat in VideoCommon, so backends may just return nullptr.
2015-11-24 22:48:49 +01:00
Stenzek d1b132731d D3D: Remove redundant cast, move pitch calculation to caller 2015-11-24 21:54:19 +10:00
Stenzek 6be4608a0d D3D: Fix crash on some drivers with small textures 2015-11-24 21:15:19 +10:00
Markus Wick f172cda50f Merge pull request #3191 from lioncash/rekt
MathUtil: Minor changes to Rectangle
2015-11-18 10:40:54 +01:00
degasus 087ba5268a TextureCache: Rewrite EFB Copy control flow 2015-11-15 12:02:41 +01:00
degasus dcdf8fd3ce TextureCache: Split efb2ram from efb2tex 2015-11-15 11:59:52 +01:00
degasus d7d8704353 D3D-TextureEncoder: Remove TCache::Entry usage 2015-11-15 11:59:52 +01:00
Tillmann Karras 81d9cce70c VideoCommon: rename TextureCache to TextureCacheBase 2015-11-06 15:43:58 +01:00
Tillmann Karras 71d1eb3c31 VideoCommon: return code/uid from shader gens
rather than passing in non-const references
2015-11-03 14:40:23 +01:00
Tillmann Karras c52c73f762 VideoCommon: VertexManager -> VertexManagerBase
It may be a bit weird to see calls to static functions in
VertexManagerBase now, but at least it's easier to see what's going on.
2015-11-02 11:53:54 +01:00
Tillmann Karras 983978ee66 VideoCommon: flush vertex manager if components change 2015-11-01 22:39:31 +01:00
Tillmann Karras 7066689131 ShaderCaches: remove unneeded typedefs 2015-10-29 14:43:05 +01:00
Lioncash c28e3affc5 TextureCacheBase: Change CacheLinesPerRow to BytesPerRow 2015-10-22 08:14:43 -04:00
Lioncash 10c1fd7f38 MathUtil: Make Rectangle constructors and equality operator constexpr 2015-10-20 20:30:36 -04:00
shuffle2 81414b4fa2 Merge pull request #3076 from void-ghost/stereo3d_presets
Stereo3d presets
2015-10-03 18:10:23 -07:00
flacs 8ea9b07b59 Merge pull request #3093 from lioncash/header_shuffle
Common: Trim Common.h
2015-09-27 03:18:03 +02:00
Lioncash cc036ca86c Common: Remove other Common prefixed headers from Common.h 2015-09-26 18:51:58 -04:00
Ryan Houdek be667e7de8 Merge pull request #3035 from aserna3/SSAAImprovements
Improved OGL and D3D's AA options in UI
2015-09-26 09:27:39 -04:00
Anthony Serna df189c3ea3 Improved D3D and OGL AA option UI
Removed Quality Levels from D3D AA options

Dropdown text now shows whether you're applying MSAA or SSAA

Added a description for SSAA

Moved SSAA checkbox

Cleaned up AA in backends slightly. Supported modes is now a list of ints.
2015-09-25 09:05:18 -07:00
ghost 07e4b4f7c4 VideoBackend: Video config filename is now exposed in VideoBackends.
It reduces redundancy. Needed make possible to save current video config.
2015-09-22 09:47:19 +03:00
Scott Mansell deeb1d8370 Remove segfault from DX11 backend.
Instead of blindly using the expected width, clamp it to the stride of the
buffer which dx11 returns. This prevents use from reading invalid memory
at the end of textures.

This doesn't solve the base issue of what to do when a game tries to copy
from outside the efb. On real hardware it returns random noise (biased
to all ones)
2015-09-17 02:22:00 +12:00
Scott Mansell 1f800b80dd Merge pull request #2960 from phire/improve_efb2tex
Make efb2tex behave much more like efb2ram.
2015-09-07 14:12:03 +12:00
degasus 1c0366993a VideoBackends: Reimplement SSAA, now for D3D + OGL 2015-09-06 19:40:00 +02:00
Scott Mansell ee649c6d9f Make efb2tex behave more like efb2ram.
Instead of having special case code for efb2tex that ignores hashes,
the only diffence between efb2tex and efb2ram now is that efb2tex
writes zeros to the memory instead of actual texture data.

Though keep in mind, all efb2tex copies will have hashes of zero as
their hash.
2015-09-07 02:32:01 +12:00
Scott Mansell 137856bd00 Fix palette conversions for 4 bit efb copies.
Fixes purple shadow in THPS4 and many other things.
2015-09-06 21:16:52 +12:00
Scott Mansell b9be3245e1 Move common EFB copy code into VideoCommon
Addded a few duplicated depth copy texture formats to the enum
in TextureDecoder.h. These texture formats were already implemented
in TextureCacheBase and the ogl/dx11 texture cache implementations.
2015-09-06 21:16:51 +12:00
Scott Mansell 52948bb3ef Cleanup and unify handling of efb copy stride. 2015-09-05 23:37:24 +12:00
Ryan Houdek 7650117c26 Properly support MSAA and SSAA as separate features(+GLES)
SSAA relies on MSAA being active to work. We only supports 4x SSAA while in fact you can enable SSAA at any MSAA level.
I even managed to run 64xMSAA + SSAA on my Quadro which made some pretty sleek looking games. They were very cinematic though.

With this, it properly fixes up SSAA and MSAA support in GLES as well. Before they were broken when stereo rendering was enabled.
Now in GLES they can properly support MSAA and also stereo rendering with MSAA enabled(with proper extensions).
2015-09-05 05:23:29 -05:00
Lioncash 102a2a975d BitField: Enable ifdef'd out code for Windows 2015-09-03 22:06:15 -04:00
Shawn Hoffman aa7208e270 [windows] Update projects to vs2015. 2015-09-03 04:23:01 -07:00
Jules Blok b01ca1794a Revert "VideoCommon: Clamp integer conversions."
This reverts commit 0f2c72f0f8.
2015-08-15 13:50:43 +02:00
degasus e2f42f8fd0 OGL: Move copy_image variable into backend. 2015-08-06 19:41:36 +02:00
unknown 739ede2242 Fix code to comply with coding style 2015-07-31 20:00:36 -04:00
mirrorbender 0faba3b018 Changed the aspect ratio settings to account for NTSC/PAL pixel aspect ratios and VI scaling. 2015-07-31 19:58:02 -04:00
Lioncash 7ee0e75633 Remove unnecessary virtual keywords 2015-07-30 10:33:08 -04:00
booto 9d055ba5f2 Video: Trying to fix D3D/XFB disabled regression 2015-07-26 00:59:00 +08:00
booto efd250494d Video: stride in bytes rather than pixels 2015-07-25 02:48:56 +08:00
booto 2e28ed3291 Video: respect stride of efb copies to xfb 2015-07-25 01:52:12 +08:00
Rodolfo Bogado d8cd2c3252 Implement scaled partial texture updates 2015-07-02 08:53:40 -03:00
Lioncash daa205990f Use emplace() instead of insert() where applicable for maps. 2015-06-28 19:52:40 -04:00
Jules Blok 75a9740ab7 Merge branch 'stable' 2015-06-25 12:24:15 +02:00
Jules Blok dbfdbf7dbd D3D: Cosmetics.
Merge two cases which should've already been merged.
2015-06-24 23:16:53 +02:00
Markus Wick 8493feb89f Merge pull request #2602 from mimimi085181/partial-texture-updates2
Support partial texture updates via efb copies
2015-06-24 09:22:50 +02:00
Jules Blok 21a70903ed Merge branch 'stable' 2015-06-23 20:16:55 +02:00
mimimi085181 0ed6b5623f Support partial texture updates via efb copies 2015-06-21 14:02:44 +02:00
Matthew Parlane 45aeeee699 Fix aniso filtering on d3d to not set aniso filter when using 1x 2015-06-19 20:55:32 +12:00