Commit graph

335 commits

Author SHA1 Message Date
Lioncash
2237a6a04c OGL/VertexManager: Make vertex and index buffer handles private
These are only ever read, but not written to outside of the VertexManager class.
2017-09-02 20:51:54 -04:00
Jonathan Hamilton
662abcb2fe Parse IMGTEC's GL_VERSION string format
ImgTec's driver uses a major.minor@changeID versioning system

This is packed into a double so "1.9@4850625" becomes "109.4850625"

The next release brnach is expected to be 1.10, hence the need for 2
digits for the branch minor.

The changeID should be unique for each build, but is shared over all
branches, so only makes sense to compare withing a branch.

It's likely branch 'major' versions will be used for major hardware
revisions, and the drivers for both maintained in parallel. Thus it
may not make sense to compare versions between different major
verisons - if/when this happens we can hook up a DriverDetails::Family
as needed.
2017-09-02 14:05:16 -07:00
Stenzek
63305e9173 HiresTextures: Support loading BC7 (BPTC) from DDS files 2017-08-01 11:59:38 +10:00
Stenzek
cd502990fa OGL: Uber shader support 2017-07-30 17:43:59 +10:00
Stenzek
7d78cf0f6f ShaderGen: Implement pixel ubershaders 2017-07-30 17:43:59 +10:00
Stenzek
3ea9d86faa ShaderGen: Pass host config to shader generation functions
Also moves the host config checks to common.
2017-07-20 17:54:33 +10:00
Stenzek
62a901508b OGL: Reload shader cache when relevant video config changes 2017-07-20 17:46:59 +10:00
Jules Blok
f3508742ac OGL: Support Quad-Buffered stereoscopy. 2017-07-05 22:43:39 +02:00
shuffle2
e63c337830 Merge pull request #5305 from iwubcode/abstract_texture
Abstract Texture
2017-06-18 12:57:05 -07:00
Leo Lam
bc9c9b9fe4 Merge pull request #5594 from MerryMage/phack
Cleanup Projection Hack
2017-06-16 18:36:39 +02:00
JosJuice
f09ceaa735 Move IOFile to a separate file
Reduces the number of files that need to be recompiled
when making changes to FileUtil.h.
2017-06-15 21:33:50 +02:00
MerryMage
f8a99ca192 VertexShaderManager: Rename projection hack variables 2017-06-15 16:38:10 +01:00
iwubcode
2cdc93f4ab Video Backends: Split texture cache code out into separate files, introduce 'AbstractTexture' 2017-06-13 00:41:51 -05:00
MerryMage
a0b41c83e7 VideoConfig: Remove bRunning
Value was set but not used.
2017-06-11 15:06:12 +01:00
Shawn Hoffman
5480efdff2 video: change multisample/AA setting to u32 2017-06-07 20:20:25 -07:00
MerryMage
f5f45855f0 GameConfigLoader: Add GFX Game INI translations 2017-06-03 18:13:02 +01:00
degasus
afb0beb9ab OpenGL: Mute nvidia performance warning about stalling the GPU.
They are right, our perf query implementation is terrible.
But raising a warning makes it just even slower.
2017-05-03 23:48:14 +02:00
Stenzek
f5d95dcc86 OGL: Use native compressed textures on supported drivers 2017-04-29 00:44:34 +10:00
Stenzek
a10e8b1ef5 VideoCommon: Move the blit methods to the backend class
The parameter types will be different for each backend currently,
anyway (e.g. textures/render passes/etc).
2017-04-25 14:25:41 +10:00
Stenzek
fd896bd9e0 OGL: Drop BlendingState.dither
How GL_DITHER works is implementation-defined, and we handle the
non-blended case in the pixel shader.
2017-04-18 21:55:23 +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
Lioncash
c7ab6861c2 RenderBase: Return a tuple from ConvertStereoRectangle instead of using out parameters 2017-04-09 15:11:59 -04:00
Stenzek
b01bcb80f4 OGL: Implement GPU texture decoding backend 2017-04-01 12:32:56 +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
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
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
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
de940a5fd6 VideoConfig: add bSupportsFragmentStoresAndAtomics 2017-03-15 17:20:47 -07: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
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
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
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
Michael Maltese
db1d826ac3 OGL SetBlendMode: always set blend equation and func
Before #4581, an invocation of `SetBlendMode` could invoke
`glBlendEquationSeparate` and `glBlendFuncSeparate` even when it was
setting `glDisable(GL_BLEND)`. I couldn't figure out how to map the old
behavior over to the new BlendingState code, so I changed it to always
call the two blend functions.

Fixes https://bugs.dolphin-emu.org/issues/10120 : "Sonic Adventure 2
Battle: graphics crash when loading first Dark level".
2017-03-01 00:49:14 -08:00
Jules Blok
a15555fe03 VideoBackends: Use vertex shader depth range if ztexture is used. 2017-02-26 11:34:48 +01:00
Jules Blok
bde8126913 VideoBackends: Remove depth range clamping hacks.
Oversized depth ranges are handled correctly now, we don't need to hack around them with clamps anymore.
2017-02-24 14:54:20 +01:00
Jules Blok
94522d4cf3 OGL: Add support for glDepthRangedNV to handle oversized depth ranges. 2017-02-24 14:54:16 +01:00
Jules Blok
28e6e259ed VideoBackends: Set the maximum range when the depth range is oversized.
The depth values generated by the vertex shader need to be clamped correctly.
2017-02-21 02:57:23 +01:00
Lioncash
468f623d27 ShaderGenCommon: Remove unnecessary includes 2017-02-01 12:19:55 -05:00
Lioncash
273ace7bb7 LightingShaderGen: Remove unnecessary includes 2017-02-01 01:06:00 -05:00
Lioncash
70cf774a5c RenderBase: Forward declare EFBAccessType 2017-01-23 12:41:26 -05:00
Lioncash
5b461f50af VideoBackendBase: Convert EFBAccessType into an enum class 2017-01-23 03:53:38 -05:00
degasus
23b0faeba5 OGL: Use VideoCommon blend state for framebuffer configuration. 2017-01-06 14:01:39 +01:00
Jules Blok
65b5765858 VideoBackends: Clamp the range to the maximum depth value supported in the z buffer. 2016-12-27 20:25:40 +01:00
Jules Blok
ef82aebb97 VideoCommon: Don't process the depth range in the vertex shader if it's not oversized. 2016-12-27 14:31:17 +01:00
Mat M
9160be50db Merge pull request #4224 from lioncash/tcache
TextureCacheBase: Eliminate static state
2016-12-23 04:33:42 -05:00
Stenzek
607ce40f0b OGL: Fix black screen when MSAA is enabled 2016-12-12 17:51:19 +10:00
Lioncash
58a5395173 TextureCacheBase: Eliminate static state 2016-12-09 16:50:37 -05:00