Commit graph

1489 commits

Author SHA1 Message Date
Stenzek
ddc5275071 VideoCommon: Drop SetDitherMode()
It was a no-op on all backends apart from GL anyhow.
2017-04-18 21:55:22 +10:00
Stenzek
9dc7358395 Vulkan: Use BlendingState from VideoCommon
Remove the internal BlendState union. Also fixes Kirby's Return to
Dreamland shadows.
2017-04-18 21:55:22 +10:00
Stenzek
34ad5b457d VideoCommon: Add usedualsrc field to BlendingState
This is because we re-use BlendingState for our internal drawing (e.g.
RasterFont) and for these shaders, we can't assume the presence of a
second color output.
2017-04-18 21:33:40 +10:00
Stenzek
e370f6a82a OGL: Use struct for post-processing shader options
This removes the need for token pasting, which isn't supported in GLSL
ES. Shouldn't cause any issues unless people are using reserved keywords
as option names.
2017-04-16 14:00:02 +10:00
Stenzek
c8b98dca1a Vulkan: Raise the number of texel buffer/storage image descriptors
Running with GPU texture decoding enabled could cause us to run out of
descriptors within a single frame.
2017-04-14 18:29:53 +10:00
Stenzek
f4bdfe3e0c Vulkan: Fix incorrect render pass area for out-of-range clears
This occured when a game set an out-of-range EFB clear region.
2017-04-14 18:29:48 +10:00
Stenzek
5e7bd03d0b Vulkan: Linear filter >1xIR EFB copies, matching the other backends 2017-04-12 00:11:22 +10:00
Stenzek
e9850aa0f2 VideoBackends: Support updated texture encoding shader generators 2017-04-12 00:11:22 +10:00
Markus Wick
4e90c5da8b Merge pull request #5234 from lioncash/tuple
RenderBase: Return tuples from CalculateTargetScale and ConvertStereoRectangle instead of using out parameters
2017-04-11 10:27:16 +02:00
Anthony
c6b553b6d2 Merge pull request #5220 from stenzek/small-nonsquare-mips
TextureCache: Fix incomplete GPU texture decoding of non-square mips
2017-04-09 13:45:38 -07:00
Lioncash
c7ab6861c2 RenderBase: Return a tuple from ConvertStereoRectangle instead of using out parameters 2017-04-09 15:11:59 -04:00
Stenzek
2492f196a7 TextureCache: Fix incomplete GPU texture decoding of non-square mips 2017-04-07 23:03:14 +10:00
Lioncash
f7a2f6ad01 FileSearch: Namespace functions under the Common namespace 2017-04-07 01:02:14 -04:00
Stenzek
97dc773a3e D3D: Drop redundant interface TextureEncoder 2017-04-04 22:57:23 +10:00
Stenzek
739aced97c Vulkan: Implement compute-shader based GPU texture decoding 2017-04-01 12:32:57 +10:00
Stenzek
5fbc63fbcf Vulkan: Compute shader support 2017-04-01 12:32:57 +10:00
Stenzek
02f887ede0 OGL: Add GPUTimer class for measuring execution time of a draw/dispatch 2017-04-01 12:32:57 +10:00
Stenzek
b01bcb80f4 OGL: Implement GPU texture decoding backend 2017-04-01 12:32:56 +10:00
Stenzek
82fd984f3e VideoBackends: Add configuration field for GPU texture decoding 2017-04-01 12:32:05 +10:00
Stenzek
abc662d69c OGL: Support compute shaders and emitting GLSL 4.3
This also changes bSupportsEarlyFragmentTests to
bSupportsImageLoadStore, as it is used for both.
2017-04-01 12:31:41 +10:00
Stenzek
b987f220e1 VideoBackends: Add support flag for compute shaders 2017-04-01 12:31:41 +10:00
Stenzek
a8876a29fe OGL: Use ARB_texture_storage to allocate TextureCache entries
This ensures that they are complete textures by decoding time, as when
using compute shaders we write directly to the destination texture.
2017-04-01 12:31:41 +10:00
Stenzek
f8059eae43 OGL: Fix render-target texture mipmap allocation
The loop was allocating one-too-many levels, as well as incorrect sizes
for each level. Probably not an issue as mipmapped render targets aren't
used, but the logic should be correct anyway.
2017-04-01 12:31:40 +10:00
Stenzek
5326a18fdf OGL: Fix MSAA being forced to 1x
This was a regression from the remove-everything-static-from-renderer
PR. As the comment indicates, it would be nice to move all of this logic
out of the Renderer constructor, but this is a much larger change.
2017-03-31 21:55:26 +10:00
Vincent Duvert
bbb5945375 OGL: Fix texture_type checks in CreateTexture
The FrameBufferManager::CreateTexture (from the OpenGL backend) method introduced by commit 69cedf41 incorrectly compares the texture variable (which contains a name provided by glGenTextures) against GL_TEXTURE_2D_MULTISAMPLE_ARRAY and GL_TEXTURE_2D_MULTISAMPLE.
It should instead use the texture_type variable for this (as done in the first branch of the if).
2017-03-17 23:53:56 +01:00
Michael Maltese
134317e07f videoconfig: add BBoxPreferStencilImplementation
@JMC47 requested this to be able to do performance comparisons.
2017-03-15 17:41:33 -07:00
Michael Maltese
53224d41d0 OGL: only create stencil buffer when needed 2017-03-15 17:41:33 -07:00
Michael Maltese
ba6e917b49 OGL: implement Bounding Box on systems w/o SSBO
This commit should have zero performance effect if SSBOs are supported.

If they aren't (e.g. on all Macs), this commit alters FramebufferManager
to attach a new stencil buffer and VertexManager to draw to it when
bounding box is active. `BBoxRead` gets the pixel data from the buffer
and dumbly loops through it to find the bounding box.

This patch can run Paper Mario: The Thousand-Year Door at almost full
speed (50–60 FPS) without Dual-Core enabled for all common bounding
box-using actions I tested (going through pipes, Plane Mode, Paper
Mode, Prof. Frankly's gate, combat, walking around the overworld, etc.)
on my computer (macOS 10.12.3, 2.8 GHz Intel Core i7, 16 GB 1600 MHz
DDR3, and Intel Iris 1536 MB).

A few more demanding scenes (e.g. the self-building bridge on the way
to Petalburg) slow to ~15% of their speed without this patch (though
they don't run quite at full speed even on master). The slowdown is
caused almost solely by `glReadPixels` in `OGL::BoundingBox::Get`.

Other implementation ideas:

- Use a stencil buffer that's separate from the depth buffer. This would
  require ARB_texture_stencil8 / OpenGL 4.4, which isn't available on
  macOS.

- Use `glGetTexImage` instead of `glReadPixels`. This is ~5 FPS slower
  on my computer, presumably because it has to transfer the entire
  combined depth-stencil buffer instead of only the stencil data.
  Getting only stencil data from `glGetTexImage` requires
  ARB_texture_stencil8 / OpenGL 4.4, which (again) is not available on
  macOS.

- Don't use a PBO, and use `glReadPixels` synchronously. This has no
  visible performance effect on my computer, and is theoretically
  slower.
2017-03-15 17:41:32 -07:00
Michael Maltese
56fe938366 extract OGL::FramebufferManager::BindLayeredTexture 2017-03-15 17:20:47 -07:00
Michael Maltese
69cedf4144 extract OGL::FramebufferManager::CreateTexture 2017-03-15 17:20:47 -07:00
Michael Maltese
de940a5fd6 VideoConfig: add bSupportsFragmentStoresAndAtomics 2017-03-15 17:20:47 -07:00
Markus Wick
31bb41c532 Merge pull request #4973 from z0z0z/master
Disable pinned memory for AMD mesa drivers
2017-03-14 10:02:05 +01:00
Jules Blok
0a2b58c896 OGL: Remove support for NV_depth_buffer_float.
We can't clamp the depth values to the 24-bit range while this extension is active.
2017-03-14 01:02:13 +01:00
Stenzek
27d7a1646c Merge pull request #5065 from JosJuice/character
Fix issue 10146 (compilation issue because of colliding defines)
2017-03-11 18:26:26 +10:00
JosJuice
40e707348c Fix issue 10146 (compilation issue because of colliding defines) 2017-03-11 08:59:14 +01:00
Markus Wick
e99cd57eb3 Merge pull request #4935 from Armada651/depth-range-fix
VideoBackends: Set the maximum range when the depth range is oversized.
2017-03-10 18:05:52 +01:00
Stenzek
42993eeabc D3D11: Fix error on startup with >2.5xIR selected 2017-03-10 23:41:20 +10:00
Markus Wick
ef74c5eabd Merge pull request #5051 from stenzek/renderer-fixes
VideoBackends: Fix crashes introduced by #4999
2017-03-09 21:06:50 +01:00
JosJuice
ced1614cac Unify the way of setting game ID, title ID, revision
The existing code from ConfigManager, ES and MIOS is merged
into a new set of functions called SetRunningGameMetadata.
2017-03-09 15:34:14 +01:00
Stenzek
2cd240af0d VideoBackends: Move max texture size to VideoConfig
This stops the virtual method call from within the Renderer constructor.

The initialization here for GL had to be moved to VideoBackend, as the
Renderer constructor will not have been executed before the value is
required.
2017-03-10 00:04:13 +10:00
Markus Wick
489d90b6f3 Merge pull request #4999 from stenzek/renderer-statics
VideoCommon: Eliminate static state in Renderer
2017-03-08 11:02:20 +01:00
Mat M
7fa14169e9 Merge pull request #5007 from lioncash/swap
Common: Move byte swapping utilities into their own header
2017-03-05 09:45:29 -05:00
Markus Wick
7304cb0f8e Merge pull request #5011 from stenzek/d3d-texture-corruption
D3D11: Use default usage for TextureCache entries
2017-03-04 15:55:58 +01:00
Stenzek
725d5bc3a1 D3D11: Drop unused method ReplaceRGBATexture2D 2017-03-04 22:37:10 +10:00
Stenzek
526fa9bc85 D3D11: Use D3D11_USAGE_DEFAULT for all TextureCache textures 2017-03-04 22:36:33 +10:00
Stenzek
4cea9a2f99 Vulkan: Fix underflow in StreamBuffer::WaitForClearSpace
This could cause the assertion on line 212 to fail when uploading large
amounts of data in between command buffer executions.
2017-03-04 18:07:04 +10:00
Stenzek
00a0a91513 VideoCommon: Move last EFB scale handling to CalculateTargetSize 2017-03-04 16:53:07 +10:00
Stenzek
afc25fdca0 VideoCommon: Rename Renderer s_ prefixes to m_ 2017-03-04 16:42:21 +10:00
Stenzek
238a70b006 VideoCommon: Move some common initialization logic to RenderBase 2017-03-04 16:42:16 +10:00
Stenzek
277829d842 VideoCommon: Eliminate static state in Renderer 2017-03-04 16:39:50 +10:00