Commit graph

517 commits

Author SHA1 Message Date
Stenzek
828aac7890 VideoBackends: Make TextureCache::CompileShaders return a bool 2016-10-01 01:09:12 +10:00
Stenzek
5346078791 VideoCommon: Add config fields for multithreading and validation layers 2016-10-01 01:09:12 +10:00
Markus Wick
cb759528e0 Merge pull request #3893 from hthh/perf-query-bug
Improve PerfQuery accuracy
2016-09-27 13:07:35 +02:00
Scott Mansell
f5c70a4b27 EFB2RAM: Downsample higher resolutions with linear filtering. 2016-09-07 11:17:32 +12:00
Lioncash
168e145fae D3D: Remove unnecessary renderer global references 2016-08-31 14:17:22 -04:00
Scott Mansell
0fbf72cbf1 Merge pull request #4140 from Armada651/ww-depth
D3D: Correctly invert the viewport depth range.
2016-08-24 02:28:53 +12:00
Jules Blok
a8a9348913 OGL: Handle cases where reversed depth is already used. 2016-08-23 15:54:04 +02:00
Jules Blok
65472260d8 D3D: Correctly invert the viewport depth range. 2016-08-23 09:57:11 +02:00
Lioncash
2bf05a544d VertexManager: Correct variable naming scheme
Altered to indicate regular class members
2016-08-22 20:01:00 -04:00
Jules Blok
7078216b61 Improve documentation. 2016-08-16 21:09:58 +02:00
Jules Blok
a141e91dd2 OGL: Check for GL_DEPTH_CLAMP support.
It's not available in OpenGL ES and officially it's not supported on OpenGL 3.0/3.1.

Fallback to old depth range code if there is no method to disable depth clipping.
It's more important to have correct clipping than to have accurate depth values.
Inaccurate depth values can be fixed by slow depth.
2016-08-15 13:11:26 +02:00
Jules Blok
e9e81ece65 VideoBackends: Enable depth clamping. 2016-08-15 13:11:25 +02:00
Stenzek
bce8097712 D3D11: Support texture dumping of non-zero mipmap levels 2016-08-10 23:45:25 +10:00
Pierre Bourdon
d078c6cb35 Merge pull request #4073 from amaiorano/fix-d3d-debugobjectname
Fix D3D::SetDebugObjectName to bind to the EFB color_read_texture rat…
2016-08-01 00:38:02 +02:00
amaiorano
2030a5e1b8 Fix D3D::SetDebugObjectName to bind to the EFB color_read_texture rather than the depth_read_texture (probably a copy paste error) 2016-07-31 10:48:09 -04:00
Lioncash
14e0b48ae4 VideoCommon: Make API_TYPE an enum class
Allows for forward declarations in most places, which prevents dumping
unrelated VideoCommon.h contents directly into headers.
2016-07-29 19:20:16 -04:00
hthh
8be5717a60 Improve PerfQuery accuracy
In TimeSplitters: Future Perfect, PerfQuery is used to detect
the visibility of lights and draw coronas. 25 points are drawn
for each light. However, the returned count was incorrectly
being divided by four leading to dim coronas.

Using 4x antialiasing was a workaround because of a bug where
antialiasing multiplied the PerfQuery results. This commit
fixes that bug too (but only for OpenGL).
2016-07-04 18:54:49 +10:00
Chris Burgener
28a3691e70 Merge pull request #3930 from RisingFog/split_video_dump_resolution
Split Video Dumps on Resolution Change
2016-06-27 22:39:19 -04:00
Chris Burgener
f31adf9635 Fix D3D crashes/issues 2016-06-27 10:13:17 -04:00
Léo Lam
1b71249562 D3D: Fix crash on start with BBox enabled
Someone removed the BBox::Init(), causing crashes when BBox is enabled.

Fixes issue #9643.
2016-06-27 12:45:00 +02:00
degasus
d79aeaa1e9 VideoCommon: Drop GetConfigName.
We're past 5.0 now, so there is no need to look for old inis.
2016-06-26 12:34:59 +02:00
degasus
5f2f462067 VideoBackends: Merge ShowConfig functions. 2016-06-26 12:34:59 +02:00
degasus
7833ff25df VideoBackends: Merge Initialize and Shutdown functions. 2016-06-26 12:34:59 +02:00
Scott Mansell
2f134c5c36 Remove the rest of ShaderDebugging.
Without UID checking, it's basically a no-op that disables shader cache
and stores the shader source code (without ever reading it back).
2016-06-26 16:25:11 +12:00
Scott Mansell
ebe5fd0b36 Multithreadded Shadergen: Minor fixups. 2016-06-26 16:13:22 +12:00
Scott Mansell
95469ec225 Remove UID Checker.
Kind of pointless now that multiple shaders with the same UID are
now fundementally impossible.
2016-06-26 16:13:22 +12:00
Scott Mansell
24e5d21780 Multithreadded Shadergen: Second pass over Pixel Shadergen.
Note: It's not 100% perfect, as some of the GPU capablities leak into the
pixel shader UID.

Currently our UIDs don't get exported, so there is no issue. But someone
might want to fix this in the future.
2016-06-26 16:13:21 +12:00
Scott Mansell
1a831cfc7d Multithreadded Shadergen: Second Pass over vertex/lighting Shadergens
As much as possible, the asserts have been moved out of the GetUID
function. But there are some places where asserts depend on variables
that aren't stored in the shader UID.
2016-06-26 16:13:21 +12:00
Scott Mansell
28c7113e41 Multithreadded Shadergen: Second Pass over geometery Shadergen 2016-06-26 16:13:21 +12:00
Pierre Bourdon
43d0d692f9 Fix D3D12 headers missing includes. 2016-06-24 11:14:10 +00:00
Pierre Bourdon
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
Stenzek
e169d54f3c D3D11: Fix CPU EFB color reads when MSAA is enabled
Also swaps the byte order from RGBA->BGRA to match GL/D3D12, and what
the read handler is expecting.

Depth reads will now return the minimum depth of all samples, instead of
the average of all samples.
2016-05-19 22:51:00 +10:00
Jules Blok
8a21b082d6 Merge pull request #3745 from stenzek/d3d11-texcache
D3D11: Fix EFB MSAA depth buffer copies, StateManager desyncs in some cases
2016-04-24 11:47:32 +02:00
Lioncash
33c22ffab7 D3D: Amend code to fix a new VS warning
Fixes warning C4334
2016-03-30 20:59:57 -04:00
Stenzek
53cf42fb06 D3D11: Fix some cases where render target switches desynced StateManager
This was occuring in certain EFB copy patterns, leaving the textures
unbound for the next draw call.
2016-03-26 00:01:26 +10:00
Stenzek
63e4e07683 D3D11: Simplify MSAA depth texture resolving
This also fixes EFB depth buffer copies when MSAA is enabled.
2016-03-26 00:00:39 +10:00
EmptyChaos
0b9a72a62d VideoCommon: Refactor TexMode0 mipmaps disabled test into a helper function 2016-03-24 13:43:29 +11:00
EmptyChaos
902e5cddf7 VideoBackends: Do not use Anisotropy on Point filtered textures.
The D3D backend was always forcing Anisotropic filtering when that is enabled regardless of how the game chose to configure the texture filtering registers; this causes the same issues as "Force Filtering" without Anisotropy, such as causing game UI elements to no longer line up adjacent correctly. Historically, OpenGL's Anisotropy support has always worked "better" than D3D's due to seeming to not have this problem; unfortunately, OpenGL's Anisotropy specification only gives GL_LINEAR based filtering modes defined behavior, with only the mipmap setting being required to be considered. Some OpenGL implementations were implicitly disabling Anisotropy when the min/mag filters were set to GL_NEAREST, but this behavior is not required by the spec so cannot be relied on.
2016-03-24 13:43:29 +11:00
Pierre Bourdon
961901daae Merge pull request #3355 from mimimi085181/partial-texture-updates-check-dimensions
Partial texture updates: Check the dimensions of the efb copy
2016-02-29 00:49:48 +01:00
Chris Burgener
6fe3a3004d Rename Direct3D to Direct3D 11 2016-02-16 22:43:21 -05:00
Lioncash
932dd14418 NativeVertexFormat: Add missing override specifier 2016-02-15 23:41:20 -05:00
Lioncash
69c82f32ff NativeVertexFormat: Use in-class initialization 2016-02-15 23:40:34 -05:00
mimimi085181
bb4d636f34 Copy all layers of textures with CopyRectangleFromTexture 2016-02-14 21:17:06 +01:00
mimimi085181
99555a35ca For partial texture updates check the dimensions of the efb copy and the target texture, not just the binary size.
This should get Donkey Kong Country Returns characters to be as broken as they should be. They will be fixed in a later pr.

Expected result is:
efbtex: characters are always flickering or invisible, no matter what scaling or IR setting
efb2ram: characters are always working properly at 1xIR, no matter what scaling or IR setting
2016-02-14 17:13:51 +01:00
Ryan Houdek
e1f21602fd Merge pull request #3426 from Sonicadvance1/ES_fix_framedump
Add support for framedumping to OpenGL ES.
2016-01-28 18:24:32 -05:00
Lioncash
5ebd1e215b Fifo: Make g_bSkipCurrentFrame a TU-local variable
This is only ever queried, making it a global isn't necessary.
2016-01-25 05:23:14 -05:00
Lioncash
e187c55bdd OpcodeDecoder: Add namespace 2016-01-24 01:31:36 -05:00
Lioncash
d9fec92628 VideoCommon: Header cleanup
Also remedies places where the video backends and core rely on things
being indirectly included.
2016-01-17 20:11:45 -05:00
Jules Blok
48b60649af Merge pull request #3495 from Armada651/d3d-float
D3D: Use a 32-bit floating point depth buffer.
2016-01-14 00:39:23 +01:00
degasus
5f244abf28 Fifo: Create a "Fifo" namespace. 2016-01-12 23:28:26 +01:00
degasus
0c92603fd5 Merge VideoBackendHardware into VideoBackend.
And rename it to VideoBackendBase because of conflicts within the backends itself.
2016-01-12 23:18:58 +01:00
Jules Blok
8158d291aa D3D: Use the full depth range for Z pokes. 2016-01-11 22:27:41 +01:00
Jules Blok
129975233f D3D: Use a 32-bit floating point depth buffer. 2016-01-11 22:27:40 +01:00
Pierre Bourdon
e7fbd1fd50 Merge pull request #3439 from Armada651/depth-range
Render: Clamp the z range to the full range.
2016-01-10 19:09:57 +01:00
Ryan Houdek
3f15aa4b57 Add support for framedumping to OpenGL ES. 2016-01-09 00:21:20 -06:00
Pierre Bourdon
bf1c53a6e8 Merge pull request #3451 from RisingFog/libav
Use ffmpeg for Windows Video Dumping instead of VFW
2016-01-09 01:01:05 +01:00
Chris Burgener
c34fb3edf0 Use ffmpeg for Windows Video Dumping instead of VFW 2016-01-07 18:37:58 -05:00
degasus
ad1f7576ad VideoConfig: Use "GFX.ini" for both D3D and OGL.
They share the same format, so there is no need to separate their configs.
2016-01-06 21:43:11 +01:00
Jules Blok
8c3108b354 Render: Clamp the z range to the full range. 2016-01-03 15:39:34 +01:00
Lioncash
01f99a04a2 VideoBackend: Get rid of a boolean global
Also gets rid of global headers
2016-01-02 18:03:28 -05:00
Markus Wick
330329254c Merge pull request #3361 from stenzek/d3d-vectored-efb-pokes
D3D: Implement vectored efb pokes
2015-12-30 15:27:24 +01:00
Scott Mansell
d8e5d8659e TextureCache, fix an incorrect assert. 2015-12-29 14:25:31 +13:00
Markus Wick
aabcd441d9 Merge pull request #3381 from Armada651/revert-3076
Revert "Merge pull request #3076 from void-ghost/stereo3d_presets"
2015-12-28 10:18:32 +01:00
Stenzek
5cb047f449 D3D: Fix compilation error on windows 2015-12-28 15:50:01 +10:00
Markus Wick
294bb75316 Merge pull request #3295 from stenzek/d3d-xfb-msaa
D3D: Fix multiple issues relating to MSAA
2015-12-28 01:13:42 +01:00
Stenzek
4d48a7abfc D3D: Fix crash on startup/resize 2015-12-23 23:07:31 +10:00
Lioncash
da0e647346 Render: Get rid of explicit new and delete 2015-12-22 19:10:05 -05:00
Jules Blok
8bda12bcfd Revert "Merge pull request #3076 from void-ghost/stereo3d_presets"
This reverts commit 81414b4fa2, reversing
changes made to b926061f64.

Conflicts:
	Source/Core/DolphinWX/Frame.cpp
	Source/Core/VideoCommon/VideoConfig.cpp
	Source/Core/VideoCommon/VideoConfig.h
2015-12-23 00:35:19 +01:00
Lioncash
f448c6e291 FramebufferManagerBase: Get rid of explicit delete and new 2015-12-21 15:57:48 -05:00
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
Stenzek
a61fc372bb VideoCommon: Change PokeEFB to take a pointer rather than a vector
This saves allocating a vector for the pass-through path.
2015-12-20 14:42:14 +10:00
Stenzek
7b628c99ec D3D: Implement vectored efb pokes, increase util vertex buffer size to 64KiB 2015-12-20 00:31:58 +10: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
Stenzek
63264ac23f D3D: Fix EFB depth buffer copies, filtering on scaled EFB copies when MSAA is enabled, real XFB filtering
Since ResolveSubresource cannot be used with depth textures (and throws an error with the debug layer enabled), use a shader which selects the minimum depth value from all samples.

Changes the sampler by XFBEncoder to use a linear filter, rather than point, to match GL behavior.
2015-12-08 20:29:21 +10:00
Stenzek
5e803c3db3 D3D: Fix EFB->XFB copies incorrectly scaling, match GL behavior 2015-11-28 20:04:36 +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