Commit Graph

42 Commits

Author SHA1 Message Date
Lioncash 01f99a04a2 VideoBackend: Get rid of a boolean global
Also gets rid of global headers
2016-01-02 18:03:28 -05:00
Lioncash d20ba76ab3 StreamBuffer: Make factory function return a std::unique_ptr 2015-12-21 10:21:38 -05:00
Lioncash f295182833 VideoBackends: Simplify initialization and deinitialization of resources
Approximately three or four times now, the issue of pointers being
in an inconsistent state been an issue in the video backend renderers
with regards to tripping up other developers.

Global (ugh) resources are put into a unique_ptr and will always have a
well-defined state of being - null or not null
2015-12-20 22:40:37 -05:00
Tillmann Karras 983978ee66 VideoCommon: flush vertex manager if components change 2015-11-01 22:39:31 +01:00
Rohit Nirmal 3b75f45cf6 Fix building with PCH disabled. 2015-09-28 11:51:08 -05: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
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
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 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
Jules Blok 2850c9a206 VertexManager: Disable culling for lines and points. 2014-12-18 00:36:47 +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
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
Lioncash 49b94e5285 OGL: Get rid of error macros 2014-10-26 04:54:58 -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
Pierre Bourdon 73f9a22e2e VertexLoader: Remove global state dependency on g_nativeVertexFmt 2014-07-26 01:35:09 +02:00
degasus 81ed17be53 avoid the extern keyword in .cpp files 2014-07-11 16:10:20 +02:00
degasus f1ddd3c66a VideoCommon: remove unused stats 2014-06-27 09:35:26 +02:00
Lioncash ce54c1e571 Kill off replaceable usages of s[n]printf. 2014-06-18 19:53:38 -04:00
Jens Nyberg f742c5a057 OGL/VertexManager: Remove unnused m_CurrentVertexFmt 2014-05-13 23:59:08 +02: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
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
Matthew Parlane 31cfc73a09 Fixes spacing for "for", "while", "switch" and "if"
Also moved && and || to ends of lines instead of start.
Fixed misc vertical alignments and some { needed newlining.
2014-03-11 00:35:07 +13:00
Tillmann Karras d802d39281 clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
2014-03-09 21:14:26 +01:00
Lioncash 2afe215271 Convert all includes to relative paths. 2014-02-18 02:19:10 -05:00
degasus 1f4219b5b4 move perfquery enable checks into videocommon (caller side) 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
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
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
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
degasus 6b01839525 VideoCommon: merge triangle+list+point index buffers
We are used to render them out of order as long as everything else matches, but rendering order does matter, so we have to flush on primitive switch. This commit implements this flush.
Also as we flush on primitive switch, we don't have to create three different index buffers. All indices are now stored in one buffer.

This will slow down games which switch often primitive types (eg ztp), but it should be more accurate.
2014-01-17 16:34:53 +01:00
degasus 5e5db9fbc6 VideoCommon: cleanup of "components" usage
This "u32 components" is a list of flags which attributes of the vertex loader are present.
We are used to append this variable to lots of vertex generation functions, but some of them don't need it at all.
2014-01-15 16:58:36 +01:00
Jasper St. Pierre 34692ab826 Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00