Commit graph

779 commits

Author SHA1 Message Date
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
Markus Wick
6c46f27709 Merge pull request #1501 from degasus/texture_creation
D3D: remove load texture on creation optimization
2015-01-11 01:01:18 +01:00
mimimi085181
56e93f8fdd Update size_in_bytes of texture cache entries when copying efb to ram 2015-01-10 13:47:52 +01:00
degasus
38f42da55a TexCache: remove expanded_width
This variable isn't use any more.
2015-01-10 12:22:03 +01:00
degasus
614d058db1 TexCache: don't load tex level 0 on creation
This reverts an optimization which isn't worth imo. Every texture uploads have to alloc vram and a staging buffer, so there is no need to do both in the same call.
2015-01-10 12:21:33 +01:00
Jules Blok
031096c8d4 FramebufferManager: Remove unnecessary sampler declaration.
It's not needed and invalid when declared for the geometry shader.
2015-01-09 14:53:56 +01:00
Tillmann Karras
4d1face540 Fix indentation 2015-01-07 21:51:47 +01:00
Patrick A. Ferry
069a0864c0 Scale the offset to the IR scale
The offset between fbStride and fbWidth will need to be scaled by IR
scale.
2015-01-03 22:05:22 +00:00
Tillmann Karras
6bcdb10eee CMake: simplify some expressions 2015-01-03 13:17:57 +01:00
Jules Blok
dddaa11595 OGL: Fix stereoscopy not being applied properly while the game is running. 2015-01-03 01:36:43 +01:00
Jules Blok
582a15deb3 PostProcessing: Mark all shaders constant. 2015-01-02 20:03:20 +01:00
Jules Blok
26a9afa0e7 Anaglyph: Use matrices instead of vectors. 2015-01-02 14:32:42 +01:00
Jules Blok
e3969f763e PostProcessing: Use Dubois algorithm for anaglyph shader. 2015-01-02 03:02:28 +01:00
Markus Wick
ec4dfae333 Merge pull request #1747 from Armada651/intel-workaround
OGL: Work around Intel structures bug.
2015-01-01 21:41:09 +01:00
Ryan Houdek
479d1e56c3 Merge pull request #1783 from degasus/disablelogs
OGL: disable driver warnings fetch
2015-01-01 14:12:02 -06:00
Jules Blok
29e05c5ff8 Stereo3D: Don't rely on GetEFBLayers() when dealing with shaders.
Shaders may be compiled before the FramebufferManager is initialized.
2014-12-29 11:19:55 +01:00
Jules Blok
7eb353b3bd VideoCommon: Don't pass structs between shaders, use the interface blocks instead. 2014-12-28 23:28:00 +01:00
Jules Blok
2c0bee5da9 DriverDetails: Update Intel bug description. 2014-12-28 23:28:00 +01:00
degasus
1ed41672f5 OGL: disable driver warnings fetch
This did give a decent slowdown on some drivers.
2014-12-28 22:31:24 +01:00
Markus Wick
0f87d9b669 Merge pull request #1781 from Armada651/xfb-fixes
D3D: Fix Virtual XFB viewport.
2014-12-28 22:22:27 +01:00
Ryan Houdek
15f074dd21 Merge pull request #1766 from Armada651/enable-stereo
Enable stereoscopy settings.
2014-12-28 15:14:53 -06:00
Jules Blok
e1dc033113 Renderer: Cosmetics. 2014-12-28 18:35:23 +01:00
Jules Blok
89de7e0526 Renderer: Invalidate the FramebufferManager if the XFB mode is changed.
Fixes incorrect texture sizes after switching XFB modes.
2014-12-28 18:26:25 +01:00
Markus Wick
7764a5ed9d Merge pull request #1733 from degasus/glx
GLX: try to get an OpenGL 3.3 core context
2014-12-26 13:31:41 +01:00
Jules Blok
46bb4fd364 FramebufferManagerBase: Remove obsolete parameters. 2014-12-25 00:58:16 +01:00
Jules Blok
31a55384b3 VideoConfig: Rename "StereoMonoEFBDepth" to "StereoEFBMonoDepth"
Makes a little bit more sense.
2014-12-24 23:30:40 +01:00
Jules Blok
b109b31f61 FramebufferManagerBase: Only allocate one layer for Real XFB. 2014-12-24 17:22:23 +01:00
Jules Blok
a9364cd5db OGL: Support stereoscopic XFB blit to screen. 2014-12-24 17:22:23 +01:00
Jules Blok
12412ac5b7 FramebufferManager: Copy all EFB layers to the XFB framebuffer. 2014-12-24 17:22:22 +01:00
Markus Wick
5526b39320 Merge pull request #1748 from Armada651/stereo-format
FramebufferManager: Support stereoscopic EFB format changes.
2014-12-24 11:02:17 +01:00
Jules Blok
b2efbdaf44 Cosmetics. 2014-12-23 13:16:09 +01:00
Jules Blok
01718eafa6 FramebufferManager: Use a separate layer variable. 2014-12-23 13:16:03 +01:00
Jules Blok
ba242d27c8 FramebufferManager: Support stereoscopic EFB format changes. 2014-12-21 15:25:58 +01:00
degasus
809117102e VideoCommon: split VertexLoaderBase from VertexLoader 2014-12-21 14:12:43 +01:00
Ryan Houdek
59e1a8a1a0 Merge pull request #1736 from degasus/osd
OSD
2014-12-20 23:21:24 -06:00
Ryan Houdek
829132d465 Merge pull request #1732 from Sonicadvance1/stupid_android_garbage
Work around broken Android garbage.
2014-12-20 15:29:38 -06:00
Ryan Houdek
f2d998c938 Work around broken Android garbage.
This fixes running Dolphin on the Nexus 9.

Android's EGL stack has internal arrays that they use for tracking OpenGL function usage. Probably has something to do with their OpenGL profiling
garbage that used to be in ADT.

Android has three of these arrays, each statically allocated.
One array is for all GLES 1.x functions
One array is for all GLES 2.0/3.0/3.1 and a couple of extensions they deem worthy of being in this array.
The last array is for all function pointers grabbed via eglGetProcAddress that isn't in the other two arrays.

The last array is the issue that we are having problems with. This array is 256 members in length.
So if you are pulling more than 256 function pointers that Google doesn't track in their internal array, the function will return NULL and yell at you
in logcat.

The Nvidia Shield Tablet gets around this by replacing part of the EGL stack with their own implementation that doesn't have this garbage.
The Nexus 9 on the other hand doesn't get away with this. So we pull >100 more function pointers than the array can handle, and some of those we need
to use.

The workaround for this is to grab OpenGL 1.1 functions last because we won't actually be using those functions, so we get away with not grabbing the
function pointers.
2014-12-20 15:15:57 -06:00
Dolphin Bot
f978d141c8 Merge pull request #1720 from Armada651/stereo-msaa
FramebufferManager: Support resolving a multi-layered EFB
2014-12-20 20:35:36 +01:00
degasus
a858db1d27 OGL: move osd warning for not supported stereo mode into config validation 2014-12-20 19:54:00 +01:00
degasus
ed9c14e0d5 OGL: Fix OGL3 with stereo enabled 2014-12-20 19:13:34 +01:00
Jules Blok
d37b65c117 FramebufferManager: Support resolving a multi-layered EFB in OGL. 2014-12-20 16:08:00 +01:00
degasus
3322c55484 OGL: don't clear the stencil buffer
We don't have one. This should remove some spamming of the nvidia driver.
2014-12-20 15:17:20 +01:00
degasus
3f9b52e555 OGL: draw shadows within rasterfont itself 2014-12-20 13:31:41 +01:00
degasus
fb177ca04e VideoCommon: merge debug test generators 2014-12-20 13:06:29 +01:00
degasus
ffa014dd48 VideoCommon: merge debug info generators 2014-12-20 12:25:10 +01:00
Dolphin Bot
a560d8f150 Merge pull request #1716 from Armada651/geom-wireframe
VideoCommon: Handle wireframe mode in the geometry shader.
2014-12-20 12:22:40 +01:00
degasus
e6137407ba GLX: try to get an OpenGL 3.3 core context 2014-12-20 10:57:34 +01:00
Jules Blok
bc3ed44050 OGL: Disable geometry shaders on Intel's Windows drivers due to broken interface blocks. 2014-12-19 23:56:02 +01:00
Ryan Houdek
8c0e26d969 Minor changes to DriverDetails
Fixes a typo where the official IMGTec drivers were said to be the OSS driver support.
Removes Mali GPU family detection just like I removed the Adreno family detection.
We don't support Mali Utgard anyway.
If we need family detection we can properly add it, right now it isn't needed.
2014-12-19 21:41:12 +00:00
Jules Blok
761749e07f FramebufferManager: Support resolving a multi-layered EFB in D3D. 2014-12-19 22:37:28 +01:00
Ryan Houdek
0fec69001b Fixes Adreno 400 slow performance.
Adreno 300 and 400 have the same video driver performance issues because they are very similar architectures which use basically the same thing with
everything.
There isn't any need to detect the family of the driver with Qualcomm anyway. If we ever need family specific bugs then we can implement real support
for that.
Performance issue on Adreno 400 series was due to us only detecting Adreno 300 series, and with Adreno 400 it wouldn't use the bugs, which would cause
it to use glBufferSubData, causing the huge performance hit.
2014-12-19 21:31:37 +00:00
Jules Blok
1b9fe70d7c VideoCommon: Make IsPassthrough() a function of the ShaderUid. 2014-12-19 14:10:53 +01:00
Jules Blok
925bbcb85b VideoCommon: Handle wireframe mode in the geometry shader. 2014-12-19 14:10:52 +01:00
Ryan Houdek
02f22152be Merge pull request #1706 from Armada651/line-width
VideoCommon: Merge LineGeometryShader into GeometryShaderGen.
2014-12-18 19:43:12 -06:00
Jules Blok
1f84f4632d OGL: Check OpenGL version for geometry shader support. 2014-12-18 00:37:16 +01:00
Jules Blok
7e8f96f0d3 OGL: Don't generate a geometry shader if the backend doesn't support it.
This commit repurposes the bSupportsStereoscopy flag as the bSupportsGeometryShaders flag.
2014-12-18 00:36:49 +01:00
Jules Blok
bd6d229733 GeometryShader: Disable the geometry shader stage if it is a pass-through shader. 2014-12-18 00:36:48 +01:00
Jules Blok
2850c9a206 VertexManager: Disable culling for lines and points. 2014-12-18 00:36:47 +01:00
Markus Wick
98292682fe Merge pull request #1709 from unknownbrackets/attributeless-fix
OGL: Attempt a larger buffer to workaround 7946
2014-12-17 14:20:54 +01:00
Unknown W. Brackets
5b51f5a801 OGL: Attempt a larger buffer to workaround 7946. 2014-12-16 22:20:45 -08:00
magumagu
31bcdb8f2f D3D+OGL: choose blendenable over logicopenable.
No sane game should turn on both logicopenable and blendenable in the same
blend mode, but not every game is sane. Fixes issue 6009.
2014-12-15 20:16:25 -08:00
Jules Blok
55e60a9c22 VideoCommon: Merge LineGeometryShader into GeometryShaderGen.
This adds line-width emulation support to OpenGL.
2014-12-15 22:47:42 +01:00
Jules Blok
382e1c22db GeometryShaderGen: Support multiple primitive types.
And make more stereoscopy code optional.
2014-12-15 22:47:41 +01:00
Jules Blok
aa4242fd9c GeometryShaderGen: Pass the primitive type and always run the generator regardless of stereoscopy. 2014-12-14 21:23:20 +01:00
Jules Blok
b406e4e1f2 VideoCommon: Add a separate constants buffer for the geometry shader. 2014-12-14 21:23:13 +01:00
Jules Blok
a689db0e48 D3D: Add 3D vision support. 2014-12-14 13:28:42 +01:00
Unknown W. Brackets
1c316eb18c OGL: Correctly define attrib 0 in attributeless. 2014-12-13 21:02:15 -08:00
skidau
15f7e63cc2 Merge pull request #1650 from unknownbrackets/attributeless-fix
OGL: Unbind the active VAO before attributeless rendering
2014-12-14 14:42:07 +11:00
skidau
68a4cc6b72 Merge pull request #1686 from degasus/master
OGL: fix efb pokes
2014-12-13 23:38:07 +11:00
skidau
d02eb3ca59 Merge pull request #1640 from rohit-n/switch-default
Silence some -Wswitch-default warnings.
2014-12-13 19:47:06 +11:00
degasus
1a5d791964 OGL: fix efb pokes 2014-12-12 16:11:17 +01:00
Rohit Nirmal
b030d29067 Silence some -Wswitch-default warnings. 2014-12-11 22:23:05 -06:00
Unknown W. Brackets
029f8c3c3f OGL: Ensure a VAO is bound for all attributeless.
Unfortunately, some of these cases are not well tested, because I don't
know how to reproduce them.
2014-12-11 09:42:49 -08:00
Unknown W. Brackets
de2abbed17 OGL: Move attributeless VAO creation to Init.
This way we won't trash an existing bound VBO by mistake.
2014-12-11 01:00:37 -08:00
Unknown W. Brackets
290fd545e6 OGL: Bind the attributeless VAO before EFB copies.
Fixes crashes in Zack & Wiki using an older NVIDIA driver.
2014-12-10 23:19:18 -08:00
Unknown W. Brackets
0861cb8744 OGL: Properly reset the attributeless VAO. 2014-12-10 20:11:48 -08:00
Ryan Houdek
ce7c52eca0 Enables stereo rendering with OpenGL ES 3.1 + AEP.
If the host device supports GLES 3.1 and AEP we can have stereo rendering.
Just need to make sure to grab the correct function pointer that GL_EXT_geometry_shader provides, and enable AEP in the shaders.

We can't just check if AEP is in the extension list for support because Qualcomm has failed once more.
With the Nexus 6 it reports support for AEP but doesn't support OpenGL ES 3.1, which is an impossible combination.
From reports on their forum it seems that attempting to use any AEP things results in nothing happening, seems like a stub implementation.
2014-12-07 11:14:35 +00:00
Unknown W. Brackets
b19cff8a08 OGL: Use a fixed VAO for attributeless rendering.
Instead of abusing whatever VAO is previously bound, which might have
enabled arrays.

Only used in one instance currently, which fixes a crash with older
NVIDIA drivers.
2014-12-06 19:27:49 -08:00
Jules Blok
42bb48bd46 FramebufferManager: Bind only the first framebuffer layer when the EFB only has one layer. 2014-12-05 00:36:10 +01:00
skidau
7bc78827ed Merge pull request #1574 from degasus/profiler
Common: Add a built-in profiler
2014-12-04 13:22:31 +11:00
Jules Blok
40920b3823 OGL: Don't use texture arrays for MSAA.
This solves a performance regression on AMD cards.
We don't currently support stereoscopy for MSAA anyway.
2014-12-03 01:39:43 +01:00
degasus
94d9d138d9 Common: Add a built-in profiler 2014-12-03 00:50:41 +01:00
Ryan Houdek
38dfc970df Fixes OpenGL ES rendering.
sampler2DArray doesn't have a default precision, so we need to set it ourselves.
2014-11-29 01:27:47 -06:00
Ryan Houdek
2d2baec65d Merge pull request #1595 from degasus/master
OGL: require GL version >= 3.0
2014-11-28 22:37:35 -06:00
Ryan Houdek
ce059769f6 Merge pull request #1439 from Armada651/ogl-stereo-3d
OGL: Stereoscopic 3D Support
2014-11-28 11:45:38 -06:00
degasus
c63a38088a OGL: require GL version >= 3.0
This "fix" a crash because of glVertexAttribI only available on gl3+ contexts.
2014-11-26 21:33:47 +01:00
Lioncash
4afb85ef33 Merge pull request #1584 from degasus/master
OGL: also show driver warnings on release builds
2014-11-25 12:41:47 -05:00
Lioncash
aa92797f93 Merge pull request #1582 from Stevoisiak/newImprovedFormatting
More formatting and consistency fixes
2014-11-25 12:41:32 -05:00
Lioncash
c0fd319295 VideoOGL: Move X11 wxWidgets utilities to DolphinWX 2014-11-24 21:15:52 -05:00
Stevoisiak
6da394a4d0 More formatting and consistency fixes 2014-11-24 17:16:59 -05:00
Jules Blok
145e0cc84c OGL: Display the stereoscopy support warning before the stereo setting is reset.
Previously the message would never display, because stereoscopy would be turned off before the warning.
2014-11-24 15:11:00 +01:00
degasus
ed9f258b27 GeometryShader: Don't read from output variables 2014-11-23 14:30:12 +01:00
Jules Blok
106df04e8e GeometryShaderGen: Declare the vertex array size. 2014-11-23 14:30:12 +01:00
Jules Blok
21eabc1b9d OGL: Add warning message when stereoscopic 3D is enabled but unsupported. 2014-11-23 14:27:40 +01:00
Jules Blok
0f63186371 TextureCache: Add "Mono EFB Depth Copy" stereoscopy option. 2014-11-23 14:27:40 +01:00
Jules Blok
9994ccb342 PostProcessing: Invalidate shader when anaglyph stereoscopy is toggled. 2014-11-23 14:27:40 +01:00
Jules Blok
8210b9c915 TextureCache: Ensure that all render target textures have as many layers as the frame buffer.
Also fixes a case where the D3D code path did not initialize num_layers leading to undefined behaviour.
2014-11-23 14:27:40 +01:00
Jules Blok
ee76c03160 TextureCache: Recompile EFB2Tex shaders when stereo 3D is toggled. 2014-11-23 14:27:40 +01:00
Jules Blok
4d075c2efb ProgramShaderCache: Abort shader compilation if geometry shader failed to compile. 2014-11-23 14:27:40 +01:00
Jules Blok
6642af2404 OGL: Remove Virtual XFB SBS support. 2014-11-23 14:27:40 +01:00
Jules Blok
ab76cf8b5e PostProcessing: Apply color correction to the anaglyph shader.
The eyes were accidentally swapped, the left filter only allows red to pass so the left eye texture should be used in the red channel.
2014-11-23 14:27:39 +01:00
Jules Blok
081212b765 TextureCache: Force mono copies of the depth buffer.
Fixes stereoscopic stencil shadows in some games.
2014-11-23 14:27:39 +01:00
Jules Blok
2cb2290910 TextureCache: Fix invalid cast. 2014-11-23 14:27:39 +01:00
Jules Blok
c0a5ae1746 OGL: Also redefine glFramebufferTexture on OpenGL ES. 2014-11-23 14:27:39 +01:00
Jules Blok
aa57feb9a8 ProgramShaderCache: Don't call glAttachShader if no geometry shader was compiled. 2014-11-23 14:27:39 +01:00
Jules Blok
f74d1b16ed OGL: Add Top-and-Bottom stereoscopy mode. 2014-11-23 14:27:39 +01:00
Jules Blok
c3ad6e7820 PostProcessing: Add support for anaglyph stereoscopy mode. 2014-11-23 14:27:39 +01:00
Jules Blok
6c8f3fa861 VideoConfig: Add StereoMode enumeration. 2014-11-23 14:27:39 +01:00
Jules Blok
0eb0c47eba Render: Improve SBS presentation.
New calculation properly takes pillar boxing into account.
2014-11-23 14:27:39 +01:00
Jules Blok
d7804a4d3e Cosmetics. 2014-11-23 14:27:39 +01:00
Jules Blok
9b22e15180 VideoConfigDiag: Add stereoscopy options group. 2014-11-23 14:27:38 +01:00
Jules Blok
4d9589b35f Cosmetics. 2014-11-23 14:27:38 +01:00
Jules Blok
35342664e3 OGL: Disable stereoscopy if the GPU does not support geometry shaders. 2014-11-23 14:27:38 +01:00
Jules Blok
f370cb386c ProgramShaderCache: Always generate a geometry shader UID, even if stereoscopy is disabled. 2014-11-23 14:27:38 +01:00
Jules Blok
4fd943aedd VideoConfig: Limit the Stereo 3D option to the OpenGL backend. 2014-11-23 14:27:38 +01:00
Jules Blok
284be96cd5 OGL: Recreate the framebuffers when the stereo setting changes. 2014-11-23 14:26:56 +01:00
Jules Blok
d583720a59 GeometryShaderGen: Support stereoscopy on GPUs without support for instancing. 2014-11-23 14:26:56 +01:00
Jules Blok
0a72cf94cb TextureCache: Ignore the geometry shader if stereoscopy is disabled. 2014-11-23 14:24:09 +01:00
Jules Blok
4fe9ceeee2 TextureCache: Set proper vertex limit in geometry shader.
Without instancing 6 vertices are output instead of 3.
2014-11-23 14:23:42 +01:00
Jules Blok
5944d15021 TextureCache: Check the number of layers before reusing a texture. 2014-11-23 14:23:42 +01:00
Jules Blok
80616c6e9e TextureCache: Implement layered framebuffer support.
Stereoscopic EFB2Tex is now supported.
2014-11-23 14:23:41 +01:00
Jules Blok
c64486075d PostProcessing: Add layered stereoscopy support. 2014-11-23 14:23:41 +01:00
Jules Blok
b005f61a2e Add geometry shader generator for stereo 3D. 2014-11-23 14:22:55 +01:00
degasus
6670cacddc use GL_TEXTURE_2D_ARRAY for most of our textures 2014-11-23 14:22:22 +01:00
degasus
36fe8ccf46 OGL: also show driver warnings on release builds 2014-11-22 15:07:52 +01:00
Ryan Houdek
2fdeefb65b Adds support for OpenGL ES draw_elements_base_vertex.
This is the same extension that we all know and love but under a different name with some different requirements.
In regular OpenGL fashion, you can't just move a desktop OpenGL extension to OpenGL ES without ratifying a new extension, which is why this falls
under a EXT extension, which in turn causes it to have suffixes attached to their function names.

This is the first step in our way towards conquering all mobile GPUs that don't support desktop OpenGL, hopefully we also can add support for
buffer_storage to OpenGL ES as well so we can make full use of this extension.
2014-11-21 18:57:32 -06:00
comex
fb50cb6d99 Merge pull request #1550 from degasus/bbox
OGL: implement bounding box support with ssbo
2014-11-19 20:25:23 -05:00
Ryan Houdek
a3f9f21e08 Merge pull request #1571 from degasus/master
OGL: fix buffer destruction
2014-11-19 02:13:36 -06:00