Commit graph

176 commits

Author SHA1 Message Date
Tillmann Karras
c89f04a7c5 clang-modernize -loop-convert
and some manual adjustments
2014-03-09 21:11:59 +01:00
Tillmann Karras
315a8ba1c0 Various changes suggested by cppcheck
- remove unused variables
- reduce the scope where it makes sense
- correct limits (did you know that strcat()'s last parameter does not
  include the \0 that is always added?)
- set some free()'d pointers to NULL
2014-02-28 12:43:20 +01:00
degasus
f628695d31 comment fixes 2014-02-26 12:48:52 +01:00
degasus
aaaa5af0b2 remove (ATTR|VARY)(IN|OUT) macros 2014-02-26 11:37:29 +01:00
degasus
7f539b6033 ogl: optimize real xfb a bit
Both nvidia + mesa seems not to optimize x / (2**n) to x >> n, so we do it ourself.
2014-02-26 11:37:28 +01:00
Pierre Bourdon
425f9dcd51 Fix more header sorting issues in VideoBackends/ (now check-includes clean). 2014-02-20 01:01:11 +01:00
Lioncash
2afe215271 Convert all includes to relative paths. 2014-02-18 02:19:10 -05:00
Lioncash
3fd87a7636 Second and final pass of clearing out tabs. 2014-02-17 02:19:41 -05:00
Pierre Bourdon
b18a33377d Merge pull request #55 from Sonicadvance1/GLExt-InitArray
Change OpenGL extension initialization in to a big array
2014-02-17 02:16:16 +01:00
Ryan Houdek
eae9d47c3c Change OpenGL extension initialization in to a big array
This is a reasonable chunk of changes and moves from multiple initialization functions in to an array initialization.
2014-02-16 17:40:34 -06:00
Tony Wasserka
de5bfd0bce Merge pull request #37 from degasus/VideoCommonApiFixes
VideoCommon API cleanups
2014-02-16 22:08:28 +01:00
Pierre Bourdon
92f8d93e96 Remove the old MMIO access "interface". 2014-02-16 19:22:40 +01:00
degasus
d5f1f0d4a9 merge some common parts of Swap() into VideoCommon 2014-02-15 11:33:43 +01:00
degasus
3551259c7a use EFBRectangle for scissor rect
This one is backend independed. The backend should recalc such things on their own.
2014-02-15 11:33:43 +01:00
degasus
1f4219b5b4 move perfquery enable checks into videocommon (caller side) 2014-02-15 11:33:43 +01:00
degasus
5a660c27bc rename UpdateViewport to SetViewport like all others setters in RenderBase.h 2014-02-15 11:33:43 +01:00
degasus
3cd6918dec fix ogl video config crash
This will happen when playing on any other backend than ogl which have a non-trival GLInterface::GetMode() method.
2014-02-15 11:33:43 +01:00
degasus
e5318d2624 move shared parts from VertexManager::vFlush into VideoCommon 2014-02-15 11:33:43 +01:00
Lioncash
655d22512b Kill off some usages of the ArraySize macro.
This required the use of std::array in some cases.
2014-02-15 02:43:54 -05:00
Tillmann Karras
404624bf0b Turn loops into range-based form
and some things suggested by cppcheck and compiler warnings.
2014-02-13 09:05:50 +01:00
lioncash
d2038049f5 Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Ryan Houdek
6a5cd02629 Cleanup GLExtensions on how it fails.
If there is an issue with a reported extension, disable it instead of failing out entirely.
Fixes an issue with buffer_storage that I had overlooked as well.
2014-02-08 19:50:12 -06:00
Ryan Houdek
9f91769def Improve GLExtensions compile time.
This changes from using logical and to bitwise and, which causes the compile time to drop from an absurd amount of time to around five seconds on my
crappy laptop.
2014-02-08 15:04:17 -06:00
degasus
6089e4470a OGL: remove ubo workaround
This was only keeped for some broken mesa versions. Meanwhile most used versions should be fixed for almost a year.
2014-02-01 22:33:45 +01:00
Tony Wasserka
3dd31fe22b Merge pull request #11 from degasus/VertexLoaderCleanup
Vertex loader cleanup.
2014-01-31 06:13:26 -08:00
degasus
010a0d481a VideoCommon: remove Cache Displaylist
This option was known to break every second game and only boost a bit.
It also seems to be broken because of streaming into pinned memory and buffer storage buffers.

v2: also remove dlc_desc
2014-01-31 07:30:55 +01:00
degasus
a65162f1cd PortableVertexFormat: use AttributeFormat for posmtx attribute format 2014-01-31 07:19:34 +01:00
degasus
6c59b691b0 PortableVertexFormat: use AttributeFormat for texcoord attribute format 2014-01-31 07:19:34 +01:00
degasus
ef2d6e7d53 PortableVertexFormat: use AttributeFormat for color attribute format 2014-01-31 07:19:34 +01:00
degasus
b38ef39ab7 PortableVertexFormat: use AttributeFormat for normal attribute format 2014-01-31 07:19:34 +01:00
degasus
210f4f3e55 PortableVertexFormat: add a struct which hold all needed information for every vertex and use this for position
atm, position attribute is hardcoded both in VertexLoader and in backends.

v2: fix coding style + cleanup lookup table
2014-01-31 07:19:25 +01:00
degasus
02d1d8e6a0 NativeVertexFormat: swap unsigned / signed formats to match GX order 2014-01-30 11:12:10 +01:00
Ryan Houdek
99b6c82ac3 [Android] Fix Adreno v53 development drivers rotating framebuffer
Older Qualcomm drivers rotated the framebuffer 90 degrees and this fix didn't work.
Now for some obscene reason it rotates a full 180 degrees.
This can at least be worked around by flipping around the image on our end.
2014-01-29 16:39:45 -06:00
degasus
b1290a8630 OGL: remove version check for buffer_storage on windows
On Windows, nvidia don't give us their driver version, so we can't workaround any issues.
As buffer_storage is broken on some drivers, we wanted to disble it for them.
So we can't.

Luckyly only "some" released driver versions are affected as this extension is only available since some months. Let's hope that nobody have to use one of this driver version, else they will get a black screen ...
2014-01-28 15:15:26 +01:00
crudelios
9b6c6fa9e4 BBox: Changed the rounding again, the old one fixed Paper Mario but had bugs in Mickey's Magical Mirror. This change fixes the glitches in both games.
Also fixed some compiler warnings.
2014-01-26 13:21:22 +00:00
degasus
d3fd0eddbb OSX: don't avoid unsync mapping on nvida gpus just because the windows driver doesn't like it
OSX has their own driver, so performance issues aren't shared with the nvidia driver (unlike the closed source linux and windows nvidia driver). So now they'll also use the MapAndSync backend like all other osx drivers.

fixes issue 6596

I've also cleaned up the if/else block selecting the best backend a bit.
2014-01-26 11:00:29 +01:00
Ryan Houdek
fd8757a64b Fix OpenGL 2.1 devices that support everything we need.
The only two devices that do this are Mesa software rasterizer and Intel Ironlake(With a few hacks).
Basically since it doesn't support OpenGL 3.0, it can't grab the version the new way.
So failing that, it sets to GL 2.1, and continues.

Further along, on Ironlake at least, it tries grabbing the extensions the new GL 3.0 way and fails.
So have a fallback that grabs the extensions string the old way, in probably the most elegant way possible.
2014-01-23 16:02:53 -06:00
degasus
65121cf9a9 OpenGL: remove unused OpenGL headers 2014-01-23 18:52:57 +01:00
degasus
ff002320a5 OpenGL: Stream vertices + indices 2014-01-23 15:12:31 +01:00
degasus
128fcdac26 OpenGL: refactor all of our StreamBuffers
The old way was to use big switch/case statements based on a type of buffer.
The new one is to use inheritance.

This change prohibits us to change the buffer type while running, but I doubt we'll ever do so.
Performance should also be a bit better. Also a nice cleanup.

Added some comments about this different kind of buffers.
2014-01-23 15:12:31 +01:00
degasus
be1fee6d74 OpenGL: change StreamBuffer in a streaming way
This is a bit slower on map_and_* because of flushing and _very_ much slower on buffer(sub)?data because of a new memcpy.
But this design allow us to decode directly into a gpu buffer, eg vertexloader will profit :)
2014-01-23 15:12:31 +01:00
Ryan Houdek
07db7520bf [GLExt-Cleanup] This cleans up some extra bits unneeded in the extension headers
gl.h and glext.h provide most of the function pointer typedefs and defines for extensions and core features.
The only one it doesn't provide is GL 1.1 function typedefs, but this is to be expected.
If anything needs defines or typedefs in their header in the future, that's as easy as before.
2014-01-23 07:11:13 -06:00
degasus
ebbf1d392b VideoCommon: merge trivial parts of VertexManager::Flush 2014-01-21 10:47:00 +01:00
degasus
60632fda6f OpenGL: remove small optimization
This one was introduced to reduce the glBindTexture and glActiveTexture calls. But it was quite a bit of logic and only an improvment on uploading/creating a texture, which is done rarely.
2014-01-21 10:34:48 +01:00
degasus
fe02833f13 OpenGL: fix our ubo workaround when blend_func_extended is missing 2014-01-21 10:03:05 +01:00
Scott Moreau
2c8340e1dc Move GLInterface.h into GLInterface directory 2014-01-20 00:46:21 -07:00
Ryan Houdek
683dbc09ac Stop building GLExtensions.cpp twice(One in GL, one in software). We don't need to build it twice, this'll save a bit of time in the build process.
Also a bit of spacing cleanup.
2014-01-19 11:37:37 -06:00
Ryan Houdek
5d26bf6d9d Rename our GLInterface class function 'GetProcAddress' in order to not have clashing function names due to Windows. 2014-01-18 14:18:32 +00:00
Ryan Houdek
bea484e12f Move Win32 specific function grabbing fallback to WGL.cpp. Fixes issue 6964. 2014-01-18 14:10:24 +00:00
Ryan Houdek
839df31347 Merge of GL-AutoChoose.
This branch is the final step of fully supporting both OpenGL and OpenGL ES in the same binary.
This of course only applies to EGL and won't work for GLX/AGL/WGL since they don't really support GL ES.
The changes here actually aren't too terrible, basically change every #ifdef USE_GLES to a runtime check.

This adds a DetectMode() function to the EGL context backend.
EGL will iterate through each of the configs and check for GL, GLES3_KHR, and GLES2 bits
After that it'll change the mode from _DETECT to whichever one is the best supported.
After that point we'll just create a context with the mode that was detected
2014-01-18 04:11:59 +00:00