Commit graph

906 commits

Author SHA1 Message Date
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
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
Scott Mansell
d197f489b9 analytics: Report OpenGL's adapter name too. 2016-06-20 23:54:44 +12:00
Anthony Serna
0e5852f634 [OGL] Workaround nvidia being weird with GL_MAX_TEXTURE_SIZE 2016-05-30 10:06:19 -05:00
Rohit Nirmal
14220ae488 Fix building with PCH disabled. 2016-05-26 13:05:21 -05:00
Stenzek
89e54fbd6c OGL: Work around slowdown of glMapBufferRange with SSBO on NVIDIA drivers
Using glMapBufferRange to read back the contents of the SSBO is extremely
slow on NVIDIA drivers. This is more noticeable at higher internal
resolutions. Using glGetBufferSubData instead does not seem to exhibit
this slowdown.
2016-05-19 21:24:09 +10:00
degasus
bca0e06a95 OGL: Use coherent mapping on Qualcomm devices. 2016-05-11 23:55:28 +02:00
degasus
6219c39cf5 OGL: Drop QC ES3.1 workaround.
This was never tested well:

HdkR> The tester was most likely trying to load a stale shader cache or something
2016-05-11 20:45:07 +02:00
Stenzek
6f3573dda8 D3D12: Implement XFB encoding/decoding (support Real XFB) 2016-05-08 23:18:51 +10:00
Pierre Bourdon
2fd0884347 Merge pull request #3672 from EmptyChaos/d3d-anisotropy
Fix D3D Forced Anisotropy
2016-03-26 03:25:01 +01:00
Scott Mansell
066b6b0bcb OpenGL: Cache query to max texture size.
This showed up really high when I was profiling things.
2016-03-26 03:14:39 +13: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
mimimi085181
bb4d636f34 Copy all layers of textures with CopyRectangleFromTexture 2016-02-14 21:17:06 +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
Pierre Bourdon
be1a9e4231 Merge pull request #3518 from Sonicadvance1/blacklist_sandy
Blacklist Sandy Bridge on mesa from using geometry shaders.
2016-01-20 19:32:56 +01:00
Ryan Houdek
3dda36bc5b Blacklist Sandy Bridge on mesa from using geometry shaders. 2016-01-20 12:13:21 -06: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
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
Ryan Houdek
5a549ef663 [Android] Add support for rotation and minimizing the application 2016-01-10 13:00:32 -06: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
b4eb5d8e3f Disable geometry shaders on mesa AMD/ATI drivers.
Causes misrenderings in games that uses them.
2016-01-09 15:09:37 -06: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
Jules Blok
db551c55a2 FrameBufferManager: Fix typo in stereoscopic MSAA shader. 2016-01-07 20:05:12 +01: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
Ryan Houdek
0a42a0ab1b Merge pull request #3428 from Sonicadvance1/proper_glextensions
Make GLExtensions no longer require slghtly modified GL headers
2016-01-06 15:24:47 -05:00
Mathew Maidment
0509292f86 Merge pull request #3431 from stenzek/shadercache
ShaderGen: Remove virtual methods and string from ShaderGeneratorInterface.
2016-01-04 19:11:14 -05:00
Markus Wick
ca7160f714 Merge pull request #3434 from lioncash/enum
OnScreenDisplay: Make CallbackType an enum class
2016-01-04 13:47:22 +01:00
Markus Wick
3045e08daf Merge pull request #3430 from lioncash/compare
ProgramShaderCache: Simplify SHADERUID comparison operators
2016-01-04 13:42:39 +01:00
Lioncash
1bcfae5fd7 OGL: Correct unique_ptr types
By default unique_ptr will call delete on the given type if an array
qualifier isn't present, not delete[]. It's important to explicitly
specify an array is being handled.
2016-01-03 16:00:16 -05: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
Lioncash
edda018d54 OnScreenDisplay: Make CallbackType an enum class 2016-01-02 14:57:55 -05:00
Ryan Houdek
37525f3fcf Make GLExtensions no longer require slghtly modified GL headers.
In fact, removes the need for external headers at all.
2016-01-02 10:34:13 -06:00
Stenzek
617f9d9532 ShaderGen: Remove virtual methods from ShaderGeneratorInterface, move string buffer to ShaderCode
This fixes the crashes occuring at startup with a non-empty shader cache.
Because LinearDiskCache reads/writes to the storage of ShaderUid, ShaderUid must be trivially copyable.
Additionally, adds a static assert to LinearDiskCache to ensure this doesn't happen in the future.

The initialization of ShaderUid data has been moved to the code generation functions, so the above condition holds true.
2016-01-02 17:35:06 +10:00
Lioncash
6093d1f72a ProgramShaderCache: Simplify SHADERUID comparison operators 2016-01-01 22:28:42 -05:00
Ryan Houdek
b4e9bbb551 Merge pull request #3336 from Sonicadvance1/improve_glextensions
[GLExtensions] Improve the extension loader.
2016-01-01 13:01:51 -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
Lioncash
8ce3a4aa70 ShaderGeneration: Get rid of static buffers 2015-12-26 17:01:54 -05:00
Stenzek
12ef4c8ae0 OGL: Fix for black framebuffer when resolution/msaa mode changes 2015-12-23 23:29:32 +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
e422af9cce FramebufferManager: Get rid of raw new and delete 2015-12-22 18:06:05 -05:00
Lioncash
f448c6e291 FramebufferManagerBase: Get rid of explicit delete and new 2015-12-21 15:57:48 -05:00
Lioncash
d20ba76ab3 StreamBuffer: Make factory function return a std::unique_ptr 2015-12-21 10:21:38 -05:00
Lioncash
ec71452706 StreamBuffer: Correct function casing 2015-12-21 10:09:03 -05:00
Lioncash
1eea95a5be StreamBuffer: Use std::array for fences 2015-12-21 10:07:56 -05:00
Lioncash
7b69fec8e7 StreamBuffer: Remove unnecessary inline specifiers
Methods defined directly in class bodies are inline by default
2015-12-21 10:04:14 -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
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
degasus
e26d9f7c35 MSAA: Store samples in ini files. 2015-12-15 09:41:01 +01:00
Ryan Houdek
78dda1cf79 [OGL] Update extension checks in Render.
This was relying on behaviour that GLExtensions was adding fake extensions to the supported list with ES.
This no longer happens so it needed to be changed.
2015-12-13 11:39:45 -06:00
Ryan Houdek
21b708106c Make sure not to use a GL texture buffer past the max size.
The spec says that vendors can set the max texture size to be 65KB and we want 1MB.
Check the maximum supported and drop to the max if it is less than 1MB
2015-11-30 01:18:03 -06: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
degasus
df799dd124 VideoCommon: Create default implementation for state setters
It's fine to pull those within the backends, so there is no need to enforce them to implement this interface.
2015-11-24 22:39:10 +01:00
Ryan Houdek
d27dcdba48 We shouldn't be trying to enable the SSBO extension in ES. 2015-11-23 14:47:43 -06:00
Ryan Houdek
ed5e3c054e Enable Anisotropic filtering in ES.
This adds a check to make sure the vendor supports anisotropic filtering.
Pretty much all vendors support this, even the mobile ones.
2015-11-19 02:00:43 -06: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
71b22702a1 OGL-TextureConverter: Keep care about the global state ifself 2015-11-15 11:59:52 +01:00
degasus
495902787c OGL: Remove TCache::Entry usage in TextureConverter 2015-11-15 11:59:52 +01:00
Tillmann Karras
81d9cce70c VideoCommon: rename TextureCache to TextureCacheBase 2015-11-06 15:43:58 +01:00
Scott Mansell
51c984dde3 Remove the "Show EFB Copy Regions" debug option.
It was only implemented in OpenGL, though the option was visible in both
backends, leading to memory leaks if you enabled it in DirectX.

And it wasn't particularly useful as a debug feature as it only showed
where in the EFB the copies were taken from, not what format it was, or
what the copy was used for, or what content was in the EFB at that point
in time.

Also, it stretched the copy regions relative to the window, so the
on-screen regions don't even line up with the window unless the game used
the full EFB (some pal games) and you game image stretched to the full
window.
2015-11-05 18:15:46 +13:00
Scott Mansell
05b06b7a21 Merge pull request #3227 from Tilka/sizeof
OGL: don't hardcode buffer sizes
2015-11-04 14:35:23 +13:00
Tillmann Karras
39313152ba OGL: use StringFromFormat where appropriate 2015-11-04 01:56:02 +01:00
Scott Mansell
e161e714c7 Merge pull request #3226 from Tilka/shadergen
VideoCommon: return code/uid from shader gens
2015-11-04 13:42:49 +13:00
Tillmann Karras
bc38892db7 DriverDetails: remove BUG_BROKENINFOLOG leftovers
It was removed in 9618738278.
2015-11-03 18:50:44 +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
Tillmann Karras
f9512ece77 OGL/ProgramShaderCache: small cleanup
Drop an unused function and privatize the cash, er, I mean cache.
2015-10-29 13:51:25 +01:00
Lioncash
c28e3affc5 TextureCacheBase: Change CacheLinesPerRow to BytesPerRow 2015-10-22 08:14:43 -04:00
Scott Mansell
9ee610830c Make sure FORCE_EARLY_Z is defined for GLES 2015-10-18 02:37:14 +13:00
Scott Mansell
e7b2a22225 Support Conservative Depth as a fallback for EarlyZ
Allows Mesa based drivers to support ZCompLoc
2015-10-18 01:46:54 +13:00
flacs
b0bbe52cc9 Merge pull request #3164 from phire/samplerArrays
PixelShaderGen: Use arrays of texture samplers.
2015-10-12 18:44:14 +02:00
Scott Mansell
645e4cbbee PixelShaderGen: Use arrays of texture samplers. 2015-10-12 05:06:39 +13:00
Tillmann Karras
99228633c3 OGL: simplify AA modes initialization 2015-10-10 22:51:31 +02:00
shuffle2
81414b4fa2 Merge pull request #3076 from void-ghost/stereo3d_presets
Stereo3d presets
2015-10-03 18:10:23 -07:00
Lioncash
5464e698fc Merge pull request #3102 from rohit-n/build-pch
Fix building with PCH disabled.
2015-10-03 13:30:51 -04:00
Scott Mansell
58d893e56f Merge pull request #3075 from waddlesplash/no-regexp
FileSearch: Don't use RegExes, just do string comparisons.
2015-10-02 04:00:23 +13:00
Lioncash
d6ff75d71d OGL: Remove unnecesary FPSCounter include from Render.cpp 2015-09-29 10:01:38 -04:00
Rohit Nirmal
3b75f45cf6 Fix building with PCH disabled. 2015-09-28 11:51:08 -05:00
waddlesplash
06c6f60f5b OGL: Use SplitPath() instead of std::regex. 2015-09-27 13:26:19 -04:00
waddlesplash
5643fe5d1f FileSearch: Don't use RegExs, just do string comparisons.
Nothing used the RegEx feature of FileSearch, and GCC < 4.9
doesn't support C++11 RegEx properly, so get rid of it.
2015-09-27 13:25:51 -04:00
flacs
8ea9b07b59 Merge pull request #3093 from lioncash/header_shuffle
Common: Trim Common.h
2015-09-27 03:18:03 +02:00
Lioncash
1d42db2439 Common: Move NonCopyable to its own header 2015-09-26 18:50:35 -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
c9836ff592 EGL: Don't depend on VideoCommon or Core 2015-09-22 00:36:48 +12:00
Scott Mansell
93f6563789 WGL: Don't depend on Core/VideoCommon 2015-09-22 00:36:45 +12:00
Scott Mansell
95f3c956a8 Move GL interface code out of the OpenGL video backend. 2015-09-22 00:36:45 +12:00
degasus
c976e14277 GLInterface: Fix VideoSW on linux + OSX (v2)
Our Video Software backend isn't OpenGL Core compatible, so we need a flag to alloc a compatible one.

v2: Fix AGL profile selection.
2015-09-19 13:22:55 +02:00
Markus Wick
a7e9a154a5 Revert "GLInterface: Fix VideoSW on linux + OSX" 2015-09-18 13:40:09 +02:00
degasus
48279c1840 GLInterface: Fix VideoSW on linux + OSX
Our Video Software backend isn't OpenGL Core compatible, so we need a flag to alloc a compatible one.
2015-09-17 17:52:56 +02:00
Ryan Houdek
5556781946 Merge pull request #3018 from Armada651/ogl-tab
OGL: Invert Top-and-Bottom mode.
2015-09-12 02:21:19 -04:00
Ryan Houdek
17ff069d4a Merge pull request #3002 from degasus/master
OGL: reimplement SSAA based on ARB_gpu_shader5
2015-09-12 02:14:45 -04:00
Jules Blok
99c08c89bb OGL: Invert Top-and-Bottom mode. 2015-09-10 22:22:26 +02:00
Ryan Houdek
3014feedc8 Merge pull request #3012 from degasus/destAlpha
VideoCommon: Drop "Disable destAlpha" hack
2015-09-10 13:56:43 -04:00
Scott Mansell
de9310fe70 Split OpenGL errors into a separate logtype from Video errors.
Allows them to be enabled/disabled separately.
2015-09-10 18:38:45 +12:00
degasus
74b20e627c VideoCommon: Drop "Disable destAlpha" hack
This option has no use any more, neither performance nor driver workaround.
2015-09-09 21:31:54 +02:00
Scott Mansell
a95adba39b Drop DEBUG_SEVERITY_NOTIFICATION messages down to DEBUG_LOG 2015-09-09 12:22:52 +12:00
degasus
664beea538 OGL: reimplement SSAA based on ARB_gpu_shader5
So i965 shall support it again.
2015-09-07 22:21:11 +02:00
Ryan Houdek
bfb544e1fb [GLES] Enable bounding box support. 2015-09-07 12:07:27 -05: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
Tillmann Karras
a8c8f52f20 OGL: remove unused variable 2015-09-05 12:40:14 +02: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
Ryan Houdek
9618738278 Remove all of our workarounds for Qualcomm devices we don't support anymore. 2015-09-04 23:45:35 -05:00
Markus Wick
e7660325b4 Merge pull request #2967 from Sonicadvance1/GLES_blend_func_extended
Support EXT_blend_func_extended in GLES.
2015-09-05 03:43:28 +02:00
Ryan Houdek
5fa4c8d930 Support EXT_blend_func_extended in GLES.
This lets us get dual source blending on GLES targets.
2015-09-04 20:25:59 -05:00
Ryan Houdek
6cf7048423 Implement ClearCurrent on the EGL GLInterface
This fixes an error on GLInterface shutdown when using EGL.
2015-09-04 19:58:58 -05:00
Shawn Hoffman
aa7208e270 [windows] Update projects to vs2015. 2015-09-03 04:23:01 -07:00
Ryan Houdek
7a35f9285b [GLES] Support texture_buffer for palette texture conversion.
OpenGL ES 3.2 adds this feature to core
It was available to GLES 3.1 as GL_{EXT, OES}_texture_buffer as well.
For the non-Nvidia vendors that implemented this is:
      - Qualcomm's Adreno 4xx
      - IMGTec's PowerVR Rogue
2015-09-01 05:41:03 -05:00
Ryan Houdek
01db003779 [Android] Workaround Mali driver issue on the Samsung Galaxy S6.
Samsung updated the video drivers on the SGS6 which introduced a bug when disabling vsync.
Both the driver versions are r5p0, but the md5sums of the blob differ.
To work around the issue, make sure to never disable vsync by calling eglSwapInterval.

We can't actually determine the driver version on Android yet.
So until the driver version lands that displays the driver version string in the GL_VERSION string
we will need to keep this workaround enabled at all times, which is a bit annoying.

Current mali drivers return the video driver version in one of the EGL strings you can query.
The issue with that is that Android eats all of those strings, so we can't query it.
2015-08-28 09:02:46 -05:00
Ryan Houdek
447b1b09e3 Support OpenGL ES 3.2.
OpenGL ES 3.2 adds a few things we care about supporting in core. In particular:
- GL_{ARB,EXT,OES}_draw_elements_base_vertex
- KHR_Debug
- Sample Shading
- GL_{ARB,EXT,OES,NV}_copy_image
- Geometry shaders
- Geometry shader instancing (If they support GL_{EXT,OES}_geometry_point_size)

Nvidia was the first to release an OpenGL ES 3.2 driver which I uesd to test this on.
This also enables GS Instancing on GLES 3.1 hardware if it supports all of the required extensions.
2015-08-26 17:57:51 -05:00
Ryan Houdek
b4e4a4cef4 Disable OpenGL ES 3.1 on all Qualcomm Adreno devices.
Their new driver that supports GLES3.1 + AEP has issues with it.
At the very least they don't implement all of the geometry shader features fully which causes shader linker issues when we attempt to use them.
I don't have a device so I can't fully test, so until I do I'm going to blanket disable the whole thing.
2015-08-22 09:12:19 -05:00
Ryan Houdek
3f1055de94 Fix a memory leak in the EGL GLInterface. 2015-08-18 08:26:45 -05:00
Jules Blok
7e266b080f TextureCache: Remove redundant floor(). 2015-08-15 15:30:50 +02:00
Jules Blok
b01ca1794a Revert "VideoCommon: Clamp integer conversions."
This reverts commit 0f2c72f0f8.
2015-08-15 13:50:43 +02:00
Ryan Houdek
c80e3089c8 [GLES] Fix real XFB.
GLES doesn't support the BGRA texture format type, just use RGBA.
2015-08-12 17:32:05 -05:00
Anthony Serna
ca250f6b71 Specified the type of AA in OGL AA settings 2015-08-09 09:59:20 -07:00
degasus
d3cf4034de DriverDetails: Disable GL_ARB_copy_image on mesa. 2015-08-06 19:41:36 +02:00
degasus
e2f42f8fd0 OGL: Move copy_image variable into backend. 2015-08-06 19:41:36 +02: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
efd250494d Video: stride in bytes rather than pixels 2015-07-25 02:48:56 +08:00
booto
c43ae67b3b RealXFB sizes don't get scaled by IR
When calculating the size of the undisplayed margin in the case where
fbWidth != fbStride for RealXFB for displaying in the output window,
we do not scale by IR - RealXFB is implicitly 1x.
2015-07-25 01:52:13 +08:00
booto
2e28ed3291 Video: respect stride of efb copies to xfb 2015-07-25 01:52:12 +08:00
Ryan Houdek
c81bd32720 Merge pull request #2764 from Sonicadvance1/pvr_workaround3
Work around devices that choose to only return the default EGL_RENDERABLE_TYPE
2015-07-22 16:47:11 -05:00
Markus Wick
6bcdae616b Merge pull request #2679 from Tinob/master
Implement scaled partial texture updates
2015-07-22 19:04:04 +02:00
Ryan Houdek
c4f0515141 Work around devices that choose to only return the default EGL_RENDERABLE_TYPE
The default EGL_RENDERABLE_TYPE is GLES1, so vendors have the ability to choose between returning only the bits requested, or all of the bits
supported in addition to the one requested.
PowerVR chose to take the route where they only return the bits requested, everyone else returns all of the bits supported.
Instead of letting the vendor have control of this, let's incrementally go through each renderable type and make sure it supports everything we want.
This will cover all devices for now, and for the future.
2015-07-22 11:11:23 -05:00
Ryan Houdek
dc46ae0380 Fix an oversight in GLExtensions
I only wanted to erase the first character in the string, not the entire thing.
Fixes Qualcomm and PowerVR devices crashing out immediately.
2015-07-20 22:01:23 -05:00
Rodolfo Bogado
d8cd2c3252 Implement scaled partial texture updates 2015-07-02 08:53:40 -03:00
Jules Blok
75a9740ab7 Merge branch 'stable' 2015-06-25 12:24:15 +02:00
Jules Blok
8fd5f249fa Merge pull request #2656 from Armada651/ogl-inv-depth
OGL: Allow inverted depth ranges.
2015-06-25 12:06:56 +02:00
Lioncash
0034492151 Add an OSD notification for screenshot saving 2015-06-25 09:23:37 +02:00
Jules Blok
30eae0d258 Merge pull request #2657 from lioncash/screenshot
Render: Add an OSD notification for screenshot saving
2015-06-25 09:22:26 +02:00
Ryan Houdek
521f6e89c3 Merge pull request #2624 from sigmabeta/android-save-screenshot
Android: Save screenshot at end of an emulation session.
2015-06-24 21:39:47 -05:00
Lioncash
67c5ce5d96 Add an OSD notification for screenshot saving 2015-06-24 21:44:38 -04:00
Jules Blok
743296f1c4 OGL: Allow inverted depth ranges. 2015-06-24 22:28:36 +02:00
Tillmann Karras
83ab721939 Fix -Wformat-extra-args warning 2015-06-24 14:44:09 +02:00
sigmabeta
a028805626 Android: Save screenshot at end of an emulation session. 2015-06-23 22:22:01 -04:00
mimimi085181
0ed6b5623f Support partial texture updates via efb copies 2015-06-21 14:02:44 +02:00
Jeffrey Pfau
7085fcc8d6 Fix FreeBSD build 2015-06-13 21:52:47 -07:00
degasus
c375111076 Options: merge SCoreStartupParameter into SConfig 2015-06-12 19:07:45 +02:00
Ryan Houdek
3f46491255 Fix OpenGL ES shader compilation. 2015-06-07 19:44:44 -05:00
Jules Blok
37dc8661ab Revert "Revert "OGL: Switch depth buffers to GL_DEPTH_COMPONENT32F format.""
This reverts commit 9ef1ca4141.
2015-06-06 20:10:23 +02:00
Jules Blok
8cc271516d Revert "Revert "OGL: Change the depth buffer type to GL_FLOAT.""
This reverts commit 05d60f4fef.
2015-06-06 20:09:22 +02:00
Jules Blok
5650b9e970 Revert "OGL: Use floating point arithmetic to scale the depth value."
This reverts commit 05f42f94a0.
2015-06-06 20:07:49 +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
Markus Wick
bcd77f9a3a Merge pull request #2482 from degasus/ogl_poke_z
OGL: Rewrite POKE_Z with a draw call
2015-06-03 20:35:34 +02:00
comex
a3b3f0522b Merge pull request #1556 from comex/project-moration
Rudimentary version of Wii IPC determinism.  Ported from my old udpnet branch.
2015-06-02 18:38:19 -04:00
degasus
84b13de538 OGL: Rewrite POKE_Z with a draw call
It's now also merged and it should be faster than the glClear way.
2015-06-02 23:06:41 +02:00
Dwayne Slater
ebf3048494 Fix invalid enums on OpenGLES 2015-06-02 12:13:31 -04:00
degasus
c4fc141ced OGL: Always use sampler objects.
We are used to use the texture parameter for all util draw calls,
but AMD seems to have a bug where they use the sampler parameter
of stage 0 if no sampler is bound to the used stage.
So as workaround (and a bit as nicer code), we now use sampler
objects everywhere.
2015-05-29 14:03:03 +02:00
Lioncash
ac26f8e79f Pass strings by const reference where possible 2015-05-28 20:54:55 -04:00
comex
a225426510 Rewrite FileSearch and improve ScanDirectoryTree.
- FileSearch is now just one function, and it converts the original glob
  into a regex on all platforms rather than relying on native Windows
  pattern matching on there and a complete hack elsewhere.  It now
  supports recursion out of the box rather than manually expanding
  into a full list of directories in multiple call sites.

  - This adds a GCC >= 4.9 dependency due to older versions having
  outright broken <regex>.  MSVC is fine with it.

- ScanDirectoryTree returns the parent entry rather than filling parts
  of it in via reference.  The count is now stored in the entry like it
  was for subdirectories.

- .glsl file search is now done with DoFileSearch.

- IOCTLV_READ_DIR now uses ScanDirectoryTree directly and sorts the
  results after replacements for better determinism.
2015-05-28 19:14:42 -04:00
Tillmann Karras
285ac34bf3 OGL: use GL_TEXTURE* constants 2015-05-27 15:05:49 +02:00
Ryan Houdek
dad5d8e13d Merge pull request #2357 from degasus/ogl_efb_poke_merge
ogl: efb poke merge
2015-05-25 23:26:39 -04: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
522e721830 OGL: Add glClipControl support. 2015-05-22 23:52:20 +02:00
Jules Blok
05f42f94a0 OGL: Use floating point arithmetic to scale the depth value. 2015-05-20 14:22:30 +02:00
Jules Blok
05d60f4fef Revert "OGL: Change the depth buffer type to GL_FLOAT."
This reverts commit 4b2e04b862.
2015-05-20 14:22:29 +02:00
Jules Blok
9ef1ca4141 Revert "OGL: Switch depth buffers to GL_DEPTH_COMPONENT32F format."
This reverts commit be810eb750.
2015-05-20 14:22:28 +02:00
degasus
d91d935057 OGL: reimplement poke-color 2015-05-20 11:05:31 +02:00
Jules Blok
ef78941042 VideoBackends: Clamp depth to uint24 range. 2015-05-18 23:22:28 +02:00
Lioncash
a94e4dd07f OGL: Join declarations and assignments in Render 2015-05-08 09:29:36 -04:00
Lioncash
eeb0f0b7c4 OGL: Get rid of some explicit deletes in Render 2015-05-08 09:28:29 -04: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
be810eb750 OGL: Switch depth buffers to GL_DEPTH_COMPONENT32F format. 2015-05-08 14:29:30 +02:00
Jules Blok
4b2e04b862 OGL: Change the depth buffer type to GL_FLOAT. 2015-05-08 14:29:29 +02:00
Jules Blok
c4f85a38e6 VideoBackends: Use proper floating point depth precision. 2015-05-08 14:29:29 +02:00
Jules Blok
7a1252f7e5 VideoBackends: Implement depth copy shaders with integer math. 2015-05-05 00:40:25 +02:00
Jules Blok
54f4443971 VideoCommon: Implement EFB dumping for both backends. 2015-05-02 13:23:33 +02:00
Lioncash
63393570fb PerfQueryBase: Move common implementation variables into base class 2015-04-15 19:22:16 -04:00
skidau
94e435afbc Merge pull request #2201 from magumagu/ogl-clamp-origin
OpenGL: use ClampUL instead of ClampLL where appropriate.
2015-03-21 12:45:46 +11:00
magumagu
629fb8fb49 Merge pull request #2222 from Tilka/fix_warnings
Fix warnings
2015-03-16 17:41:46 -07:00
Tillmann Karras
f82afd1b2f Fix warnings 2015-03-16 19:02:30 +01: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
magumagu
269be03908 OpenGL: use ClampUL instead of ClampLL where appropriate. 2015-03-12 13:24:52 -07:00
degasus
f3f2ed1536 GLX: fix memory leak 2015-03-08 17:42:37 +01:00
Ryan Houdek
b0f61201c3 Merge pull request #2142 from Sonicadvance1/fix_gles31_non_nvidia
Fix OpenGL ES 3.1 on non-Nvidia devices.
2015-03-08 09:03:05 -05:00
Ryan Houdek
3c5e99c777 Fix OpenGL ES 3.1 on non-Nvidia devices.
We are declaring we require ARB_shader_image_load_store in the shader, this isn't an extension on GLES because it is part of the GLSL ES 3.1 spec.
If we are running as GLES then just not put it in the shaders.
2015-03-08 08:49:53 -05:00
Ryan Houdek
70977fd6b1 Merge pull request #2092 from Sonicadvance1/gles_occlusion_queries
Implement full occlusion queries for the Nexus 9.
2015-03-08 08:44:15 -05:00
Markus Wick
cc5a2f3411 Merge pull request #2164 from Armada651/cache-fix
ProgramShaderCache: Do plenty of error checking before writing shaders to the disk.
2015-03-02 17:24:00 +01:00
Jules Blok
728081dad2 ProgramShaderCache: Do plenty of error checking before writing shaders to the disk. 2015-03-02 17:03:49 +01: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
Lioncash
7408de7e79 Merge pull request #2058 from Stevoisiak/Codemaid-Cleanup-Take2
Basic Formatting/Whitespace Cleanup
2015-02-25 18:07:56 -05:00
Stevoisiak
93b16a4a2d Formatting/Whitespace Cleanup
Various fixes to formatting and whitespace
2015-02-25 10:48:21 -05:00
Pierre Bourdon
f06b1106db Merge pull request #2089 from degasus/remove_disable_efb_copy
Remove disable efb copy
2015-02-24 23:31:05 +01:00
degasus
967eaad8df VideoCommon: rename efb2tex and efb2ram 2015-02-24 23:10:13 +01:00
degasus
ac7102918d OGL: support palette texture decoding 2015-02-24 22:51:55 +01:00
Tillmann Karras
f298f00e1b Clean up the intrinsics #ifdef mess 2015-02-24 01:02:36 +01:00
Ryan Houdek
e9ac4d53a6 Implement full occlusion queries for the Nexus 9.
GLES3 spec is worthless and only returns a boolean result for occlusion queries. This is fine for simple cellular games but we need more than a
boolean result.
Thankfully Nvidia exposes GL_NV_occlusion_queries under a OpenGL ES extension, which allows us to get full samples rendered.
The only device this change affects is the Nexus 9, since it is an Nvidia K1 crippled to only support OpenGL ES.
No other OpenGL ES device that I know of supports this extension.
2015-02-21 17:24:36 -06:00
Ryan Houdek
a5b4ac6faa [GLExtensions] Add support for NV_occlusion_query_samples. 2015-02-21 17:24:32 -06: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
degasus
081137bd4f VideoBackends: set GLInterface to zero after deleting it
This fixes a crash on opening the gfx settings after closing a game.
2015-02-01 13:51:34 +01:00
Lioncash
9476756d43 OGL: Fix a memory leak that would occur every time a game is launched 2015-01-31 16:00:53 -05:00
Rohit Nirmal
5203c4ef7b Silence -Wunused-variable warning. 2015-01-28 18:09:07 +00: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
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
9dbb9bf3b5 Make sure EFB2RAM buffer is wide enough for new coordinate system. 2015-01-25 23:32:32 -08:00
magumagu
1ee09ced0a Fix OpenGL coordinate computation. 2015-01-25 21:38:30 -08:00
Jules Blok
5c4ee2f71e PostProcessing: Move default pixel shader to PostProcessingShaderConfiguration.
Reduces code complexity and fixes a bug where the shader is not properly invalidated.
2015-01-25 23:08:49 +01: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
Lioncash
9cdfe889af Coding style cleanup from the zfreeze merge 2015-01-24 15:16:48 -05:00
Scott Mansell
14baf038e7 Stop doing nastly shit to OpenGL stream buffers.
Instead we keep the loaded vertices in CPU memory.
2015-01-24 14:41:51 +13: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
Ryan Houdek
80e6367e46 Merge pull request #1869 from Stevoisiak/GeneralConsistency
Minor consistency changes
2015-01-21 13:46:53 -06:00
Ryan Houdek
714697faaf Merge pull request #1909 from Sonicadvance1/GLExtensions_additions
Add support for two new OpenGL ES extensions.
2015-01-20 14:51:54 -06: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
4551bb6ce6 Add support for two new OpenGL ES extensions.
This adds support for OES_draw_elements_base_vertex and EXT_buffer_storage.
2015-01-18 23:01:43 -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
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
Stevoisiak
cb86db7b68 Minor consistency changes
Mostly small changes, like capitalization and spelling
2015-01-12 15:18:18 -05:00
degasus
7284312568 OGL: Warn about wrong texture sizes 2015-01-11 22:47:40 +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