Commit Graph

2071 Commits

Author SHA1 Message Date
Jasper St. Pierre 0b7bed4a52 TextureDecoder: Simplify how the reference texture decoder works
Instead of having three separate functions and checking the tlutfmt in a
variety of places, just do it once in a helper method. This is already
for the slow path either in our Generic decoder or in our Software
renderer, so it doesn't matter that this is slower.

x64 will continue using the separate functions for speed.
2014-09-04 18:36:57 -07: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 32da01edec TextureDecoder: Rearrange header slightly
Put the two Decode APIs together.
2014-09-04 18:36:56 -07:00
Jasper St. Pierre f975307016 TextureDecoder: Add some statics to some of our helper functions
I know these are already inline, but this makes it more clear that
they're helper functions to be used in this file only.
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
Jasper St. Pierre 9438a30384 VideoCommon: Start putting common texture decoding code in TextureDecoder_Common
This pulls all the duplicate code from TextureDecoder_Generic /
TextureDecoder_x64 out and puts it in a common file. Out custom font
used for debugging the texture cache is also pulled out and put in a
common "sfont.inc" file. At some point we should also combine this font
with the other six binary fonts we ship.
2014-09-04 18:36:53 -07:00
Jasper St. Pierre bfb2c04ace TextureDecoder: Remove unused function
GetPC_TexFormat was never used. It was added in commit d02426a, with the
only user being commented out code. The commented out code was later
removed in 9893122, but the implementation stayed.
2014-09-04 17:32:06 -07:00
Jasper St. Pierre 6682a2fadd TextureDecoder: Fix a RGBA/BGRA copy/paste typo
We were decoding to BGRA32 textures in our RGBA32 texture decoder. Since
this is the same for the BGRA32 decoder implementation, this is most
likely a copy/paste typo, rather than the texture actually being
bit-swapped. Fix this.

I'm not sure of any games that use the C14X2 texture format, so I'm not
sure this fixes any games, but it does make the code cleaner for when we
clean it up in the future, and merge some of these similar loops.
2014-09-04 17:30:53 -07:00
Jasper St. Pierre a5297f6da8 PixelEngine: Remove unused AllowIdleSkipping and all references to it 2014-09-04 17:25:59 -07:00
Yuriy O'Donnell d8d9bc8c6c Render: Implemented simple render target pool
This avoids creating and destroying render targets every frame,
which is a significant CPU overhead.

Old render targets are destroyed after 3 frames.
2014-09-04 22:21:06 +02:00
Dolphin Bot 830a03c540 Merge pull request #957 from degasus/frame_skipping
VideoCommon: rewrite frame skipping code
2014-09-04 18:27:19 +02:00
degasus 8b84ddce9a VideoCommon: rewrite frame skipping code 2014-09-04 18:07:39 +02:00
degasus ef6f6a7fa9 VideoCommon: remove XFReg copy optimization
This code is just ugly and I doubt there is a way that copying twice is faster.
2014-09-04 17:56:17 +02:00
comex dd5be7c0dc Merge pull request #924 from comex/fifo-command-runnable
Refactor opcode decoding a bit to kill FifoCommandRunnable.
2014-09-02 23:27:30 -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
comex 608f9bcd67 Refactor opcode decoding a bit to kill FifoCommandRunnable.
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-09-01 14:35:23 -04: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 4af8d9d248 VideoCommon: Clean up brace placements 2014-08-30 18:06:45 -04:00
Lioncash 1d706b2311 Get rid of C-style empty function parameter indicators 2014-08-30 15:23:48 -04:00
comex a4a533e39f Re-enable the vertex loader JIT on OS X.
Why was it ever disabled?
2014-08-27 23:50:59 -04: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 45a4236283 A tiny restructuring to allow inlining of FifoCommandRunnable. Probably useless. 2014-08-26 12:43:39 -04:00
comex 14125cf951 Refactor SetCpStatus into two functions for from-GPU and from-CPU mode rather than a boolean parameter.
This shouldn't affect functionality.  I'm not sure if the breakpoint
distinction is actually necessary (my commit messages from the old
dc-netplay last year claim that breakpoints are broken anyway, but I
don't remember why), but I don't actually need to change this part of
the code (yet), so I'll stick with the trimmings change for now.
2014-08-26 12:43:39 -04:00
Tillmann Karras 07c7e6f35e CommandProcessor: mark some functions as static 2014-08-25 21:09:42 +02:00
Pierre Bourdon bf93920c05 Revert "Catch broken configurations inside of the Post Processing shaders." 2014-08-25 14:33:41 +02:00
Dolphin Bot 2f2f992bc7 Merge pull request #828 from Sonicadvance1/pp-shader-catch-broken-config
Catch broken configurations inside of the Post Processing shaders.
2014-08-25 09:17:30 +02:00
Shawn Hoffman 327d35377d windows: remove now-extraneous NOMINMAX and WIN32_LEAN_AND_MEAN #defines from dolphin code.
Wrap dinput.h in a header defining DIRECTINPUT_VERSION instead of repeating it multiple places.
2014-08-23 10:48:48 -07:00
Lioncash f17dcd2019 Merge pull request #764 from magcius/new-nogui-2
Rewrite GLInterface
2014-08-21 14:14:54 -04:00
Shawn Hoffman 4bf031c064 msvc: resolve all warnings in VideoCommon. 2014-08-19 22:33:46 -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 7d90a00bbe Qualcomm fixed screen rotation in their latest v66 development drivers.
The framebuffer is no longer rotated the wrong way around in Qualcomm's latest development drivers.
They did something right, only took them over a year.
2014-08-18 00:17:09 -05:00
Ryan Houdek 2d624780c0 Catch broken configurations inside of the Post Processing shaders.
This catches most instances of configuration failures that can happen in a post processing shader.
Gives a user a helpful error message that lets them know what they have failed to set up correctly
2014-08-17 23:59:21 -05: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
Charles Rozhon 6f34a8ac47 Removed warnings by assigning to bool 2014-08-16 14:16:10 -05:00
degasus a64b0bf499 VertexLoader: cache NativeVertexFormat
This fix a performance regression of PR #672.
2014-08-16 12:58:52 +02: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 b8a21b3744 Add the PostProcessing class object to RenderBase in VideoCommon.
Backends will initialize this variable with their own inherited PostProcessing class object.
2014-08-13 01:05:14 -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
Jasper St. Pierre c54fef5496 VideoBackendBase: Remove unused stub Initialize implementation
Both D3D and OGL have their own overrides, so this isn't used.
2014-08-06 21:35:52 -04:00
Pierre Bourdon 16f180524c VertexLoader: do not prepare for vertices if we need to skip them 2014-08-04 20:47:02 -07:00
Pierre Bourdon 15920d0f10 Merge pull request #394 from degasus/d3d_lighting_fix
VideoCommon: normalize light direction
2014-08-03 21:21:23 -07:00
Pierre Bourdon 4c42b38de1 Merge pull request #428 from Sonicadvance1/x86_32-removal
Remove x86_32 support from Dolphin.
2014-08-03 21:17:28 -07:00
Ryan Houdek d9b5482840 Remove x86_32 from VertexLoader. 2014-08-03 13:44:37 -05:00
Pierre Bourdon 6f715a1fbe VertexLoader: Remove more global state dependencies (this time IndexGenerator and VertexManager) 2014-08-02 09:34:39 -07: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 3b5625c76b VideoConfig: Ignore Borderless Fullscreen setting when the backend does not support exclusive fullscreen.
This was expected to be handled by VerifyValidity(), but that only verifies the validity of the INI files.
2014-07-30 12:15:58 +02: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
Lioncash 522a5c35ad Convert some more header inclusions into forward declarations 2014-07-29 20:55:07 -04:00