summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderManager.cpp
AgeCommit message (Collapse)Author
2016-02-15D3D12: Additions to VideoCommon to support D3D12 backend.hdcmeta
2016-01-31VideoCommon: Convert some DataReader includes into forward declarationsLioncash
Gets rid of some indirect inclusions in cpp files. Also this will reduce the amount of rebuilt files if changes occur in the DataReader header.
2016-01-17VideoCommon: Header cleanupLioncash
Also remedies places where the video backends and core rely on things being indirectly included.
2016-01-06VideoSW: Use more VideoCommondegasus
Now we require lots of empty functions, but this removes by far more duplicated code.
2015-12-22VertexLoaderBase: Get rid of explicit delete and newLioncash
2015-11-24NativeVertexFormat: Inline Initialize in contructordegasus
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-02VideoCommon: VertexManager -> VertexManagerBaseTillmann Karras
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-01VideoCommon: flush vertex manager if components changeTillmann Karras
2015-10-22VertexLoaderManager: symbolize magic constantTillmann Karras
2015-07-08VertexLoader: avoid empty lines in perf-$pid.mapTillmann Karras
2015-06-07zfreeze: cache vertex positionsTillmann Karras
Suggested by degasus.
2015-05-30Add a dirty flag for arraybases.Scott Mansell
Only loop through and call getPointers when something has actually changed. Worth about 2-4% speedup un SMG over the previous commit.
2015-05-30Clean up cached_arraybases. Update VideoSW to new scheme.Scott Mansell
Move ownership of cached_arraybases from CPMemory to VertexLoaderManager to better match it usage.
2015-05-29Fix invalid pointer errors in Burnout 2.Scott Mansell
Yet another story of games loading weird shit into registers. For some reason, Burnout 2 would (in rare situations) load invalid addresses into cp_state.array_bases. What would the real hardware do in this situation? Who knows, Burnout 2 doesn't actually enable the vertex array with the invalid address so nothing kinky happens. But dolphin tries to optimise things and starts using the address as soon as it is loaded into memory. This causes GetPointer (which is now much more vocal) to throw an error. The Fix: We don't call GetPointer until we are sure the vertex array has been enabled.
2015-05-25Merge pull request #2274 from degasus/disable_bboxRyan Houdek
Disable bbox
2015-05-25Set copyright year to when a file was createdTillmann Karras
2015-05-25Update license headers to GPLv2+Tillmann Karras
2015-05-25BBox: remove now unreachable SW bbox implementationdegasus
2015-02-23Merge pull request #2050 from Tilka/reset_vertex_loader_statsskidau
VertexLoaderManager: reset stats properly
2015-02-14VertexLoaderManager: reset stats properlyTillmann Karras
2015-02-13Change RunVertices' function arguments.Ryan Houdek
This reduces some dumb state shuffling when calling the emitted vertex loaders.
2015-01-31VertexLoaderManager: assimilate GetVertexSize()Tillmann Karras
2015-01-24Stop doing nastly shit to OpenGL stream buffers.Scott Mansell
Instead we keep the loaded vertices in CPU memory.
2015-01-23Fix various issues with zfreeze implemntation.Scott Mansell
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-18VertexLoaderManager: make it nicer to readTillmann Karras
2015-01-03VideoCommon: fix deterministic dual coredegasus
2014-12-21VideoCommon: split VertexLoaderBase from VertexLoaderdegasus
2014-12-21VertexLoader: remove inlined gettersdegasus
They just blow up the code.
2014-12-21VideoCommon: Move NativeVertexFormat cache to VertexLoaderManagerdegasus
2014-12-21VertexLoaderUid: remove operator<degasus
Not needed for unordered map.
2014-12-21VideoLoader: remove VAT_*_FRACBITSdegasus
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-09VideoCommon: clean up VertexLoaderdegasus
2014-12-09VideoCommon: cleanup OpcodeDecoderdegasus
2014-10-25Convert some VideoCommon stuff to BitSet.comex
Now with a minor performance improvement removed for no reason.
2014-09-28Changes to allow LoadCPReg to work in a preprocess mode which affects a ↵comex
separate state. This state will be used to calculate sizes for skipping over commands on a separate thread. An alternative to having these state variables would be to have the preprocessor stash "state as we go" somewhere, but I think that would be much uglier. GetVertexSize now takes an extra argument to determine which state to use, as does FifoCommandRunnable, which calls it. While I'm modifying FifoCommandRunnable, I also change it to take a buffer and size as parameters rather than using g_pVideoData, which will also be necessary later. I also get rid of an unused overload.
2014-09-28Mechanical changes to move most CP state to a struct rather than separate ↵comex
globals. The next commit will add a separate copy of the struct and the ability for LoadCPReg to work on it.
2014-09-28Some changes to VertexLoaderManager:comex
- Lazily create the native vertex format (which involves GL calls) from RunVertices rather than RefreshLoader itself, freeing the latter to be run from the CPU thread (hopefully). - In order to avoid useless allocations while doing so, store the native format inside the VertexLoader rather than using a cache entry. - Wrap the s_vertex_loader_map in a lock, for similar reasons.
2014-09-19Fix build failing when disabling precompiled headers.Rohit Nirmal
2014-09-04VideoCommon: rewrite frame skipping codedegasus
2014-09-01Refactor opcode decoding a bit to kill FifoCommandRunnable.comex
Separated out from my gpu-determinism branch by request. It's not a big commit; I just like to write long commit messages. The main reason to kill it is hopefully a slight performance improvement from avoiding the double switch (especially in single core mode); however, this also improves cycle calculation, as described below. - FifoCommandRunnable is removed; in its stead, Decode returns the number of cycles (which only matters for "sync" GPU mode), or 0 if there was not enough data, and is also responsible for unknown opcode alerts. Decode and DecodeSemiNop are almost identical, so the latter is replaced with a skipped_frame parameter to Decode. Doesn't mean we can't improve skipped_frame mode to do less work; if, at such a point, branching on it has too much overhead (it certainly won't now), it can always be changed to a template parameter. - FifoCommandRunnable used a fixed, large cycle count for display lists, regardless of the contents. Presumably the actual hardware's processing time is mostly the processing time of whatever commands are in the list, and with this change InterpretDisplayList can just return the list's cycle count to be added to the total. (Since the calculation for this is part of Decode, it didn't seem easy to split this change up.) To facilitate this, Decode also gains an explicit 'end' parameter in lieu of FifoCommandRunnable's call to GetVideoBufferEndPtr, which can point to there or to the end of a display list (or elsewhere in gpu-determinism, but that's another story). Also, as a small optimization, InterpretDisplayList now calls OpcodeDecoder_Run rather than having its own Decode loop, to allow Decode to be inlined (haven't checked whether this actually happens though). skipped_frame mode still does not traverse display lists and uses the old fake value of 45 cycles. degasus has suggested that this hack is not essential for performance and can be removed, but I want to separate any potential performance impact of that from this commit.
2014-08-16VertexLoader: cache NativeVertexFormatdegasus
This fix a performance regression of PR #672.
2014-08-04VertexLoader: do not prepare for vertices if we need to skip themPierre Bourdon
2014-08-02VertexLoader: Remove more global state dependencies (this time ↵Pierre Bourdon
IndexGenerator and VertexManager)
2014-07-26VertexLoader: Remove global state dependency on g_nativeVertexFmtPierre Bourdon
2014-07-24VertexLoader: take the VAT object directly for RunVerticesPierre Bourdon
2014-07-24VertexLoaderUID: remove global state dependencyPierre Bourdon
2014-07-04VideoCommon: Cache native vertex formatsdegasus
We are used to have a 1:1 mapping of GX vertex formats and the native (OGL + D3D) ones, but there are by far more GX ones. This new cache maps them directly so that we don't flush on GX vertex format changes as long as the native one doesn't change. The idea is stolen from galop1n.
2014-05-16remove unused and unexported functiondegasus
2014-03-09clang-modernize -use-nullptrTillmann Karras
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
2014-02-18Convert all includes to relative paths.Lioncash