Commit Graph

1783 Commits

Author SHA1 Message Date
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
Stenzek 5dcd3cd4fd D3D: Fix crash when taking screenshot with crop enabled
This was due to specifying negative source coordinates for the texture copy, which must lie within the bounds of the source and destination textures.

The behavior now is to clamp the copy region to [0 <= size <= backbuffer size], resulting in a copy region that can be smaller than the backbuffer, but never larger.
2015-12-09 02:38:24 +10:00
Stenzek 63264ac23f D3D: Fix EFB depth buffer copies, filtering on scaled EFB copies when MSAA is enabled, real XFB filtering
Since ResolveSubresource cannot be used with depth textures (and throws an error with the debug layer enabled), use a shader which selects the minimum depth value from all samples.

Changes the sampler by XFBEncoder to use a linear filter, rather than point, to match GL behavior.
2015-12-08 20:29:21 +10:00
degasus f511e539c2 VideoSW: Use Zero for undefined colors. 2015-12-06 12:39:18 +01:00
Lioncash 7762d68c4b Rasterizer: Mark some references as const 2015-12-06 02:51:36 -05:00
Lioncash 0608ed5130 Rasterizer: Specify internal linkage on Draw
It's not exposed in the header.
2015-12-06 02:51:34 -05:00
Lioncash a0924b5e1b Rasterizer: Convert BLOCK_SIZE into a constant variable 2015-12-06 02:51:33 -05:00
Lioncash 2793785e0c Rasterizer: Get rid of a clamp macro 2015-12-06 02:51:28 -05:00
Lioncash 9b921c2e7c Rasterizer: Get rid of a trivial pointer cast 2015-12-06 02:44:06 -05:00
degasus d28c9ae354 VideoSW: Wipe output vertices
They shall be overwritten afterwards.
2015-12-02 21:37:12 +01: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
Stenzek 5e803c3db3 D3D: Fix EFB->XFB copies incorrectly scaling, match GL behavior 2015-11-28 20:04:36 +10:00
degasus fc00598785 NativeVertexFormat: Inline Initialize in contructor
They were only called at once, so no need to seperate them.

This also removes the only dereference of the NativeVertexFormat in VideoCommon, so backends may just return nullptr.
2015-11-24 22:48:49 +01:00
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
Stenzek d1b132731d D3D: Remove redundant cast, move pitch calculation to caller 2015-11-24 21:54:19 +10:00
Stenzek 6be4608a0d D3D: Fix crash on some drivers with small textures 2015-11-24 21:15:19 +10:00
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
Markus Wick f172cda50f Merge pull request #3191 from lioncash/rekt
MathUtil: Minor changes to Rectangle
2015-11-18 10:40:54 +01:00
degasus 087ba5268a TextureCache: Rewrite EFB Copy control flow 2015-11-15 12:02:41 +01:00
degasus dcdf8fd3ce TextureCache: Split efb2ram from efb2tex 2015-11-15 11:59:52 +01:00
degasus d7d8704353 D3D-TextureEncoder: Remove TCache::Entry usage 2015-11-15 11:59:52 +01:00
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
Lioncash 10c1fd7f38 MathUtil: Make Rectangle constructors and equality operator constexpr 2015-10-20 20:30:36 -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
Markus Wick 4d3d947efc Merge pull request #3157 from degasus/videosw3
VideoSW: Wipe alpha on bypass EFB
2015-10-17 12:02:55 +02:00
flacs d85344bd58 Merge pull request #3155 from degasus/videosw
VideoSW: Split up OGL window handling
2015-10-17 04:56:44 +02:00
Lioncash b5b304cff2 VertexShaderManager: Get rid of float pointer casts 2015-10-15 23:34:54 -04:00
degasus b69bff0690 VideoSW: Use OpenGL Core context 2015-10-14 00:13:54 +02:00
degasus 61c3a0d9e4 VideoSW: Split up OGL window handling
This removes OSD support for video software, but it was already broken before.

This commit does not try to fix coding style issues, the rewrite of this presentation API is splitted up.
2015-10-14 00:13:54 +02:00
flacs b0bbe52cc9 Merge pull request #3164 from phire/samplerArrays
PixelShaderGen: Use arrays of texture samplers.
2015-10-12 18:44:14 +02:00
Tillmann Karras 9f8981c7c0 VertexLoaderUtils: remove simple wrapper functions 2015-10-11 23:40:50 +02:00
Scott Mansell 645e4cbbee PixelShaderGen: Use arrays of texture samplers. 2015-10-12 05:06:39 +13:00
flacs a7b6ae8f2c Merge pull request #3160 from Tilka/style
Misc. style fixes
2015-10-11 15:36:06 +02:00
Tillmann Karras 99228633c3 OGL: simplify AA modes initialization 2015-10-10 22:51:31 +02:00
Tillmann Karras 0f1b287402 Misc. style fixes 2015-10-10 17:44:42 +02:00
degasus d4e447555e VideoSW: Wipe alpha on bypass EFB
Alpha must not be displayed.
2015-10-10 11:45:39 +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
flacs 696d6eae09 Merge pull request #3108 from lioncash/cstyle-array
ChunkFile: Provide additional helpers for C-style arrays
2015-10-01 01:55:54 +02:00
Lioncash a10be26972 Tev: Don't savestate Zero16
It's an array of zeroes. There's no need.
2015-09-30 19:45:50 -04:00
Lioncash c6678687b0 ChunkFile: Provide additional helpers for C-style arrays
Gets rid of magic numbers in cases where the array size is known at compile time.
This is also useful for future entries that are stack allocated arrays as these
functions prevent incorrect sizes being provided.
2015-09-30 19:45:46 -04: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 cc036ca86c Common: Remove other Common prefixed headers from Common.h 2015-09-26 18:51:58 -04: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 be16901ae1 VideoSW: Don't raise a PanicAlert because of indices
It's not panic, it may just render wrong. And this case seems to happen often.
2015-09-20 13:13:47 +02: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 baf09c3af6 VideoSW: Remove unused function 2015-09-17 19:44:44 +02:00
flacs e4dfb2f6bf Merge pull request #3054 from degasus/master
GLInterface: Fix VideoSW on linux + OSX
2015-09-17 19:21:16 +02:00
degasus 3b5b80bf3c VideoSW: Drop SW bbox code
The hardware backends don't use this shared code any more, and it's not needed for video sw either. So this was just dead code.
2015-09-17 18:21:37 +02:00
degasus e3e0399af2 VideoSW: Drop HwRasterizer
I don't remember it being working, and nobody cares about performance of videosw.
2015-09-17 18:21:37 +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
Lioncash a94300dd86 Rasterizer: Use multiplication instead of shifts in DrawTriangleFrontFace
The left-hand-side is negative at some point which is considered undefined by the standard.
2015-09-17 01:46:29 -04:00
Scott Mansell deeb1d8370 Remove segfault from DX11 backend.
Instead of blindly using the expected width, clamp it to the stride of the
buffer which dx11 returns. This prevents use from reading invalid memory
at the end of textures.

This doesn't solve the base issue of what to do when a game tries to copy
from outside the efb. On real hardware it returns random noise (biased
to all ones)
2015-09-17 02:22:00 +12:00
Ryan Houdek f121d7a8cd Merge pull request #3026 from lioncash/constexpr
MathUtil: Make Clamp and IsPow2 constexpr functions.
2015-09-12 02:28:38 -04: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
Lioncash b9e360df7b MathUtil: Convert Clamp into a constexpr function 2015-09-12 01:18:28 -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 c08a83a5aa Merge pull request #2957 from phire/unify_efbcopy
Cleanup and unify efb copy implemtations into VideoCommon
2015-09-07 00:10:42 +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
comex 96e42dff52 Merge pull request #2977 from lioncash/unused
General: Remove unimplemented function prototypes
2015-09-05 22:20:47 -04:00
Lioncash 633be0387d General: Remove unimplemented function prototypes 2015-09-05 22:01:07 -04: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
Lioncash 102a2a975d BitField: Enable ifdef'd out code for Windows 2015-09-03 22:06:15 -04: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
Markus Wick a16669231a Merge pull request #2917 from Sonicadvance1/android_fix_sgs6
[Android] Workaround Mali driver issue on the Samsung Galaxy S6.
2015-08-29 08:56:32 +02:00
Markus Wick 6004ecc521 Merge pull request #2920 from rohit-n/build-pch
Fix building with PCH disabled.
2015-08-28 23:08:24 +02:00
Rohit Nirmal 6252d2d71a Fix building with PCH disabled. 2015-08-28 14:13:28 -05:00
Lioncash e787501528 Vec3: Simplify operator== code 2015-08-28 14:46:40 -04:00
Lioncash bb27f80a65 Vec3: Remove a memset call on the this pointer 2015-08-28 14:10:07 -04: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
unknown 739ede2242 Fix code to comply with coding style 2015-07-31 20:00:36 -04: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 9d055ba5f2 Video: Trying to fix D3D/XFB disabled regression 2015-07-26 00:59:00 +08: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
Lioncash daa205990f Use emplace() instead of insert() where applicable for maps. 2015-06-28 19:52:40 -04: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 dbfdbf7dbd D3D: Cosmetics.
Merge two cases which should've already been merged.
2015-06-24 23:16:53 +02: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
Markus Wick 8493feb89f Merge pull request #2602 from mimimi085181/partial-texture-updates2
Support partial texture updates via efb copies
2015-06-24 09:22:50 +02:00
sigmabeta a028805626 Android: Save screenshot at end of an emulation session. 2015-06-23 22:22:01 -04:00
Tillmann Karras c9af7def28 Fix some warnings 2015-06-23 21:11:56 +02:00
Jules Blok 21a70903ed Merge branch 'stable' 2015-06-23 20:16:55 +02:00
mimimi085181 0ed6b5623f Support partial texture updates via efb copies 2015-06-21 14:02:44 +02:00
Matthew Parlane 45aeeee699 Fix aniso filtering on d3d to not set aniso filter when using 1x 2015-06-19 20:55:32 +12:00
Jeffrey Pfau 7085fcc8d6 Fix FreeBSD build 2015-06-13 21:52:47 -07:00
Jules Blok 4042945ee5 Merge branch 'stable' 2015-06-13 01:12:12 +02:00
degasus c375111076 Options: merge SCoreStartupParameter into SConfig 2015-06-12 19:07:45 +02:00
Matthew Parlane 5cce640f48 Anisotropic Filtering option is now correct in D3D
Values are saved/loaded as 0,1,2,3,4 but need to be used as 1,2,4,8,16
This was correct for OGL but not D3D
2015-06-10 22:32:46 +12:00
Jules Blok d5788f75a3 Merge pull request #2533 from degasus/syncgpu
Fifo: Rewrite SyncGPU
2015-06-09 09:43:26 +02:00
NanoByte011 59f273696a VideoSW: refactor shared lighting attenuation function
- Refactored Light Attenuation into inline function in Software Renderer
- Corrected zero length light direction vector to resolve with normal direction (essentially becomes LIGHTDIF_NONE which was what I was after)
- Change the API of this shared function to use points for output variables (degasus)
2015-06-08 23:20:27 +02:00
NanoByte011 06d1b8c63a VideoSW: rewrite lighting attenuation
- Fixes remaining lighting issues (Mario Tennis, etc)
- Apply same fixes to Software Renderer
- Corrected zero length light direction vector to resolve with normal direction (essentially becomes LIGHTDIF_NONE which was what I was after)
2015-06-08 23:20:27 +02:00
degasus d31bed8b79 Fifo: Rewrite SyncGpu
The new implementation has 3 options:
 SyncGpuMaxDistance
 SyncGpuMinDistance
 SyncGpuOverclock

The MaxDistance controlls how many CPU cycles the CPU is allowed to be in front
of the GPU. Too low values will slow down extremly, too high values are as
unsynchronized and half of the games will crash.
The -MinDistance (negative) set how many cycles the GPU is allowed to be in
front of the CPU. As we are used to emulate an infinitiv fast GPU, this may be
set to any high (negative) number.

The last parameter is to hack a faster (>1.0) or slower(<1.0) GPU. As we don't
emulate GPU timing very well (eg skip the timings of the pixel stage completely),
an overclock factor of ~0.5 is often much more accurate than 1.0
2015-06-08 23:16:24 +02:00
Ryan Houdek 499478bcad Merge pull request #2550 from Armada651/d3d-pokes
D3D: Implement Z pokes.
2015-06-07 23:25:16 -04:00
Ryan Houdek 3f46491255 Fix OpenGL ES shader compilation. 2015-06-07 19:44:44 -05:00
Jules Blok 75fef8e26f D3D: Implement Z pokes. 2015-06-07 15:33:30 +02:00
Jules Blok cfc23560d9 D3D: Set the viewport to the full target size when doing EFB pokes. 2015-06-07 13:32:00 +02:00
Jules Blok 026d07e7c9 D3D: Remove obsolete comment. 2015-06-06 23:26:52 +02: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
Markus Wick aa2576a2c7 Merge pull request #2480 from phire/GamesDoWeirdShit
Fix invalid pointer errors in Burnout 2.
2015-05-31 23:26:55 +02:00
Scott Mansell 7df6982973 Add a dirty flag for arraybases.
Only loop through and call getPointers when something has actually
changed.
Worth about 2-4% speedup un SMG over the previous commit.
2015-05-30 04:39:48 +12:00
Scott Mansell f57517f1a0 Clean up cached_arraybases. Update VideoSW to new scheme.
Move ownership of cached_arraybases from CPMemory to VertexLoaderManager
to better match it usage.
2015-05-30 04:09:27 +12: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
Rohit Nirmal c59bfd2b7f Fix building with PCH disabled. 2015-05-26 22:44:51 -05:00
Jules Blok ca7801da44 D3D: Invert initial depth buffer clear. 2015-05-26 15:31:36 +02:00
galop1n 2975e53091 D3D: Depth range inversion.
Credits go to Galop1n for designing this technique and to BhaaLseN for cleaning up the commit.
2015-05-26 15:31:31 +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
Ryan Houdek 69963dc4b0 Merge pull request #2274 from degasus/disable_bbox
Disable bbox
2015-05-25 08:46:12 -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
degasus 6b2a1e57e2 BBox: remove now unreachable SW bbox implementation 2015-05-25 09:33:34 +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
Markus Wick ad9dae30a8 Merge pull request #2410 from lioncash/swatomic
Software: Convert most volatile variables to atomics
2015-05-22 14:11:16 +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
Markus Wick 695a72c24c Merge pull request #2414 from Armada651/depth-clamp
VideoBackends: Clamp depth to uint24 range.
2015-05-19 14:44:34 +02:00
Jules Blok ef78941042 VideoBackends: Clamp depth to uint24 range. 2015-05-18 23:22:28 +02:00
Jules Blok f7151a2a5c Revert "D3D: Use a 32-bit floating point depth buffer."
This reverts commit a224c604a3.
2015-05-16 22:16:31 +02:00
Lioncash 26a3eaf959 Software: Convert most volatile variables to atomics 2015-05-14 12:33:19 -04: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 a224c604a3 D3D: Use a 32-bit floating point depth buffer. 2015-05-08 14:32:22 +02: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
shuffle2 268b8fd26f Merge pull request #2026 from mrgreywater/d3d-debugbreak
D3D: More debug information and break on error
2015-05-07 19:29:21 -07:00
Jules Blok 24594a7888 PixelShaderCache: Fix MSAA depth copy shader. 2015-05-06 12:43:35 +02:00
Jules Blok 7a1252f7e5 VideoBackends: Implement depth copy shaders with integer math. 2015-05-05 00:40:25 +02:00
Markus Wick e0cfd934d2 Merge pull request #2364 from kayru/d3d_texture_bsf
D3D: StateManager::Apply no longer iterates through every texture and sampler slot
2015-05-03 21:39:33 +02:00
Yuriy O'Donnell df5750edfd D3D: Replaced explicit _BitScanForward with LeastSignificantSetBit 2015-05-03 21:14:29 +02:00
Jules Blok 54f4443971 VideoCommon: Implement EFB dumping for both backends. 2015-05-02 13:23:33 +02:00
Yuriy O'Donnell 2b664f5d89 D3D: StateManager::Apply no longer iterates through every texture and sampler slot
Now using bit scan through dirty slot masks.
2015-04-29 20:08:00 +02:00
Lioncash 9eb608c9da Merge pull request #2301 from lioncash/const
General: Apply the const specifier where applicable
2015-04-16 23:13:39 -04:00
Lioncash 63393570fb PerfQueryBase: Move common implementation variables into base class 2015-04-15 19:22:16 -04:00
Lioncash b0613bb1c8 General: Apply the const specifier where applicable 2015-04-15 02:04:03 -04:00
Lioncash bdde6b2a7c D3D: Remove dependency on wxWidgets
This hasn't been necessary for ages
2015-04-14 22:27:03 -04:00
degasus b020ae1c5d Fifo: rewrite sync on idle skipping hack
Now it's done without a busy loop
2015-04-06 12:35:35 +02:00
skidau 39c41f5c70 Merge pull request #2192 from Tilka/sse2
VertexLoaderX64: support SSE2 as a fallback
2015-03-21 12:58:24 +11: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
Tillmann Karras 5a51bc10e5 SWVertexLoader: fix truncated components 2015-03-18 12:09:06 +01: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
Tillmann Karras f75187db3e Add missing newlines at EOF 2015-03-01 17:17: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
Jules Blok c180174e4a D3D: Use the correct format when resolving the EFB depth texture. 2015-02-21 11:50:19 +01: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
Ryan Houdek 15e41c67f8 Change RunVertices' function arguments.
This reduces some dumb state shuffling when calling the emitted vertex loaders.
2015-02-13 12:16:06 -06:00
mr.greywater c43da7e00b D3D: replace memset, fix warning 2015-02-12 14:45:05 +01:00
mr.greywater 442b7ba99c D3D: Add debug object name for efb encoder pixel shader 2015-02-12 14:34:36 +01:00
mr.greywater b5ffba3291 D3D: Added GetDebugObjectName and parameter checking in SetDebugObjectName 2015-02-12 14:34:35 +01:00
mr.greywater 3d3a68a2f0 D3D: Add break on error in debug build 2015-02-12 14:34:34 +01:00
magumagu 0f96a0104e Merge pull request #1752 from Buddybenj/clean-up
Clean Up
2015-02-10 11:39:14 -08:00
mr.greywater 2434b531f3 D3D: Fixed crash rendering EFB textures with MSAA
Rendering EFB textures currently crashes with the D3D backend when MSAA is enabled, because the depth texture wasn't correctly resolved. An example for a crash would be starting Pokemon Snap with D3D and MSAA enabled.
2015-02-08 21:03:15 +01:00
skidau c18c50a0e1 Merge pull request #1904 from magumagu/d3d-allow-nooutput-adapter
D3D: allow selecting adapters with no outputs.
2015-02-04 13:09:27 +11: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
magumagu 0030ad9ecf Fix D3D regression from PR1948.
Make sure we don't have a texture bound as both an ShaderResourceView and
a RenderTargetView; this causes rendering glitches.

This isn't really the right place to do this... but I'm not sure
how the code should be structured.
2015-01-27 18:25:35 -08: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 da31314775 Merge pull request #1970 from magumagu/d3d-cleanup
D3D: delete unnecessary code.
2015-01-27 22:26:46 +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 897b678d24 D3D: delete unnecessary code. 2015-01-26 10:58:32 -08:00
magumagu 9dbb9bf3b5 Make sure EFB2RAM buffer is wide enough for new coordinate system. 2015-01-25 23:32:32 -08:00
magumagu 33259c272b Remove some debugging junk. 2015-01-25 23:11:36 -08:00
magumagu cb05730127 Use linear sampling in ScaleByHalf mode. 2015-01-25 23:05:23 -08:00
magumagu 1ee09ced0a Fix OpenGL coordinate computation. 2015-01-25 21:38:30 -08:00
magumagu cb5d3fce4f Fix stupid mistake. 2015-01-25 21:20:25 -08:00
magumagu 6c1bdfe04c More work. 2015-01-25 19:57:07 -08:00
magumagu ef75f3005d WIP. 2015-01-25 15:49:35 -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
Benjamin Przybocki 4f324ad742 Clean Up 2015-01-24 17:10:21 -06: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
Markus Wick 0d0f7ec662 Merge pull request #1894 from Armada651/exclusive-fix
D3D: Fix Dolphin immediately exiting exclusive fullscreen.
2015-01-19 23:29:43 +01:00
Jules Blok 332d5888eb VideoConfig: Add exclusive mode flag.
Allows the UI to easily check the current exclusive mode state.
This simplifies a few checks and prevents the user from ever getting stuck in fullscreen.
2015-01-19 22:55:21 +01: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
Ryan Houdek 7e64869185 Merge pull request #1887 from Tilka/vertex_loader_jit
VertexLoader: rewrite x64 JIT
2015-01-18 19:48:14 -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
Tillmann Karras 68d204e877 D3D: remove unused variable 2015-01-18 12:59:33 +01:00
degasus 3630de99ed VideoSW: Fix vertex skipping 2015-01-18 04:52:56 +01:00
magumagu 7d5abb4eb4 D3D: allow selecting adapters with no outputs.
The result might be a little iffy in complicated situations (i.e. you have
three graphics cards and monitors hooked up to two of them), but we really
need better UI for such cases anyway.
2015-01-17 14:27:11 -08:00
Jules Blok 8d69658a9d Add exclusive mode OSD messages. 2015-01-17 16:11:17 +01:00
Jules Blok b87fddb027 D3D: Allow borderless fullscreen to be turned on/off during gameplay. 2015-01-17 16:11:12 +01:00
Jules Blok 803bea5004 D3D: Fix Dolphin immediately exiting exclusive fullscreen. 2015-01-16 16:01:29 +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
Markus Wick f080e0221e Merge pull request #1758 from rohit-n/build-pch
Fix building with PCH disabled.
2015-01-06 20:42:50 +01:00
Markus Wick 25fac0282c Merge pull request #1764 from Armada651/safe-exclusive
D3D: Only try to apply exclusive mode when the renderer is in focus.
2015-01-06 11:00:47 +01:00
Jules Blok 399b6248d1 D3D: Further improve exclusive fullscreen state checking. 2015-01-05 00:01:22 +01:00
Rohit Nirmal bad5aef5df Fix building with PCH disabled. 2015-01-04 10:45:35 -06:00
Jules Blok 3b9c070ee0 D3D: Only try to apply exclusive mode when the renderer is in focus. 2015-01-04 16:42:16 +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
Patrick A. Ferry eebd7da443 Fix stretching with Virtual XFB in D3D
This change matches the behaviour of OpenGL.

This should make Ty the Tasmanian Tiger 3 stretch across the whole
screen. There are other games with this same issue but I have not any.

See issue #6750 for details
2015-01-03 01:28:49 +00: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 491de39325 PixelShaderCache: Implement Dubois algorithm in anaglyph shader. 2015-01-02 03:06:11 +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
Jules Blok 730a6e5f4b D3D: Fix Virtual XFB viewport.
Looks like I was incorrect about swapping the bottom and top members.
2014-12-28 17:34:19 +01:00
Jules Blok 81d1b7f0c2 XFBEncoder: Cosmetics. 2014-12-28 16:30:48 +01:00
Jules Blok d7037ae492 PixelShaderCache: Don't use GetDimensions() for the sample count.
This function is bugged on Windows 7, and statically declaring the sample count is trivial anyway.
2014-12-27 14:45:15 +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 833513f384 XFBEncoder: Sample the first layer of the resolved EFB texture.
Using the multisampled EFB texture is invalid, as the XFB encoder does not have a multisampling shader.
2014-12-25 12:09:35 +01:00
Jules Blok af8ac328e5 Renderer: Use old method of calculating the source rectangle. 2014-12-25 02:37:22 +01:00
Jules Blok 46bb4fd364 FramebufferManagerBase: Remove obsolete parameters. 2014-12-25 00:58:16 +01:00
Jules Blok 49137c7c2c FramebufferManager: Return framebuffer target size in GetTargetSize(). 2014-12-25 00:57:52 +01:00
Jules Blok 1bbb323e97 D3D: Remove obsolete Real XFB codepath. 2014-12-24 23:55:04 +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 4a86234a79 D3D: Support stereoscopic XFB blit to screen. 2014-12-24 18:45:24 +01:00
Jules Blok a845aeeb3d FramebufferManager: Copy all EFB layers to the XFB. 2014-12-24 18:45:19 +01:00
Jules Blok 59bea317d7 GeometryShaderCache: Cosmetics. 2014-12-24 17:22:24 +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 737bc0e7ad PixelShaderCache: Support stereoscopic EFB format changes. 2014-12-21 15:46:12 +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
degasus a71c8158d9 VertexLoader: remove inlined getters
They just blow up the code.
2014-12-21 13:47:43 +01:00
degasus 1281798992 VertexLoaderUid: remove operator<
Not needed for unordered map.
2014-12-21 13:47:43 +01:00
degasus ec28a80e00 VideoLoader: remove VAT_*_FRACBITS
They are used to remove the flush amounts, but as we don't
flush anymore on vertex loader changes (only on native
vertex format right now), this optimization is now unneeded.

This will allow us to hard code the frac factors within the
vertex loaders.
2014-12-21 13:47:42 +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
Jules Blok 0ae082fb61 FramebufferManager: Return the depth texture instead of the color texture in GetResolvedEFBDepthTexture() when AA is enabled. 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 c9e469f832 D3DState: Remove wireframe rasterizer support. 2014-12-19 14:10:52 +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
Markus Wick c7b809d46b Merge pull request #1669 from degasus/swvertexloader
Video Software Vertex Loader
2014-12-18 19:30:56 +01:00
shuffle2 717e155ce1 Merge pull request #1689 from kayru/d3d_efb_copy_fix
D3D: Fixed D3D validation error during EFB to texture copy
2014-12-18 02:59:51 -08:00
Jules Blok 1f84f4632d OGL: Check OpenGL version for geometry shader support. 2014-12-18 00:37:16 +01:00
Jules Blok 93ce95b48e D3D: Use ROUND_UP macro for rounding buffer sizes. 2014-12-18 00:37:15 +01:00
Jules Blok 3d9dfad6a2 D3D: Set the geometry shader before every draw call.
And refactor the VertexManager draw call.
2014-12-18 00:36:50 +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
Yuriy O'Donnell 5688c27610 D3D: Moved setting texture by slot mask into StateManager 2014-12-17 23:41:26 +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 8ae738ff30 VideoCommon: Merge PointGeometryShader into GeometryShaderGen.
This adds point-width emulation support to OpenGL.
2014-12-15 22:47:43 +01: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 6c7bed25a5 Cosmetics 2014-12-14 13:29:27 +01:00
Jules Blok fd6b588627 D3D: Define decimals in floating point numbers 2014-12-14 13:28:49 +01:00
Jules Blok a6ac7dd5bd D3D: Fix Nvidia 3D Vision memory leak 2014-12-14 13:28:49 +01:00
Jules Blok 6fe7d530ed PixelShaderCache: Fix MSAA shaders.
Various typos were introduced due to lack of testing.
2014-12-14 13:28:48 +01:00
Jules Blok b2e73400be Cosmetics 2014-12-14 13:28:48 +01:00
Jules Blok b06280e866 D3D: Add anaglyph stereoscopy support. 2014-12-14 13:28:47 +01:00
Jules Blok 4b3e784949 TextureCache: Add stereoscopy support for EFB to texture copies. 2014-12-14 13:28:47 +01:00
Jules Blok 3355d8086d D3DUtil: Use a geometry shader to clear all slices. 2014-12-14 13:28:46 +01:00
Jules Blok 799697ad80 PSTextureEncoder: Add texture array support.
We only read the first slice, because EFB2RAM doesn't support texture arrays.
2014-12-14 13:28:46 +01:00
Jules Blok ced733ccdf PixelShaderCache: Add texture array support to static shaders. 2014-12-14 13:28:46 +01:00
Jules Blok d58e389f67 D3D: Recreate the framebuffer when stereoscopic 3D is toggled. 2014-12-14 13:28:45 +01:00
Jules Blok 7c05b9a6d0 D3D: Set the geometry shader for triangle primitives. 2014-12-14 13:28:44 +01:00
Jules Blok 4f6ce0f236 D3D: Add geometry shader instancing support. 2014-12-14 13:28:44 +01:00
Jules Blok ca766747a8 D3DTexture: Bind textures as texture arrays. 2014-12-14 13:28:43 +01:00
Jules Blok cf12c93c86 D3D: Use common GetEFBLayers() instead of GetEFBSlices(). 2014-12-14 13:28:43 +01:00
Jules Blok 9d9bd5341d D3D: Restore viewport after stereo blitting. 2014-12-14 13:28:43 +01:00
Jules Blok a689db0e48 D3D: Add 3D vision support. 2014-12-14 13:28:42 +01:00
Jules Blok e53705784b D3D: Add SBS/TAB output support. 2014-12-14 13:28:42 +01:00
Jules Blok 9253bb7d96 D3D: Add geometry shader stereoscopy support. 2014-12-14 13:28:41 +01:00
Jules Blok d5ebdf7a97 D3D: Add GeometryShaderCache. 2014-12-14 13:28:41 +01:00
Jules Blok 9a312e2b83 D3D: Use two slices for most of our textures. 2014-12-14 13:28:40 +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
Jules Blok 14792c3402 D3DState: Set the pixel shader in m_current when linking dynamically. 2014-12-13 22:09:34 +01:00
Jules Blok a2b43b21fe D3DState: Always update the m_pending members in the setters.
Fixes unintentional behaviour when a setter is called twice before the state is applied.
2014-12-13 21:51:18 +01:00
skidau 68a4cc6b72 Merge pull request #1686 from degasus/master
OGL: fix efb pokes
2014-12-13 23:38:07 +11:00
degasus d5eeb9b713 VideoSW: rewrite VertexLoader to use the VideoCommon one 2014-12-13 10:29:08 +01: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
Yuriy O'Donnell 764aee6995 D3D: Fixed D3D validation error during EFB to texture copy
Texture was being bound as a render target while still being set as a shader resource.
D3D automatically unbinds the SRV in this case and generates a validation error.
The fix is to manually unbind SRV, render into it and then re-bind to old slots.
2014-12-13 00:32:08 +01: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
Dolphin Bot 971a95aece Merge pull request #1503 from kayru/d3d_optimization_cache
D3D: Filter redundant API calls by caching state in StateManager
2014-12-11 23:38:35 +01: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
degasus 02cdb41d3d VideoCommon: Rename s_pCurBufferPointer 2014-12-09 18:56:27 +01:00
degasus 50de4238bb VertexLoader: Move the old Datareader function into VertexLoader 2014-12-09 18:56:27 +01:00
Markus Wick ff4526b4a9 Merge pull request #1657 from Tinob/master
Add HW bounding Box support to d3d backend
2014-12-08 09:05:22 +01:00
Rodolfo Bogado cf7512683c spaces cleanup 2014-12-07 20:28:27 -03:00
Yuriy O'Donnell e90604c5ed D3D: Fixed debug validation error
A texture was still being bound when OMSetRenderTargets is called.
State manager resource cache must be flushed to unbind it.
This fixes The Last Story cut scene rendering.
2014-12-07 18:46:05 +01:00
Yuriy O'Donnell 4392d3cd55 D3D: Fixed StateManager member function name case 2014-12-07 18:45:50 +01:00
Yuriy O'Donnell 80459c52e9 D3D: StateManager m_current and m_pending are now value-initialized 2014-12-07 18:45:49 +01:00
Yuriy O'Donnell 0e18e9e80d D3D: Removed cull mode changes for lines and points
Fixed include order and whitespace
2014-12-07 18:45:20 +01:00
Yuriy O'Donnell 6e9226650d D3D: Implemented context state caching
This avoids most of the redundant API calls.
2014-12-07 18:17:19 +01: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
Rodolfo Bogado c2de38c115 use SAFE_RELEASE to make code cleaner 2014-12-06 10:46:15 -03:00
Rodolfo Bogado 817d025328 small spacing fixes 2014-12-05 23:54:34 -03:00
Rodolfo Bogado c7bb8fba9e Added support test for bbox and some naming corrections 2014-12-05 18:51:23 -03:00
Rodolfo Bogado 93b4540e19 Add HW bounding Box support to d3d backend 2014-12-05 15:03:24 -03: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
Lioncash 88cd27bbca Merge pull request #1392 from kayru/d3d_viewport_depth
D3D: Replaced shader-based depth range remap with viewport
2014-12-03 14:49:30 -05: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
Yuriy O'Donnell 36b886cb80 D3D: Viewport min and max depth is now clamped to [0..1] range 2014-11-29 11:42:53 +01:00
Yuriy O'Donnell 1fe3d07cbd D3D: Removed somewhat mysterious comment
It would be good to know which games exactly exhibited the issue.
2014-11-29 11:11:28 +01:00
Yuriy O'Donnell cc2227fbc3 D3D: Replaced shader-based depth range remap with viewport
This fixes UI rendering in some games mentioned in https://code.google.com/p/dolphin-emu/issues/detail?id=7785
2014-11-29 11:11:28 +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 fa32f751d3 ShaderGen: Handle ShaderCode objects directly.
ShaderGeneratorInterface does not have virtual function members, so we have to implement each type explicitly.
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
Fiora 3ddf82a318 Vertex Loader: SSE implementations of more position/texcoord/normal formats
~35-45% faster NFS:HP2, possibly other vertex-bound games.
2014-11-20 02:13:19 -08: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
skidau 32f2cd8c7f Merge pull request #1566 from Sonicadvance1/fix_gl21
Fixes GLExtensions for GL 2.1 or GLES 2 devices.
2014-11-19 12:47:23 +11:00
degasus ff942d44b5 OGL: fix buffer destruction
This buffer will be unbound in the StreamBuffer class itself, so no need to unbind them before.
2014-11-18 23:13:06 +01:00
degasus c211450b99 OGL: implement bounding box support with ssbo
This implemention tries to be as accurate as the old SW implemention, but it will remove the dependcy of our vertexloader on videosw.
2014-11-17 21:20:32 +01:00
Lioncash b94dbca160 Host: Kill off GetRenderWindowSize 2014-11-17 13:44:49 -05:00
Ryan Houdek 3bfa15d2e1 Fixes GLExtensions for GL 2.1 or GLES 2 devices.
This wasn't too much of a concern since we normally don't care about this feature set, but it is nice when testing on new devices and they don't
support the higher feature sets but want to run under software renderer.

The Mesa softpipe and PowerVR 5xx drivers don't support higher GL versions, but they shouldn't exit out just because they couldn't get a GL3 function
pointer that isn't even going to be used at that point.
2014-11-16 22:59:29 -06:00
Stevoisiak b25e1a2eb4 Various formatting and consistency fixes 2014-11-13 22:42:18 -05:00
comex 890b788633 Merge pull request #1467 from waddlesplash/dolphin-qt
DolphinQt: Games now boot!
2014-11-02 18:08:55 -05:00
Augustin Cavalier 29593d403b Move GLInterface to the OGL VideoBackend's directory. 2014-11-02 12:16:33 -05:00
Ryan Houdek 13d58b3f16 Merge pull request #1460 from phire/moreGetPointer
Remove GetPointers in VideoSoftware.
2014-11-02 09:57:16 -06:00
skidau 59c673aec6 Merge pull request #1161 from rohit-n/ogl-vector
OGL: Use unique_ptr instead of pointer when taking screenshot.
2014-11-02 14:19:00 +11:00
Lioncash 9ab924513e VideoCommon/VideoBackends: Remove unnecessary wxWidgets references.
EmuWindow doesn't even exist anymore. wxWidgets is also decoupled from the backends.
2014-11-01 19:19:00 -04:00
Scott Mansell b929f764f2 Remove GetPointers in VideoSoftware.
This same code was previously fixed in VideoCommon, just
updating this to match.

We are down to 121 GetPointers.
2014-11-01 16:29:19 +13:00
Ryan Houdek 3e82cb4628 Merge pull request #1440 from Sonicadvance1/attributeless-workaround
Implements PP shader system using attribute workaround.
2014-10-30 12:46:40 -06:00
Ryan Houdek 181ff6750e Implements PP shader system using attribute workaround.
This is pretty much a step backwards in our code. We used to use attributes in our PP shader system a long time ago but we changed it to attributeless
for code simplicity and cleanliness. This reimplements the attribute code path as an optional path to take in the case your system doesn't work with
attributeless rendering. In this case the only shipping drivers that we can know for sure supports attributeless rendering is the Nexus 5's v95 driver
that is included in the Android 5.0 image.

I hadn't planned on implementing a work around to get post processing working in these cases, but due to us force enabling the PP shader system at all
times it sort of went up on the priority list. We can't be having a supported platform black screening at all times can we?
2014-10-30 10:49:03 -05:00
Rohit Nirmal 2a878d7726 OGL: Use unique_ptr instead of pointer when taking screenshot. 2014-10-29 20:59:34 -05:00
skidau e0393be347 Merge pull request #1418 from degasus/master
OGL: fix interpolation of PP shaders
2014-10-30 12:49:21 +11:00
Ryan Houdek daabcfd6fc Removes Qualcomm's rotated framebuffer bug from DriverDetails.
Due to changes in how we render to the final framebuffer we no longer encounter this bug.
With the change to post processing being enabled at all times and no longer using glBlitFramebuffer, Qualcomm no longer has the chance to rotate our
framebuffer underneath of us.
2014-10-29 19:57:51 -05:00
Ryan Houdek 52e6a940cf Merge pull request #1414 from kayru/d3d_optimization
D3D: Couple of small optimizations
2014-10-29 13:26:50 -06:00
comex 073cce959a Create userdir/Dump/Frames as needed.
This is used for framedump.raw in non-Windows builds without libav
support.
2014-10-28 17:24:07 -04:00
degasus ce9ef2c438 OGL: fix interpolation of PP shaders 2014-10-27 21:15:32 +01:00
Yuriy O'Donnell 88d11ec5b2 D3D: RestoreState no longer resets PS resources 2014-10-27 00:02:30 +01:00
Yuriy O'Donnell 0c5a572f8d D3D: Use two buffers for VertexManager 2014-10-26 23:38:15 +01:00
Yuriy O'Donnell c35847b795 D3D: Using start index and base vertex instead of buffer offsets 2014-10-26 23:38:14 +01:00
Yuriy O'Donnell 48ba55203b D3D: Vertex and index data in one buffer 2014-10-26 23:38:14 +01:00
Lioncash 49b94e5285 OGL: Get rid of error macros 2014-10-26 04:54:58 -04:00
skidau 7c58eb344d Merge pull request #1378 from lioncash/gl
GLUtil: Change return type from GLuint to GLenum for OpenGL_ReportGLError.
2014-10-26 13:44:34 +11:00
skidau bc26cb1b19 Merge pull request #1322 from degasus/ogl-pp
OGL: force enable postprocessing
2014-10-25 13:48:27 +11:00
Lioncash b1bdce7d77 TextureCache: Get rid of explicit deletes in SaveTexture 2014-10-24 08:47:06 -04:00
Lioncash 3509a6d03e GLUtil: Change return type from GLuint to GLenum for OpenGL_ReportGLError. 2014-10-23 13:04:19 -04:00
Ryan Houdek a2c8783417 Enables EarlyZ support in OpenGL ES 3.1. 2014-10-23 07:34:07 -05:00
comex 00c6ec97a6 Merge pull request #1347 from comex/header-hygiene
Add missing includes where headers depend on other headers having been included first.
2014-10-22 23:23:58 -04:00
degasus 7292ea6a04 OGL: force enable postprocessing 2014-10-23 00:21:52 +02:00
skidau 5d4b4c793a Merge pull request #1340 from Sonicadvance1/EGL-fixes
Remove hard dependencies of GLX and libGL from Dolphin.
2014-10-22 13:15:46 +11:00
comex 6e774f1b64 Add missing includes where headers depend on other headers having been included first.
This is good hygiene, and also happens to be required to build Dolphin
using Clang modules.

(Under this setup, each header file becomes a module, and each #include
is automatically translated to a module import.  Recursive includes
still leak through (by default), but modules are compiled independently,
and can't depend on defines or types having previously been set up.  The
main reason to retrofit it onto Dolphin is compilation performance - no
more textual includes whatsoever, rather than putting a few blessed
common headers into a PCH.  Unfortunately, I found multiple Clang bugs
while trying to build Dolphin this way, so it's not ready yet, but I can
start with this prerequisite.)
2014-10-21 21:22:16 -04:00
Yuriy O'Donnell 72ba13ca8a D3D: Enabled depth clipping 2014-10-21 06:26:20 +02:00
skidau 81efd0e87f Merge pull request #1315 from RisingFog/movie-menu-input-display
Moved Input Display to Movie Menu
2014-10-20 14:34:02 +11:00
Ryan Houdek e236d28585 Remove a hard dependency from libGL from the software renderer.
I must have missed this when dropping OpenGL library includes. This is annoying when on a system that doesn't have libGL.
2014-10-19 07:48:14 -05:00
Yuriy O'Donnell 97423d5ed8 D3D: Fixed anisotropic filtering.
This got broken when d3d state cache was implemented.
2014-10-18 17:47:47 +02:00
Fog 467ab1a629 Moved Input Display to Movie Menu 2014-10-17 21:08:34 -04:00
Yuriy O'Donnell b78396847f D3D: Removed SetBlendOp, SetSrcBlend and SetDestBlend as they are now trivial 2014-10-17 22:24:57 +02:00
Yuriy O'Donnell 9bdfd4a833 D3D: State cache now reduces number of blend state permutations by collapsing some states that have blending disabled 2014-10-16 18:27:43 +02:00
Yuriy O'Donnell bea68c95a4 D3D: Fixed uninitialized members of gx_state 2014-10-15 20:22:41 +02:00
Yuriy O'Donnell 21655dc61a D3D: moved render state cache implementation to D3DState.h/cpp 2014-10-15 20:22:41 +02:00
Yuriy O'Donnell e7f8032d7d D3D: State cache now uses BitField to define packed render states 2014-10-15 20:22:40 +02:00
Yuriy O'Donnell 2e4667caaa D3D: Moved render state cache into separate source files.
Refactored  StateCache::Get() to early out for narrower indentation.
Added comments to clarify ownership of objects returned by  StateCache::Get().
2014-10-15 20:22:39 +02:00
Yuriy O'Donnell f434bd7d3f D3D: Implemented cache for dynamic render states 2014-10-15 20:22:39 +02:00
skidau 8912315596 Merge pull request #1290 from lioncash/xfb
Fix XFB scaling in D3D
2014-10-15 14:09:33 +11:00
skidau 8ef21bc5e2 Merge pull request #1272 from RisingFog/sconfig-dump-frames
Move bDumpFrames to SConfig (and it's references)
2014-10-15 13:42:37 +11:00
slx7R4GDZM 5a3f19aeaf Fix XFB scaling in D3D 2014-10-14 22:25:31 -04:00
comex 5b8722b6f2 Don't pass u64 (which may be long long) to %lu.
A type-safe StringFromFormat sure would be nice...
2014-10-14 01:10:35 -04:00
comex a27f5fe301 Remove another auto .. -> declaration. 2014-10-14 01:10:35 -04:00
skidau 9551650c42 Merge pull request #1095 from crudelios/sw-bbox
Reimplement Bounding Box calculation using the software renderer.
2014-10-13 15:57:11 +11:00
Lioncash 01f1768c55 Merge pull request #1273 from lioncash/iamanidiot
Software: Remove obsoleted VideoConfigDialog.
2014-10-13 00:46:42 -04:00
Lioncash b315040c6b Software: Remove obsoleted VideoConfigDialog. 2014-10-13 00:30:08 -04:00
Fog 8d424b114a Move bDumpFrames to SConfig (and it's references) 2014-10-12 23:56:16 -04:00
Fog cd0c784d5a Changed Dump Frames References 2014-10-12 19:51:13 -04:00
crudelios 9786f54414 Fixed a small bug. 2014-10-10 12:28:17 +01:00
crudelios 987bd8bb8f Several small optimizations. 2014-10-10 12:28:16 +01:00
crudelios 176ea06e82 Get buildbot to compile. 2014-10-10 12:28:15 +01:00
crudelios 47c67f014f Fix linux build and various warnings.
Increase savestate version.
2014-10-10 12:28:13 +01:00
crudelios 2d4b7e3f3f Reimplement Bounding Box calculation using the software renderer. 2014-10-10 12:27:06 +01:00
skidau 215685a6fe Merge pull request #1214 from rohit-n/format-warning
OGL: Silence string format warnings.
2014-10-06 16:12:40 +11:00
skidau 871d308b88 Merge pull request #1206 from comex/amperspocalypse
Change a bunch of reference function arguments to pointers.
2014-10-05 12:14:04 +11:00
Rohit Nirmal 12c6f97d80 OGL: Silence string format warnings. 2014-10-03 12:07:10 -04:00
comex 7f6284c2fc Change a bunch of reference function arguments to pointers.
Per the coding style and sanity.
2014-10-02 03:00:33 -04:00
Rachel Bryk f6c6f03cce Add on screen frame counter. 2014-09-30 18:49:44 -04:00
Tony Wasserka 13fc8e7df1 Merge pull request #578 from RachelBryk/IR
Cleanup Renderer::CalculateTargetSize(), and allow IRs higher than 4x to be set via INI.
2014-09-30 19:21:21 +02:00
comex 2eebdff01b Remove useless STACKALIGN macro.
It only ever did anything on 32-bit OS X.

Anyway, it wasn't even on the right functions, and these days
ABI_PushRegistersAndAdjustStack should handle maintaining the ABI
correctly.
2014-09-30 01:42:47 -04:00
comex b8e31c1d3e Add OpenGL 4.0-4.5 core extensions.
This noticeably includes GL_ARB_get_program_binary, which was previously
thought unsupported on OS X.  Well, actually, the OS X implementation is
trivial and reports 0 binary formats (as of 10.10; this is hardcoded in
GLEngine, by the way), but at least it'll work if it's fixed someday.
2014-09-29 00:36:45 -04:00
comex 0ae9e398c8 Rejigger some FIFO buffer variables to be more rational.
videoBuffer -> s_video_buffer
size -> s_video_buffer_write_ptr
g_pVideoData -> g_video_buffer_read_ptr (impl moved to Fifo.cpp)

This eradicates the wonderful use of 'size' as a global name, and makes
it clear that s_video_buffer_write_ptr and g_video_buffer_read_ptr are
the two ends of the FIFO buffer s_video_buffer.

Oh, and remove a useless namespace {}.
2014-09-28 21:25:12 -04:00
comex f0131c2e09 Mechanical changes to move most CP state to a struct rather than separate globals.
The next commit will add a separate copy of the struct and the ability
for LoadCPReg to work on it.
2014-09-28 21:23:29 -04:00
Rachel Bryk 4fe1119e52 Cleanup Renderer::CalculateTargetSize(), and allow IRs higher than 4x to be set via ini. 2014-09-25 19:50:25 -04:00
skidau fb18d5376f Merge pull request #1142 from lioncash/linucks
Fix some warnings on Linux
2014-09-23 13:43:18 +10:00
Lioncash 836ff6d506 Fix some warnings on Linux 2014-09-21 20:13:22 -04:00
Lioncash 23b82bbacd OGL: Get rid of explicit deletes in RasterFont 2014-09-21 20:06:13 -04:00
Tony Wasserka 1d23c2ca8b GPU: Only load the relevant color components upon writes to the tev color registers.
The other two components need not be valid upon write, hence loading them results in glitches.

Fixes issue 6783.
2014-09-21 10:38:22 +02:00
Ryan Houdek eb23882398 Merge pull request #1120 from rohit-n/muh-precompiled-headers
Fix build failing when disabling precompiled headers.
2014-09-19 17:43:42 -05:00
Rohit Nirmal 46057db37d Fix build failing when disabling precompiled headers. 2014-09-19 18:17:51 -04:00
Ryan Houdek c5f9301e6e Add a comment to the software renderer that stride should be implemented 2014-09-19 12:33:15 -05:00
magumagu 32e5043b29 WIP XFB scaling.
Still an ugly mess.
2014-09-19 12:33:15 -05:00
Rohit Nirmal c0f7cab3f5 Remove extra semicolons at the ends of some lines. 2014-09-10 12:17:38 -04:00
Ryan Houdek 71cb09f1ca Merge pull request #1027 from rohit-n/change-include
Include CommonTypes.h instead of Common.h.
2014-09-10 00:35:16 -05:00
skidau d1439bc1db Merge pull request #1041 from RachelBryk/kill-g_CoreStartupParameter
Kill Core::g_CoreStartupParameter.
2014-09-10 11:00:42 +10:00
Rachel Bryk f93aa7087c Kill Core::g_CoreStartupParameter. 2014-09-09 00:24:49 -04:00
Fiora 94c20db369 Rename Log2 and add IsPow2 to MathUtils for future use
Also remove unused pow2/pow2f functions.
2014-09-08 20:15:45 -07:00
Rohit Nirmal fbc64984ca Include CommonTypes.h instead of Common.h. 2014-09-08 15:39:58 -04:00
shuffle2 0576046fdd Merge pull request #972 from Sonicadvance1/fix-intel-windows
Work around Intel's failings with buffer_storage
2014-09-05 11:06:49 -07:00
Fiora 07e0c917c6 Revert "JIT64: optimize CA calculations" 2014-09-05 10:26:30 -07:00
comex 97420c6ec6 Merge pull request #852 from FioraAeterna/optimizeca
JIT64: optimize CA calculations
2014-09-05 11:52:02 -04:00
comex e7f03dd066 Merge pull request #948 from comex/vao-fix
Don't switch to a vertex array object of 0.
2014-09-05 11:46:28 -04:00
Jasper St. Pierre ea1245d191 TextureDecoder: Pass the TLUT address straight into the texture decoder
This removes the requirement for the TextureDecoder to have access to
global texture memory.
2014-09-04 18:36:57 -07:00
Jasper St. Pierre fcd4ecc942 TextureDecoder: Add an enum for the TLUT formats
Quick code cleanup. The enum names and values come from libogc.
2014-09-04 18:36:56 -07:00
Jasper St. Pierre a8e591dc73 VideoCommon: Remove support for decoding to ARGB textures
The D3D / OGL backends only ever used RGBA textures, and the Software
backend uses its own custom code for sampling. The ARGB path seems to
just be dead code.

Since ARGB and RGBA formats are similar, I don't think this will make
the code more difficult to read or unable to be used as
reference. Somebody who wants to use this code to output ARGB can simply
modify the MakeRGBA function to put the shift at the other end.
2014-09-04 18:36:56 -07:00
Sonicadvance1 e32b2e1771 Work around Intel's failings with with buffer_storage 2014-09-04 19:03:49 -05:00
Lioncash cf390ba537 OGL: Make rasters 2D array static in RasterFont 2014-09-03 22:59:13 -04:00
Lioncash 89557f6c2f OGL: Fix constant casing in RasterFont 2014-09-03 22:59:05 -04:00
comex b48e059173 Don't switch to a vertex array object of 0.
This causes glDrawArrays to fail in core profile, and thus on OS X, see:

http://renderingpipeline.com/2012/03/attribute-less-rendering/

There must be something bound, even though it is not used.

Fixes #7599.  I'm not sure this is actually the best way to fix it,
since AFAICT it makes a nonobvious assumption that *something* will be
bound before the first attributeless rendering in
TextureConverter::DecodeToTexture, but it's what degasus suggested and
seems to work.
2014-09-03 00:10:45 -04:00
Shawn Hoffman 266992684d msvc: remove some remnants of SDL and DSound from projects and general cleanup. 2014-09-01 21:27:44 -07:00
Fiora b51aa4fa89 Rename Log2 and add IsPow2 to MathUtils for future use
Also remove unused pow2/pow2f functions.
2014-09-01 20:41:07 -07:00
Pierre Bourdon 494a60e41b VertexLoader: Change VtxDesc to use u64 instead of u32
This is required to make packing consistent between compilers: with u32, MSVC
would not allocate a bitfield that spans two u32s (it would leave a "hole").
2014-09-01 11:18:02 +02:00
Lioncash 844d45b26e D3D: Clean up brace placements 2014-08-30 18:06:47 -04:00
Lioncash 1d706b2311 Get rid of C-style empty function parameter indicators 2014-08-30 15:23:48 -04:00
Ryan Houdek c908a1e212 Merge pull request #882 from Sonicadvance1/fix-pp-blackness
Fix PostProcessing shader garbage on screen.
2014-08-28 10:29:03 -05:00
Ryan Houdek ca68526ec7 Clear the texture used by PP shaders prior to use.
We were generating a texture without ever setting the data to a known value.
This happened on the old code as well, just that PP shaders are receiving some love and people are using it and noticing some of its issues.
2014-08-28 10:16:39 -05:00
comex e31d6feaa2 Unify three types of non-FIFO requests to the GPU thread around Common::Event and Common::Flag.
The only possible functionality change is that s_efbAccessRequested and
s_swapRequested are no longer reset at init and shutdown of the OGL
backend (only; this is the only interaction any files other than
MainBase.cpp have with them).  I am fairly certain this was entirely
vestigial.

Possible performance implications: efbAccessReady now uses an Event
rather than spinning, which might be slightly slower, but considering
the slow loop the flags are being checked in from the GPU thread, I
doubt it's noticeable.

Also, this uses sequentially consistent rather than release/acquire
memory order, which might be slightly slower, especially on ARM...
something to improve in Event/Flag, really.
2014-08-26 12:43:39 -04:00
comex e0f35e0e59 Remove unused declarations. 2014-08-23 15:26:59 -04:00
Lioncash f17dcd2019 Merge pull request #764 from magcius/new-nogui-2
Rewrite GLInterface
2014-08-21 14:14:54 -04:00
Shawn Hoffman 5471c71819 msvc: resolve all warnings in VideoBackends/OGL. 2014-08-19 22:33:47 -07:00
Shawn Hoffman fd16065979 msvc: resolve all warnings in VideoBackends/Software. 2014-08-19 22:33:47 -07:00
Jasper St. Pierre 63f1a16969 Core: Remove UpdateFPSDisplay
This is effectively unused, as the window handles that we pass to the
GLInterface are window handles for the frame which isn't ever a real
toplevel window. Host_UpdateTitle is what actually sets the proper title
on the render window.
2014-08-19 10:05:58 -04:00
Jasper St. Pierre 7ca8d8dfc7 Core: Don't pass through a reference to the window handle
Now that MainNoGUI is properly architected and GLX doesn't need to
sometimes craft its own windows sometimes which we have to thread back
into MainNoGUI, we don't need to thread the window handle that GLX
creates at all.

This removes the reference to pass back here, and the g_pWindowHandle
always be the same as the window returned by Host_GetRenderHandle().

A future cleanup could remove g_pWindowHandle entirely.
2014-08-19 10:05:58 -04:00
Ryan Houdek 32fb61816b Fixes PP-shaders on !Mesa targets.
Seems mesa has a quirk where
define THING(x) (#x)
is the same as
define THING(x) (##x)

Didn't realize I messed it up since it just worked since I only tested on Mesa.
2014-08-17 21:28:59 -05:00
Pierre Bourdon 9e2fbaf405 Merge pull request #823 from KScorp/depthmatrixshaders
Fixed depth matrix shaders in OpenGL and Direct3D to be more precise.
2014-08-17 22:08:42 +02:00
Lioncash 15a3b30e27 Merge pull request #790 from lioncash/ogl-cleanup
Small OGL cleanup
2014-08-17 15:17:04 -04:00
KScorp 97dce14368 Fixed depth matrix shaders in OpenGL and Direct3D to be more precise. Fixes some graphical glitches in some games. 2014-08-17 04:43:11 -05:00
Lioncash f0743e2571 OGL: Removed some unnecessary preprocessor directives from Render.cpp.
scrshotThread was also unused so that is removed as well.

Also added the algorithm header, since we use min and max here.
2014-08-16 23:57:06 -04:00
shuffle2 2270c3e90a Merge pull request #797 from shuffle2/msvc-pch
Windows: Use a shared precompiled header for dolphin code under Source/
2014-08-16 14:58:28 -07:00
Lioncash f11e587fa4 OGL: Get rid of an unnecessary WIN32 ifdef in main.cpp 2014-08-15 16:16:53 -04:00
Lioncash 7e3d1050f0 OGL: Add static to a function in NativeVertexFormat 2014-08-15 14:16:04 -04:00
Lioncash 32953fd968 OGL: Clean up parameters for some functions. 2014-08-15 14:15:23 -04:00
Lioncash 960b54670c OGL: Fix brace and body placements
Also got rid of void argument specifiers. These are a carryover from C.
2014-08-15 14:12:29 -04:00
Shawn Hoffman f1b82a34b2 Windows: Use a shared precompiled header for dolphin code under Source/ 2014-08-14 23:51:13 -07:00
Ryan Houdek cced3b4a18 Change OpenGL's post processing to use the new VideoCommon PP object.
Let's OpenGL's PostProcessing namespace be changed to a class inheriting from VideoCommon's PostProcessing class.
2014-08-13 01:05:15 -05:00
Ryan Houdek 6bdc32c54a Add the VideoCommon PostProcessing class.
This class loads all the common PP shader configuration options and passes those options through to a inherited class that OpenGL or D3D will have.
Makes it so all the common code for PP shaders is in VideoCommon instead of duplicating the code across each backend.
2014-08-13 01:05:10 -05:00
Lioncash bcd10bfda6 Software: Fix function casing in SWRenderer 2014-08-10 22:28:18 -04:00
Lioncash f9f46f33d6 Software: Fix some if-statement body placements 2014-08-10 22:28:17 -04:00
Lioncash 34eb0c6e1c Software: Fix over-indentation of SetupQuad() 2014-08-10 22:28:16 -04:00
Lioncash 4129cdeb4d Software: Apply static to some functions 2014-08-10 22:28:15 -04:00
Lioncash 568bdec598 Software: Fix function casing in TextureEncoder 2014-08-10 22:28:14 -04:00
Lioncash 2918f46d8b Software: Fix the formatting and function casing in Vec3.h 2014-08-10 22:28:04 -04:00
Lioncash 6625d9cba5 Software: Fix various brace styling errors 2014-08-10 21:18:38 -04:00
Lioncash b95d9b43de Software: Make an enum into a static constant in DebugUtil.cpp 2014-08-10 20:51:10 -04:00
Lioncash b050657322 Software: Make constants char_width and char_height private in RasterFont 2014-08-10 20:48:28 -04:00
Lioncash 6b49ddfec9 Software: Get rid of an unnecessary format string in SWmain.cpp 2014-08-10 04:38:12 -04:00
Lioncash 2b341bb267 D3D: Remove an unnecessary call to Host_GetRenderWindowSize() 2014-08-08 19:21:41 -04:00
Lioncash a66a7e1344 Isolate D3D and Software Renderer from wxWidgets code 2014-08-03 20:28:50 -04:00
Pierre Bourdon 226a9c2392 Move GLInterface around to remove VideoBackends dependency on DolphinWX 2014-08-02 09:34:39 -07:00
Ryan Houdek 7e83a0ea9b Merge pull request #700 from jimbo1qaz/master
Fix D3D Real XFB texture sampling.
2014-08-01 22:57:44 -05:00
degasus 5205d7baa6 ogl: fix rasterfont 2014-07-31 19:03:18 +02:00
Pierre Bourdon 83838a645f Merge pull request #690 from Armada651/d3dfullscreen_fixes
Exclusive fullscreen fixes
2014-07-30 16:28:56 -07:00
Jules Blok 4501aeefbe CFrame: Check borderless fullscreen setting before enabling exclusive fullscreen in the video config.
Fixes a bug where "Use Fullscreen" would initialize into exclusive fullscreen regardless of the borderless fullscreen setting.

Also relieves the need for the video renderer to check the borderless fullscreen setting each time.
2014-07-30 12:15:26 +02:00
Matthew Parlane a3ca3b0424 Merge pull request #696 from lioncash/more-forward-decls
Convert some more header inclusions into forward declarations
2014-07-30 13:53:48 +12:00
Lioncash b03c12764d Really get rid of the MSVC 2005 workaround completely 2014-07-29 21:20:43 -04:00
jimbo1qaz fe9b7fa4f3 Fix D3D Real XFB texture sampling. 2014-07-29 18:15:01 -07:00
Lioncash 522a5c35ad Convert some more header inclusions into forward declarations 2014-07-29 20:55:07 -04:00
Lioncash 4fa71dd59e Remove fakepoll.h.
It was only used for Windows XP and lower.

This also bumps the _WIN32_WINNT define in the stdafx precompiled headers to set the minimum version as Windows Vista.
2014-07-26 22:53:40 -04:00
Jules Blok ed2c74a024 D3D: Set s_last_fullscreen_mode when constructing the renderer. 2014-07-26 13:47:11 +02:00
Pierre Bourdon 8e865f3848 Merge pull request #506 from Armada651/d3dfullscreen
D3D: Add exclusive fullscreen support.
2014-07-26 13:22:11 +02:00
Jules Blok 06b13f12d3 D3D: Make the global swapchain static again. 2014-07-26 13:04:46 +02:00
Jules Blok 6724ce6275 Cosmetic changes based on feedback on PR #506. 2014-07-26 13:04:39 +02:00
Jules Blok bd9953d97e Remove the 3D Vision hack.
The hack was needed because the Nvidia 3D Vision heuristics are documented to only support surfaces that are the same size as the backbuffer. This would be the case if you enabled the hack and selected the "Auto (Window Size)" internal resolution.

However, on recent drivers the same effect is achieved by selecting the "Auto (Multiple)" internal resolution. Therefore the hack is no longer required.
2014-07-26 12:45:10 +02:00
Pierre Bourdon 906b05cb1c Merge pull request #672 from delroth/vertex-loader
Vertex loader: reduce dependency on global state
2014-07-26 02:03:03 +02:00
Pierre Bourdon 73f9a22e2e VertexLoader: Remove global state dependency on g_nativeVertexFmt 2014-07-26 01:35:09 +02:00
Lioncash 5767691f4e Get rid of a few C-style struct declarations 2014-07-23 20:36:45 -04:00
Jules Blok 4b3d579573 Renderer: Only notify the host when exiting fullscreen 2014-07-21 20:50:50 +02:00
Jules Blok 009b4dd376 Exit exclusive fullscreen when the stop confirmation is shown.
Also have the renderer remember its own fullscreen state. This is done to prevent a case where we exit exclusive fullscreen through the configuration and a focus shift at the same time. In this case the renderer would fail to detect that the fullscreen state was changed.
2014-07-21 20:50:48 +02:00
Jules Blok 36ea1890c8 Let the Renderer decide when to exit fullscreen.
This ensures the transition from/to exclusive mode happens while the RenderFrame is fullscreen.

This prevents fullscreen loops and relieves us of having to restore the window size after we exit fullscreen.
2014-07-21 17:11:13 +02:00
Jules Blok cd94ff1966 VideoConfig: Add "Borderless Fullscreen" option.
This option will disable exclusive fullscreen for users who prefer the old behaviour.
2014-07-20 22:02:57 +02:00
Jules Blok 3400871992 Renderer: Don't attempt to switch to exclusive fullscreen if "render to main" is enabled. 2014-07-19 21:14:49 +02:00
Jules Blok 9064bf147d D3D: Don't set the windowed mode size when we initialize in fullscreen. 2014-07-19 21:14:48 +02:00
Jules Blok d00e76b3ef Cosmetic changes based on feedback on PR #506. 2014-07-19 21:14:47 +02:00
Jules Blok 5837b35add Renderer: Restore exclusive mode after focus has been regained. 2014-07-19 21:14:47 +02:00
Jules Blok 5f04e9c526 D3D: Make the swapchain available outside of the namespace.
This commit reverts a part of pull request #579.
2014-07-19 21:14:46 +02:00
Jules Blok 643c9ff173 D3D: Initialize the renderer in exclusive fullscreen mode if it is enabled. 2014-07-19 21:14:46 +02:00
Jules Blok 961076a3d5 D3D: Return to windowed mode before destroying the swapchain. 2014-07-19 21:14:45 +02:00
Jules Blok 77bc879384 D3D: Add exclusive fullscreen support. 2014-07-19 21:14:44 +02:00
Jules Blok d72375fdfa D3D: Request desktop resolution before overriding the buffer size.
This fixes issues where the wrong refresh rate is selected for some monitors.
2014-07-19 21:14:44 +02:00
Jules Blok c323b386ae Prevent DXGI from making changes to the window.
Prevents DXGI from responding to Alt+Enter and messing up our fullscreen handling.
2014-07-19 21:14:43 +02:00
Ryan Houdek bc9ef95643 Support Sampler binding in the shader.
In the cases where we support the binding layout keyword, use it for more than binding UBO location.
This changes it so it is supported for samplers as well.

Instances when this is enabled is if a device supports GL_ARB_shading_language_420pack, or if it supports GLES 3.10.
2014-07-18 17:04:03 -05:00
Dolphin Bot b9dc69105d Merge pull request #595 from Armada651/pref_log
FPSCounter: Flush the logs every second and close them when the renderer is shut down.
2014-07-18 12:59:04 +02:00
Pierre Bourdon 2fbdc03572 Merge pull request #642 from phire/vs-constants
VideoSoftware: Use the same max XFB size as VideoCommon.
2014-07-18 09:12:36 +02:00
Pierre Bourdon d44fc48295 SW: Call OnFrameEnd in the FifoPlayer XFB hack. Required to dump DFF frames. 2014-07-17 13:20:13 +02:00
Scott Mansell 2be83c13be VideoSoftware: Use the same max XFB size as VideoCommon.
And lets just use the same constant as videocommon, so if it ever
increases (again) VideoSoftware will be automatically updated.
2014-07-17 22:39:09 +12:00
Dolphin Bot 51dff5a74e Merge pull request #622 from phire/sw-fix-frame-dump
Fixed Frame dumping in VideoSoftware.
2014-07-17 02:04:03 +02:00
Scott Mansell 92eed47213 Fixed Frame dumping in VideoSoftware.
Old code dumped the efb, which was no-longer relevant since the
backend gained xfb support.
New code dumps the colour texture which is about to be rendered to
the screen so correctly reflects the bypassXFB option.
2014-07-17 11:43:59 +12:00
Jules Blok 3b978f7c27 Turn the FPSCounter namespace into a class. 2014-07-16 20:40:40 +02:00
Scott Mansell b8695a57da Fix incorrect clamping in SWRenderer.
A previous PR changed a whole lot of min/maxes to std::min/std::max
but made a mistake here and used a templated min which cast it's
arguments to unsigned instead of casting return value.

This resulted in glitchy artifacts in bright areas (See issue 7439)

I rewrote the code to use a proper clamping function so it's cleaner
to read.
2014-07-15 21:15:49 +12:00
Lioncash b66eb03b2f OGL: Correctly guard against array bounds of s_encodingPrograms
s_encodingPrograms is defined as an array with a length of 64
NUM_ENCODING_PROGRAMS is also defined as 64.

However 64 is out of bounds, so we want to be comparing for "equal to or
greater than here"
2014-07-14 00:48:14 -04:00
Tillmann Karras 0ccee6c87b Fix warnings unearthed by #579 2014-07-13 02:16:51 +02:00
degasus 7e79806efc remove unused globals
Also change globals into statics which are only used in one file
2014-07-11 16:10:20 +02:00
degasus 81ed17be53 avoid the extern keyword in .cpp files 2014-07-11 16:10:20 +02:00
degasus 6d3f249dcc mark all local variables as static 2014-07-11 16:10:20 +02:00
degasus 22e1aa5bb4 mark all local functions as static 2014-07-11 16:07:23 +02:00
Jules Blok 1754cbda9d Move FPSCounter calls to RenderBase. 2014-07-10 23:11:09 +02:00
Lioncash a523a6d1bf D3D: Use std::strings for Compile[x]Shader and CompileAndCreate[x]Shader
With strings, we don't need to care about passing in a length, since it internally stores it. So now, we don't even need a length parameter for these functions anymore as well.
This also kills off some sprintf_s calls.
2014-07-07 19:32:03 -04:00
Justin Chadwick 43dcbe0a73 Change the comments to be more detailed. 2014-07-04 08:00:49 -04:00
Justin Chadwick 30f93ab418 Place pinned memory as top priority 2014-07-03 20:35:13 -04:00
Lioncash 00efaedb02 FPS counter cleanup
- Isolate it into it's own namespace
- Shorten function names, the namespace self-documents.
- Just use the std I/O, we can just write directly to the stream for
  logging.
2014-07-02 20:23:09 -04:00
degasus 7db5a4b22d Statistics: Reformat stats string 2014-06-27 09:36:50 +02:00
degasus f1ddd3c66a VideoCommon: remove unused stats 2014-06-27 09:35:26 +02:00
Lioncash ca5340ebde Centralize the logging code into its own folder in Common. 2014-06-25 22:11:42 -04:00
Lioncash 8b13afbb8e Remove the 32-bit config platform from the VS solution and projects 2014-06-24 22:07:26 -04:00
Pierre Bourdon 5dff577339 Merge pull request #500 from lioncash/ini
Use only section-based ini reading.
2014-06-22 17:21:45 +02:00
Tony Wasserka d60f91ef5a Merge pull request #501 from magumagu/sw-cp-structs
VideoSoftware: remove duplicated CommandProcessor structures.
2014-06-21 22:23:19 +02:00
magumagu 8bf3ffc76f VideoSoftware: remove duplicated CommandProcessor structures. 2014-06-21 11:54:43 -07:00
Tony Wasserka fbca397c92 Merge pull request #439 from degasus/lighting-fix
Lighting cleanup
2014-06-21 12:17:26 +02:00
Paul Olszewski c5ef249c4b Make the common "Failed to enumerate outputs" message much more useful.
Now it includes its most common cause, a simply-worded solution, and an exclamation point.
2014-06-20 15:51:54 -05:00
degasus 924ad1ee9f LightingShader: hard code const variable 2014-06-19 16:46:53 +02:00
degasus d93f2973f7 PixelShader: use the vertex const buffer for ppl 2014-06-19 16:33:33 +02:00
degasus 027baad73b VideoCommon: use the Light struct in XF memory 2014-06-19 16:33:29 +02:00
Tony Wasserka e642c8d0c1 Merge pull request #497 from Armada651/osd-scaling
D3D: Reset viewport before drawing the OSD.
2014-06-19 15:26:10 +02:00
Lioncash ce54c1e571 Kill off replaceable usages of s[n]printf. 2014-06-18 19:53:38 -04:00
Jules Blok 6c52ec93b7 D3D: Reset viewport before drawing the OSD. 2014-06-16 23:34:54 +02:00
Lioncash f05d3f6e5d Use only section-based ini reading. 2014-06-16 01:31:23 -04:00
Pierre Bourdon 020b4fde1e Merge pull request #492 from Armada651/master
Remove EmuWindow
2014-06-15 14:16:53 +02:00
Armada f2759ffe65 Remove EmuWindow.
All it did was raise complexity.
2014-06-15 00:49:49 +02:00
Tony Wasserka d7736ac714 Merge pull request #445 from magumagu/video-dead-code
Video backends: remove dead code.
2014-06-13 22:38:22 +02:00
Paul Olszewski 5d793881b0 Fix the capitalization of "GameCube" throughout the project. 2014-06-08 11:24:49 +09:00
Ryan Houdek d2e4c2fc50 Fix OpenGL ES version detection.
Mesa report GLES version as "3.0" not "3.00"
Spec mandates X.Y versioning scheme, doesn't say how long the decimal place must be.
2014-06-06 21:21:35 -05:00
degasus 9566dcf0da OGL: speed up the EFB cache
gcc doesn't optimize this loops with -O2, so using memset now.
A flag to skip the clear funktion was added as the cache is already cleared most of the time.
2014-06-05 14:53:09 +02:00
degasus d9eafd94a2 OGL-StreamBuffer: replace size_t with u32
Yes, this matters.
We align our buffer all the the time which needs a division. u64 divisions are just so slow.
2014-06-05 13:33:50 +02:00
degasus 606e46ba8d OGL-StreamBuffer: move alignment to caller
Only the caller know if alignment is needed at all, so it can be skipped now.
2014-06-05 13:32:13 +02:00
degasus 02a4e3d70f OGL-StreamBuffer: make the SLOT calculation much easier
The size of the buffer is now power of 2, so we can use a shift instead of a division.
This was at about 2% of the global CPU usage.
2014-06-05 13:32:13 +02:00
degasus d81d2e8915 OGL-StreamBuffer: allocate fences in StreamBuffer directly 2014-06-05 13:32:13 +02:00
degasus 0688cfdaef OGL-StreamBuffer: don't use coherent mapping
Coherent mapping seems to be much slower on fermi gpus.
2014-06-05 12:18:44 +02:00
magumagu 0aecd9504e Video backends: remove dead code. 2014-06-01 01:56:09 -07:00
Lioncash 49b0eef393 Remove the min/max functions in CommonFuncs.
The algorithm header has the same functions.
2014-05-29 21:44:41 -04:00
shuffle2 329fcad04f Merge pull request #421 from CarlKenner/MissingSpace
Fix error message when D3D11 HResults fail.
2014-05-29 14:06:18 -07:00
CarlKenner 361d53fdc7 Fix error message when D3D11 HResults fail.
Prevents showing the wrong function name by putting a space between the function name and "Failed".
Also fixes the capitalization.
2014-05-27 00:45:26 +09:30
Lioncash 1583ce9363 Use strings instead of arbitrary buffers for video statistics 2014-05-25 21:11:29 -04:00
shuffle2 b58753bd69 Merge pull request #370 from Sonicadvance1/remove_specialized_memcmp
Removes ZeroFrog's "optimized" memcpy and memcmp functions.
2014-05-22 13:02:11 -07:00
degasus c1b6fcc00b ogl: pixel format shader without resolving
v2: Don't use std::to_string as this function is broken on android.
2014-05-19 09:29:40 +02:00
degasus e150d307a6 ogl: use ARB_texture_multisample for msaa 2014-05-19 09:21:44 +02:00
degasus fab78c2dff ogl: add ARB_texture_multisample 2014-05-19 09:21:44 +02:00
degasus 775858b6bc ogl: drop NV_framebuffer_multisample_coverage 2014-05-19 09:21:44 +02:00
degasus afea848e3b ogl: drop csaa support 2014-05-19 09:21:44 +02:00
Tony Wasserka 6950f533ae Merge pull request #355 from magumagu/gx-missing-opcode
Opcode decoding: handle missing opcodes 0x88 etc.
2014-05-18 11:12:06 +02:00
Ryan Houdek a4bb0dafb4 Removes ZeroFrog's "optimized" memcpy and memcmp functions.
These were only compiled in on Windows and x86_32.
They provided "optimized" copies and compares based on blocksizes for the AMD Athlon and Duron CPU families.
The code was taken from something that AMD provides with a as-is license.
Just get rid of this crap.
2014-05-17 18:03:31 -05:00
Tony Wasserka fc34d5a130 Merge pull request #360 from magumagu/lighting-rounding
Video backends: fix rounding in lighting computation.
2014-05-17 21:06:31 +02:00
magumagu 9b82d72070 Video backends: warn on usage of GL_DRAW_QUADS_2.
It's not normally used, so if it shows up, it could indicate a CPU emulation
bug.
2014-05-17 11:55:32 -07:00
Tony Wasserka 0fac17da33 Merge pull request #269 from magumagu/swbackend-xfregisters
SW backend: use VideoCommon XFRegisters struct.
2014-05-17 10:40:57 +02:00
magumagu 1357277f40 Video backends: mass-replace "xfregs" with "xfmem". 2014-05-16 18:58:07 -07:00
magumagu 8f5342c442 Video backend: merge global var xfmem into xfregs.
There isn't really any reason to keep them separate.
2014-05-16 18:55:31 -07:00
magumagu 818c89313e Video backends: unify xfregs/xfmem structures.
Removes the duplicate swxfregs global variable/struct from the software
backend in favor of the ones from VideoCommon.
2014-05-16 18:55:30 -07:00
magumagu 8b82cea704 Video backends: fix behavior of "konst" TEV inputs.
Also fixes TEVCOLORARG_HALF.

Values verified to match hardwarere.
2014-05-16 12:19:35 -07:00
Tony Wasserka b8817267f4 Merge pull request #366 from Jezze/vertex
OGL/VertexManager: Remove unused variable.
2014-05-16 16:18:14 +02:00
Tony Wasserka 25e8dc0aed Merge pull request #354 from magumagu/gx-primitive-mask
Opcode decoding: 0xC0 isn't a valid command.
2014-05-16 15:59:59 +02:00
Jens Nyberg f742c5a057 OGL/VertexManager: Remove unnused m_CurrentVertexFmt 2014-05-13 23:59:08 +02:00
magumagu 9e4eeb3b9b Video backends: fix rounding in lighting computation.
For whatever reason, the hardware doesn't do a full divide by 255, but
instead uses an approximation with shifting, similar to the way it is done
in TEV.
2014-05-11 12:53:02 -07:00
Shawn Hoffman 17577affba D3D: Don't pass D3D10_SHADER_WARNINGS_ARE_ERRORS to the compiler in debug builds.
For quite a while this has been causing integer division to generate a warning as error, blocking shader compiling. This means probably no one has even been running D3D in debug builds...
I tried disabling the warning with a #pragma, but it doesn't seem to apply when this flag is used.
2014-05-10 22:12:54 -07:00
magumagu 39d439fc48 Opcode decoding: handle missing opcodes 0x88 etc.
Hardware testing shows that they do the same thing as the 0x80 family of
opcodes: they draw quads.
2014-05-10 20:33:28 -07:00
magumagu 369c0c4ce2 Opcode decoding: 0xC0 isn't a valid command.
Fix our opcode decoders to handle this appropriately.
2014-05-08 15:49:19 -07:00
Tony Wasserka b4e1ac5f08 Merge pull request #185 from degasus/shader-cleanup
Shader cleanup
2014-05-06 11:37:11 +02:00
magumagu bca0b7b543 OpenGL: delete unused function parameter in TextureConverter.
(While I'm here, also mark some functions static.)
2014-05-05 10:56:36 -07:00
degasus 25b8edd2a6 ogl: fix signed vs unsigned comparison warning 2014-05-05 17:06:36 +02:00
Ryan Houdek 2d8cfb89d7 Changes posmtx vertex attribute to integer.
This makes it so we don't need to do some dumb casting from float to integer in our shaders.
Only tested in OpenGL, needs to be tested in D3D.
2014-04-30 19:11:06 -05:00
Ryan Houdek 99338daa8f Fixes glVertexAttribIPointer on GLES.
We need to pull in function pointers for OpenGL 3.0 in order to use glAttribIPointer.
This isn't too big of an issue, and this code will be gone in the future when we change over to libepoxy.
Just need to push code upstream to libepoxy to support Android with GLES and GL first.
2014-04-30 19:11:06 -05:00
Tony Wasserka a40ea4e26a Merge pull request #236 from magumagu/d3d11-fix-peekz
D3D11: Use appropriate shader for PEEK_Z.
2014-04-27 16:09:02 +02:00
Tony Wasserka fe65474cc4 Software renderer: Update a reference link. 2014-04-24 00:42:08 +02:00
Pierre Bourdon d8ca861fec Merge pull request #287 from Tilka/unused_variable
Fix "warning: unused variable 'skipFrames'"
2014-04-19 09:03:19 +02:00
Tillmann Karras d523d2002b Fix "warning: unused variable 'skipFrames'" 2014-04-19 04:59:37 +02:00
Ryan Houdek 92ec49ac9f Change to ARM's naming convention in DriverDetails.
This matches how ARM handles their naming in their drivers for different models.
Really it's that way because both Mali-T6xx and Mali-T7xx fall under Midgard.
While everything else (except Mali-55) fall under Utgard.
2014-04-18 21:06:32 -05:00
magumagu 648b9865d8 D3D11 backend: fix rounding in texture encoder.
We need to explicitly round when converting colors from float to uint
because multiplying a normalized float by 255 might not result in a whole
number.  (The exact result here may vary depending on your
drivers/hardware.)

Ideally, we shouldn't be using floating point here, but fixing that is a
much more complicated patch.

Fixes gxtest TEV tests using Intel HD 4000.
2014-04-15 23:36:05 -07:00
magumagu 685d612c8c Software backend: don't skip red component in TEV. 2014-04-15 14:05:12 -07:00
magumagu 5e1c6aba33 Software backend: make TEV rounding match hardware.
Formulas stolen from gxtest.  (Not sure how "==" got turned into "!=", but
I'm pretty confident the patched version is correct.)
2014-04-15 14:04:46 -07:00
Matthew Parlane 4e0b7260b6 Merge pull request #263 from Sonicadvance1/DetermineMaliVersion
Add Mali driver version check and support of checking for Mali-T7xx
2014-04-14 19:20:04 +12:00
magumagu 812ff4686b OpenGL backend: remove useless header Globals.h.
The header has no content, so it can can just be deleted.
2014-04-12 19:25:37 -07:00
degasus 96ffbe345d VideoSoftware: remove const memory usage of DebugUtil 2014-04-12 13:32:53 +02:00
magumagu f18a3cc650 OpenGL config: clear backend_info.Adapters on init
Fixes a minor UI glitch where if you switch from Direct3D to OpenGL, the
OpenGL config page would appear to have an adapter choice available.
2014-04-12 00:17:36 -07:00
Ryan Houdek a9fa49f34d Support checking for the Mali-T7xx line of GPUs.
They are similar enough that they will share bugs with their drivers, so make them fall under the same Mali-Txxx umbrella of bug issues.
If there is ever a need in the future for having separate bugs depending on family, we can support that then.
2014-04-11 23:46:44 -05:00
Ryan Houdek ed67cc3fb2 Add the ability to determine the Mali driver version.
This is the only way we can determine the video driver version with mali.
Really it's a good thing that they only push driver updates once every two years, makes it easy to determine what driver anybody is running.
2014-04-11 23:38:40 -05:00
magumagu fd9c1fa746 VideoBackend: remove unused config vars.
No point to keeping around variables which are always "true".
2014-04-11 14:53:12 -07:00
magumagu 76d7c1eb9c D3DBackend: Don't recompute ID3D11Layout.
CreateInputLayout requires a shader as an input, but it only cares about
the signature; we don't need to recompute it for different shaders with
the same inputs.
2014-04-11 13:13:01 -07:00
Tony Wasserka 306b9afd1e Merge pull request #224 from magumagu/swrender-deletepixelfork
Software backend: Delete forked PixelEngine.
2014-04-11 20:01:23 +02:00
magumagu d0f89b2b63 SWBackend: Fix code style. 2014-04-05 13:08:00 -07:00
Matthew Parlane 13119e6755 Merge pull request #240 from Sonicadvance1/GLSLES310_binding
Add initial support for GLSL ES 3.10.
2014-04-04 08:43:20 +13:00
Ryan Houdek 3251d78f89 Add initial support for GLSL ES 3.10.
GLSL ES 3.10 adds implicit support for the binding layout qualifier that we use.
Changes our GLSL version enums to bit values so we can check for both ES versions easily.
2014-04-03 00:46:09 -05:00
Ryan Houdek ca9ee3586f Merge pull request #227 from magumagu/swbackend-fix-shaders
SW backend: make shaders work on Intel/Windows.
2014-04-02 14:51:14 -05:00
magumagu f9d2f7e88c D3D11: Use appropriate shader for PEEK_Z.
Trying to use GetDepthMatrixProgram outside of
TCacheEntry::FromRenderTarget is a bad idea, so don't.  Instead, use a
shader which only copies the input.

Fixes lens flare depth test in Twilight Princess. See
http://code.google.com/p/dolphin-emu/issues/detail?id=5999 .
2014-03-30 19:50:53 -07:00
Pierre Bourdon 9b03178673 Merge pull request #222 from comex/more-clang-fixes
More clang fixes
2014-03-30 13:24:08 +02:00
comex 92dd498fa7 Fix harmless warnings. 2014-03-30 01:40:11 -04:00
magumagu bdcd5ba39b SW backend: make shaders work on Intel/Windows.
Apparently the Intel shader compiler doesn't implement "#if" correctly...
so use "#ifdef" instead.
2014-03-29 13:10:43 -07:00
magumagu 0661efea84 Software backend: Delete forked PixelEngine.
Mostly just zapping a bunch of duplicated code; the only interesting thing
going on here is the changes to the performance counter implementation.
2014-03-29 12:07:20 -07:00
Pierre Bourdon 664c8d30a0 Remove all trailing whitespaces from our codebase. 2014-03-29 11:05:44 +01:00
Tony Wasserka 1dead05cae Software renderer: Properly calculate tev combiner output.
As pointed out by dolphin-emu/hwtests@461476112.
2014-03-26 00:23:58 +01:00
Tony Wasserka a8c8db8da7 Software renderer: Use color combiner configuration for alpha combiner compare mode inputs.
As pointed out by dolphin-emu/hwtests@f684f2498.
2014-03-26 00:23:58 +01:00
Tony Wasserka 16105db709 BPMemory: Make use of BitField in a number of structures. 2014-03-25 23:57:58 +01:00
Tony Wasserka 8941f19cdb BPMemory: Expose the pixel_format and zformat fields in PE_CONTROL as enumerations. 2014-03-25 23:57:58 +01:00
Tony Wasserka 77a7bab5ae BPMemory: Use the new BitField class in two selected structures. 2014-03-25 23:57:57 +01:00
Ryan Houdek 89efec6109 Merge pull request #167 from neobrain/ogl-efbpokes
Implement EFB pokes in the OpenGL backend.
2014-03-20 15:25:56 -05:00
Jens Nyberg ae260e55e4 OGL/VertexManager: Do not check if g_nativeVertexFmt is zero
The variable is already dereferenced both before and after this
check which means that if this variable would ever be zero it would
have crashed dolphin already.
2014-03-18 21:33:30 +01:00
Jens Nyberg 80421156b6 OGL/VertexManager: Minor cleanup of if case 2014-03-18 21:33:30 +01:00
Tillmann Karras 7e39cf3b0d .gitignore: fix the build directory pattern 2014-03-17 02:55:56 +01:00
Tillmann Karras 2fcaca0603 More range-based loops and overrides 2014-03-17 02:55:55 +01:00
Pierre Bourdon 8d679e76d2 Merge pull request #164 from lioncash/cstr-cull
Kill off some usages of c_str.
2014-03-15 00:57:56 +01:00
Tony Wasserka d946e4e238 OpenGL: Implement color and z pokes. 2014-03-14 23:39:52 +01:00
Tony Wasserka 3a6389992e PixelShaderGen: Treat UV coordinates like S17.7 integers (they're still stored as float, though). 2014-03-14 22:31:30 +01:00
Tony Wasserka 0238a56816 PixelShaderGen: Change indirect texture matrix uniforms to use integers. 2014-03-14 22:31:18 +01:00
Tony Wasserka cff952c397 PixelShaderGen: Use integer math for indirect tev stage texcoord calculation. 2014-03-14 22:30:27 +01:00
Tony Wasserka fa77e1d2b6 PixelShaderGen: Use integer math for alpha testing. 2014-03-14 22:26:48 +01:00
Tony Wasserka 2af50f04c2 OGL: Force highp for integers. 2014-03-14 22:26:26 +01:00
Tony Wasserka 032c920247 OGL: Remove some dead code. 2014-03-14 22:26:26 +01:00