Commit graph

584 commits

Author SHA1 Message Date
JosJuice
6eefc3c524 Make default graphics backend not show up as empty
Fixes https://bugs.dolphin-emu.org/issues/12245.

I considered making a change to DolphinQt instead of
the core, but then additional effort would've been
required to add the same fix to the Android GUI once
we start using the new config system there.
2020-09-06 12:56:45 +02:00
Shawn Hoffman
2f47f486af msbuild: re-enable standalone vcxproj processing 2020-08-22 16:17:50 -07:00
Shawn Hoffman
94bf48b67c msbuild: refactor stuff out of project files (for dolphin) 2020-08-22 16:17:50 -07:00
Filip Gawin
0ede5d1537 Use range loop (if possible) 2020-07-18 18:29:16 -05:00
Stenzek
bf74553878 FramebufferManager: Copy to color format for depth readbacks on GLES
glReadPixels() with depth formats is not supported.

Should fix broken EFB access on GLES.
2020-05-24 16:11:11 +10:00
Jun Su
81f8099cc6 Remove warnings of -Wsign-compare
Cast the variable to the coresponding type.
2020-03-25 07:57:14 +08:00
Stenzek
6fcb1c6c46 Add an ARM64 target to Visual Studio projects 2019-12-28 19:20:41 +10:00
Anthony
fdb78b64e1
Merge pull request #8513 from lioncash/bounding-box
VideoCommon/BoundingBox: Make interface for querying bounding box data
2019-12-07 18:40:02 -08:00
Lioncash
9bd533ebe4 VideoCommon/BoundingBox: Make interface for querying bounding box data
Rather than expose the bounding box members directly, we can instead
provide an interface for code to use. This makes it nicer to transition
from global data, as the interface function names are already in
place.
2019-12-05 11:48:42 -05:00
Lioncash
10f7674651 VideoCommon/IndexGenerator: Eliminate static state
Now that we've extracted all of the stateless functions that can be
hidden, it's time to make the index generator a regular class with
active data members.

This can just be a member that sits within the vertex manager base
class. By deglobalizing the state of the index generator we also get rid
of the wonky dual-initializing that was going on within the OpenGL
backend.

Since the renderer is always initialized before the vertex manager, we
now only call Init() once throughout the execution lifecycle.
2019-12-05 10:49:32 -05:00
Stenzek
dd23a1ee79 Update VS projects/solutions to VS2019 2019-11-30 13:42:52 +10:00
Silent
890f781cd0
Factorize software renderer backend switching warning to be fetched from a new GetWarningMessage in video backend - will be needed for DX11.1 feature set warnings 2019-07-26 19:39:07 +02:00
Lioncash
2b9389202e VideoCommon: Remove unused MathUtil.h include from VideoCommon.h
This header doesn't actually make use of MathUtil.h within itself, so
this can be removed. Many other source files used VideoCommon.h as an
indirect include to include MathUtil.h, so these includes can also be
adjusted.

While we're at it, we can also migrate valid inclusions of VideoCommon.h
into cpp files where it can feasibly be done to minimize propagating it
via other headers.
2019-07-16 20:54:34 -04:00
Lioncash
d4337eebde VideoCommon/Statistics: Rename stats global to g_stats
Makes the global variable follow our convention of prefixing g_ on
global variables to make it obvious in surrounding code that it's not a
local variable.
2019-07-10 23:34:54 -04:00
Lioncash
a99c7d01e1 VideoCommon/Statistics: Normalize statistic variable names
Normalizes all variables related to statistics so that they follow our
coding style.

These are relatively low traffic areas, so this modification isn't too
noisy.
2019-07-10 23:19:10 -04:00
Lioncash
04c06ec661 VideoCommon/Statistics: Use std::array for projection values
Makes the members within the interface much nicer to look at, and also
makes copying them over much nicer too.
2019-06-20 08:06:20 -04:00
Connor McLaughlin
951b66e4ac
Merge pull request #8049 from stenzek/crop
Renderer: Adjust source rectangle when crop would draw off screen
2019-06-08 20:57:52 +10:00
Lioncash
cd9281772a VideoSoftware/CMakeLists: Specify headers in target sources 2019-05-31 06:54:26 -04:00
Lioncash
e60268bd42 VideoCommon/RenderBase: Use a std::string_view with CreateShaderFromSource()
Greatly simplifies the overall interface when it comes to compiling
shaders. Also allows getting rid of a std::string overload of the same
name. Now std::string and const char* both go through the same function.
2019-05-30 03:29:35 -04:00
Techjar
ff972e3673 Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
Léo Lam
ab9ece9bca Replace MathUtil::Clamp with std::clamp 2019-05-04 23:12:17 +02:00
Léo Lam
99a4ca8de7
Merge pull request #7839 from ShFil119/impr/redundant
Remove redundant initialization
2019-05-04 22:50:51 +02:00
Filip Gawin
c110ffcdaa Remove redundant initialization 2019-04-30 01:22:24 +02:00
Stenzek
32359bf2bb Renderer: Adjust target rectangle in the base class 2019-04-28 23:33:24 +10:00
JosJuice
ced2306fc5 Turn EFB_WIDTH/EFB_HEIGHT into constexpr
https://bugs.dolphin-emu.org/issues/11692#note-5

Also change const into constexpr while we're at it.
2019-04-28 11:50:17 +02:00
Stenzek
f8c1ba409c Replace EFBRectangle/TargetRectangle with MathUtil::Rectangle 2019-04-21 14:28:14 +10:00
Stenzek
3791262d96 TextureCache: Use linear filtering on y-scaled and >1xIR VRAM copies 2019-04-21 12:41:15 +10:00
Stenzek
61a656570e AbstractPipeline: Support returning "cache data"
"Cache data" can be used to assist a driver with creating pipelines by
using previously-compiled shader ISA.
2019-04-16 00:09:47 +10:00
Stenzek
65216c9e87 VideoConfig: Add SupportsPartialDepthCopies to backend info
D3D11 doesn't support partial copies of depth buffers via
CopySubResource(), so we need to use a different path for the EFB cache.
2019-03-09 12:19:53 +10:00
Stenzek
f039149198 Move most backend functionality to VideoCommon 2019-02-19 16:57:54 +10:00
Stenzek
e4b205c769 Decouple XFB scanout from presentation 2019-01-25 11:15:57 +10:00
Stenzek
c9c0b85056 VideoBackends: Store a backbuffer 'scale'
This is a scaling factor, used for hi-dpi configurations.
2019-01-25 11:15:57 +10:00
Stenzek
63dd91628d Remove old RasterFont classes 2019-01-25 11:15:57 +10:00
Stenzek
600d1fc0bc Renderer: Use imgui for drawing debug text and OSD 2019-01-25 11:15:57 +10:00
Stenzek
7afd5cc2fb Use main buffers for utility draws 2018-12-04 17:37:25 +10:00
Stenzek
2644e920cc Renderer: Add backbuffer format to base class 2018-12-04 17:36:08 +10:00
Stenzek
1adcd47dcb Renderer: Add a base Initialize() method to match Shutdown() 2018-12-04 17:36:08 +10:00
Stenzek
8e2c063d62 TextureCache: Implement deferred/batched EFB copies 2018-11-07 16:25:01 +10:00
Pierre Bourdon
f1413dbbf6
Merge pull request #7501 from Techjar/class-memaccess-cleanup
VideoCommon: Clean up class-memaccess warnings
2018-10-28 23:59:51 +01:00
Stenzek
025e909773 GLContext: Use destructor instead of Shutdown() to cleanup
Also uses the Initialize() method to make the context current.
2018-10-20 21:11:34 +10:00
Stenzek
dcdd02d646 GLContext: Remove global context pointer 2018-10-20 21:11:34 +10:00
Stenzek
eb284b5d66 VideoBackends: Pass window system info from host on creation 2018-10-20 21:11:34 +10:00
Stenzek
9c57a98723 GLContext: Use host connection
This also removes the need for a sleeping event thread.
2018-10-20 21:11:34 +10:00
Stenzek
a3961750a7 Drop Host_GetRenderSurface and pass display to backend 2018-10-20 21:11:34 +10:00
Stenzek
134d967be2 Refactoring and cleanup of GLInterface (now GLContext) 2018-10-20 21:11:34 +10:00
Tillmann Karras
97cc9894e4 Update to Visual Studio's default Windows SDK 2018-10-20 00:53:08 +01:00
Techjar
8560eecd49 VideoCommon: Clean up class-memaccess warnings 2018-10-14 23:05:47 -04:00
Mat M
ecd4897d43
Merge pull request #7437 from stenzek/graphics-options-race
Fix race condition caused by opening graphics options while running
2018-10-12 10:29:28 -04:00
Tillmann Karras
56fdcf5f00 VideoCommon: remove unnecessary floor()
floatindex is clamped to the range [0, 9]. For non-negative numbers
floor() is equivalent to trunc(). Truncation happens implicitly when
converting to uint, so the floor() is unnecessary.
2018-10-09 00:31:43 +01:00
Tillmann Karras
a6a5d86cd8 VideoSoftware: make use of Clamp() 2018-10-05 22:07:38 +01:00
Stenzek
eb33d7af64 Core: Call InitBackendInfo before loading config 2018-09-28 21:44:41 +10:00
Techjar
dc2f22516c Mark all video backend names for translation 2018-06-30 06:30:19 -04:00
Lioncash
540bb1a1b0
Software: Don't link against X11 libraries
The software backend doesn't actually use X11 in any capacity directly.
2018-06-21 01:47:37 -04:00
Ryan Meredith
45b9b7d211 Give Dump Objects dedicated folder and tooltip 2018-06-06 08:42:41 -04:00
Stenzek
640bfb8135 VideoConfig: Add a field for indicating logic op support in the backend 2018-05-26 00:07:20 +10:00
Emmanuel Gil Peyrot
c51ae9c62a Remove SOIL altogether from the project. 2018-05-20 13:44:42 +02:00
Lioncash
505d45a233 EfbInterface: Move buffer constant from the header to the cpp file
This is only ever used internally, so we can limit its scope to the only
usage point.
2018-05-18 16:23:34 -04:00
Lioncash
5eef8ba984 EfbInterface: Make efb and perf_values std::arrays 2018-05-18 16:23:29 -04:00
Lioncash
c58b5e9b9b EfbInterface: Make perf_values internally linked
Instead, expose functions to operate with it. This way we keep the
internal representation concealed.
2018-05-18 15:35:08 -04:00
Lioncash
f3a8874214 EfbInterface: Move efb array into the EfbInterface namespace 2018-05-18 15:09:37 -04:00
Stenzek
9e798eec94 Implement EFB copy filter and gamma in hardware backends
Also makes y_scale a dynamic parameter for EFB copies, as it doesn't
make sense to keep it as part of the uid, otherwise we're generating
redundant shaders.
2018-04-29 19:05:20 +10:00
Scott Mansell
a192a3bb30 While I'm here, fix some chroma sub-sampling bugs.
RE4's brightness screen is actually very good for spotting these.

Bug 1: Colors at the end of the scanlines are clamped, instead of a black
       border
Bug 2: U and V color channels share coordinates, instead of being offset
       by a pixel.
2018-04-29 17:56:53 +10:00
Scott Mansell
fc96479f12 VideoSoftware: Implement xfb copy filter (Deflickering/Brightness) 2018-04-29 17:56:51 +10:00
spycrab
40bb9974f2 Reformat all the things! 2018-04-12 21:28:39 +02:00
Lioncash
8b43a31855
Software/CMakeLists: Migrate off add_dolphin_library
Continues the migration work started in 3a4c3bbe01
2018-04-02 08:24:40 -04:00
Lioncash
50a476c371 Assert: Uppercase assertion macros
Macros should be all upper-cased. This is also kind of a wart that's
been sticking out for quite a while now (we avoid prefixing
underscores).
2018-03-14 22:03:12 -04:00
Stenzek
51a586d11a GLUtil: Encapsulate functions in a namespace 2018-03-10 16:11:19 +10:00
Stenzek
f9c829c7f7 OGL: Re-implement async shader compiling 2018-03-10 15:56:34 +10:00
Stenzek
dec0c3bce8 Move shader caches to VideoCommon 2018-03-10 15:56:30 +10:00
Stenzek
4c24a69710 VideoCommon: Add support for Abstract Framebuffers 2018-03-02 20:20:48 +10:00
Stenzek
6374a4c4a8 AbstractTexture: Support multisampled abstract texture 2018-03-01 17:31:24 +10:00
Stenzek
fec6bb4d56 VideoBackends: Add AbstractShader and AbstractPipeline classes 2018-02-22 22:02:34 +10:00
Stenzek
84b990faa0 VideoConfig: Remove bForceCopyToRam field
It's the inverse of supports-copy-to-vram.
2018-02-11 15:29:37 +10:00
Anthony
096131c908
Merge pull request #6334 from stenzek/startup
Video Backend Initialization/Core Boot Improvements
2018-02-07 23:35:54 -08:00
Stenzek
260d5b7aa7 BPMemory: Handle fog configuration where both A and C are infinity/NaN
The console appears to behave against standard IEEE754 specification
here, in particular around how NaNs are handled. NaNs appear to have no
effect on the result, and are treated the same as positive or negative
infinity, based on the sign bit.

However, when the result would be NaN (inf - inf, or (-inf) - (-inf)),
this results in a completely fogged color, or unfogged color
respectively. We handle this by returning a constant zero for the A
varaible, and positive or negative infinity for C depending on the sign
bits of the A and C registers. This ensures that no NaN value is passed
to the GPU in the first place, and that the result of the fog
calculation cannot be NaN.
2018-02-01 17:40:39 +10:00
Stenzek
c790077c13 VideoBackend: Remove PeekMessages method
The video thread and backend no longer create any windows, therefore
there will never be any messages dispatched to their thread.
2018-01-27 13:53:55 +10:00
Stenzek
d96e8c9d76 VideoBackends: Combine Initialize/Prepare and Cleanup/Shutdown methods
Also allows the work previously done in Prepare to return a failure
status.
2018-01-27 13:53:55 +10:00
Stenzek
38e0b6e2ab AbstractTexture: Move Bind() method to Renderer
This makes state tracking simpler, and enables easier porting to command
lists later on.
2018-01-22 13:22:09 +10:00
Jonathan Hamilton
29a9ed043b Implement dual-source blending in shader
For some GLES drivers that don't support dual-source blending, but do
support GL_EXT_shader_framebuffer_fetch, this might be useful.
2018-01-05 09:56:46 -08:00
degasus
02dd062518 VideoCommon: Drop now unused efb2tex matrix generation. 2017-12-06 09:30:03 +01:00
Léo Lam
d95177526f VideoBackends: Fix -Wswitch warnings 2017-12-02 21:52:07 +01:00
Markus Wick
491c10ec96 VideoBackends: Use VideoCommon shader generators for efb2tex copies.
This will generate one shader per copy format. For now, it is the same
shader with the colmat hard coded. So it should already improve the GPU
performance a bit, but a rewrite of the shader generator is suggested.

Half of the patch is done by linkmauve1:
VideoCommon: Reorganise the shader writes.
2017-12-02 15:17:39 +01:00
Stenzek
cd68b3606c
Merge pull request #6193 from stenzek/readbacks
Abstract Staging Textures - VideoCommon interface for texture readbacks/uploads
2017-12-01 14:24:06 +10:00
Stenzek
32125cf181 OGL: Fix headless frame dumping
Also skips swapping the window system buffers in headless mode, as there
may not be a surface which can be swapped in the first place. Instead,
we call glFlush() at the end of a frame in this case.
2017-11-23 16:53:55 +10:00
Stenzek
db1d9de933 AbstractTexture: Drop slow map readback path 2017-11-22 18:49:33 +10:00
Stenzek
56afebeb44 AbstractTexture: Seperate CopyRectangleFromTexture to two methods
ScaleRectangleFromTexture, which does a draw, and
CopyRectangleFromTexture, which where possible, does a bit-for-bit copy.
2017-11-22 18:47:04 +10:00
Stenzek
f43d85921d VideoBackends: Add AbstractStagingTexture class
Can be used for asynchronous readback or upload of textures.
2017-11-22 18:47:04 +10:00
Stenzek
49a9c33bd7 VideoCommon: Move abstract texture creation function to Renderer 2017-11-22 18:47:04 +10:00
Leo Lam
73a67aa413
Merge pull request #6204 from stenzek/downscaled-screenshots
Frame Dumping: Fix window-size framedumping
2017-11-22 07:53:23 +01:00
Stenzek
efb9759862 LightingShaderGen: Always calculate lighting for both color channels
Cel-damage uses the color from the lighting stage of the vertex pipeline
as texture coordinates, but sets numColorChans to zero.

We now calculate the colors in all cases, but override the color before
writing it from the vertex shader if numColorChans is set to a lower value.
2017-11-22 01:52:18 +10:00
Stenzek
39559f6358 VideoConfig: Remove bSupportsInternalResolutionFrameDumps
Field is unused as of Hybrid XFB.
2017-11-21 17:19:43 +10:00
Lioncash
364eaadfe5 VideoBackends: Remove header inclusions made unnecessary with Hybrid XFB
Just some inclusions that weren't removed in the initial Hybrid XFB PR.
2017-11-19 00:53:10 -05:00
iwubcode
bf7db3f888 Software Backend: Remove reinterpret_cast which violates the strict aliasing rule 2017-11-17 22:11:33 -06:00
iwubcode
1a1c3560ce Software Backend: Rename 'copy_region' to 'CopyRegion' 2017-11-17 22:11:33 -06:00
iwubcode
0f7f4ccaf9 Software Backend: allow screenshots/video to be taken with valid data 2017-11-17 22:11:33 -06:00
iwubcode
7248dd47d5 Hybrid XFB: Fix lint errors 2017-11-17 22:11:32 -06:00
iwubcode
4964fc87ae Video Backends: Remove the right of the xfb region for games where the
VI stride does not match the VI width
2017-11-17 22:11:32 -06:00
iwubcode
53684701fa HybridXFB: Fix lint errors 2017-11-17 22:11:31 -06:00
iwubcode
1090549552 Software Backend: Force EFB/XFB to copy to ram 2017-11-17 22:11:31 -06:00
iwubcode
6e686f6ea1 Software Backend: Fix xfb output and add vertical scaling support 2017-11-17 22:11:31 -06:00
iwubcode
4d13f69dc1 Remove TODOs 2017-11-17 22:11:29 -06:00
iwubcode
a9f0d1783b Support frame and video dumping from VideoCommon 2017-11-17 22:11:23 -06:00
iwubcode
79387dddb2 Add support for hybrid XFB 2017-11-17 19:47:56 -06:00
Lioncash
343bde2712 Software/TextureSampler: const correctness 2017-09-11 20:13:47 -04:00
Stenzek
836b9b9acb Renderer: Move cull mode to a rasterization state object
Also moves logic for primitive handling to VideoCommon.
2017-09-11 20:01:45 +10:00
Markus Wick
432117047b Merge pull request #6045 from lioncash/sw-vertloader
SWVertexLoader: Minor cleanup
2017-09-10 11:23:25 +02:00
Lioncash
696e1b40b5 Common: Move version strings to their own header
Ideally Common.h wouldn't be a header in the Common library, and instead be renamed to something else, like PlatformCompatibility.h or something, but even then, there's still some things in the header that don't really fall under that label

This moves the version strings out to their own version header that doesn't dump a bunch of other unrelated things into scope, like what Common.h was doing.

This also places them into the Common namespace, as opposed to letting them sit in the global namespace.
2017-09-09 19:28:10 -04:00
Lioncash
46579fe41c SWVertexLoader: Make SWVertexLoader a final class
It doesn't make sense to allow extending this class based off the way
the VertexLoader API is set up.
2017-09-09 15:33:30 -04:00
Lioncash
dd8b41326c SWVertexLoader: Make SetFormat() and ResetBuffer() private
SetFormat() is only ever used internally. ResetBuffer() is only
used to implement the VertexManagerBase class interface, so
there's no need to make it protected.
2017-09-09 15:33:30 -04:00
Lioncash
29a362be43 SWVertexLoader: Remove GetIndexBuffer()
It's only ever used in one place internally and is arguably unnecessary.
2017-09-09 15:33:22 -04:00
Lioncash
4d2a4924cb SWVertexLoader: Normalize class variable names
Follows our coding style.
2017-09-09 15:32:41 -04:00
Lioncash
baee3a9c74 Software/Tev: const correctness 2017-09-03 14:15:21 -04:00
Lioncash
bc57ab3923 Clipper: Copy both color sequences in CopyVertex as opposed to one
This is likely an oversight.
2017-08-22 22:45:28 -04:00
Lioncash
ffaa9a3bea SW NativeVertexFormat: Utilize std::array where applicable
Gets rid of some hardcoded looping bounds, and also simplifies code in
some places, sometimes allowing for removal of a loop altogether.
2017-08-22 22:39:28 -04:00
Lioncash
745f92b4e5 TransformUnit: Get rid of pointer casting in TransformColor() where applicable
The casts to u32* are technically undefined behavior. The u8* cast is
left, as char/unsigned char is exempted from this rule to allow for
bvtewise inspection of objects (and this is what s8/u8 are typedefs of
on platforms we support).
2017-08-06 19:04:31 -04:00
Lioncash
4d35a3105e TransformUnit: Make LightColor()'s chan parameter const
Also marks references/pointers const where applicable
2017-08-06 18:15:05 -04:00
degasus
cc4b3b180b VideoSW: Drop log level of missing anti aliasing support.
We don't want to emit such a high priority warning here, else fifoci will die.
2017-08-05 19:20:19 +02:00
N.E.C
c3a57bbad5 Video: Clearly separate Texture and EFB Copy formats
Improve bookkeeping around formats. Hopefully make code less confusing.

- Rename TlutFormat -> TLUTFormat to follow conventions.
- Use enum classes to prevent using a Texture format where an EFB Copy format
  is expected or vice-versa.
- Use common EFBCopyFormat names regardless of depth and YUV configurations.
2017-08-03 18:35:29 -07:00
Stenzek
63305e9173 HiresTextures: Support loading BC7 (BPTC) from DDS files 2017-08-01 11:59:38 +10:00
Lioncash
f6c21e002b General: Remove unnecessary semicolons 2017-07-30 16:39:53 -04:00
Stenzek
25338c53e0 NativeVertexFormat: Drop unused virtual method SetupVertexPointers 2017-07-30 17:43:59 +10:00
Stenzek
f48ef65bec XFMemory: Convert several registers to bitfields 2017-07-30 17:43:59 +10:00
Scott Mansell
479abde9f4 BPMemory: Convert a number of unions to BitFields 2017-07-30 17:43:59 +10:00
Lioncash
07cddf6f7f AbstractTexture: Add missing includes (and remove unnecessary ones) 2017-06-18 23:29:22 -04:00
iwubcode
2cdc93f4ab Video Backends: Split texture cache code out into separate files, introduce 'AbstractTexture' 2017-06-13 00:41:51 -05:00
MerryMage
a0b41c83e7 VideoConfig: Remove bRunning
Value was set but not used.
2017-06-11 15:06:12 +01:00
MerryMage
f5f45855f0 GameConfigLoader: Add GFX Game INI translations 2017-06-03 18:13:02 +01:00
BhaaL
072c161445 upgrade to Windows SDK 10.0.15063.0
this is required for /permissive- to work, because some headers in the
Windows SDK use Microsoft extensions that are not allowed in standards mode
2017-05-28 13:37:31 +02:00
Pierre Bourdon
d592bdd4d4 Migrate to Visual Studio 2017.
Auto-generated by the IDE, I'll trust it knows what it's doing.
2017-05-25 15:58:59 -07:00
Stenzek
f4b848949c TextureCache: Support compressed textures and pass pitch/size to upload
This also removes an extra copy of the image for custom textures.
2017-04-29 00:14:23 +10:00
Stenzek
bc8a96d713 HiresTextures: Support parsing DDS files directly
This leaves DDS textures using DXT1/3/5 compressed in-memory, which can
be passed directly to the backend.
2017-04-29 00:14:23 +10:00
Stenzek
e9850aa0f2 VideoBackends: Support updated texture encoding shader generators 2017-04-12 00:11:22 +10:00
Stenzek
82fd984f3e VideoBackends: Add configuration field for GPU texture decoding 2017-04-01 12:32:05 +10:00
Stenzek
b987f220e1 VideoBackends: Add support flag for compute shaders 2017-04-01 12:31:41 +10:00
Jules Blok
0a2b58c896 OGL: Remove support for NV_depth_buffer_float.
We can't clamp the depth values to the 24-bit range while this extension is active.
2017-03-14 01:02:13 +01:00
Markus Wick
e99cd57eb3 Merge pull request #4935 from Armada651/depth-range-fix
VideoBackends: Set the maximum range when the depth range is oversized.
2017-03-10 18:05:52 +01:00
Stenzek
2cd240af0d VideoBackends: Move max texture size to VideoConfig
This stops the virtual method call from within the Renderer constructor.

The initialization here for GL had to be moved to VideoBackend, as the
Renderer constructor will not have been executed before the value is
required.
2017-03-10 00:04:13 +10:00
Markus Wick
489d90b6f3 Merge pull request #4999 from stenzek/renderer-statics
VideoCommon: Eliminate static state in Renderer
2017-03-08 11:02:20 +01:00
Stenzek
00a0a91513 VideoCommon: Move last EFB scale handling to CalculateTargetSize 2017-03-04 16:53:07 +10:00
Stenzek
238a70b006 VideoCommon: Move some common initialization logic to RenderBase 2017-03-04 16:42:16 +10:00
Lioncash
552c0d8404 Common: Move byte swapping utilities into their own header
This moves all the byte swapping utilities into a header named Swap.h.

A dedicated header is much more preferable here due to the size of the
code itself. In general usage throughout the codebase, CommonFuncs.h was
generally only included for these functions anyway. These being in their
own header avoids dumping the lesser used utilities into scope. As well
as providing a localized area for more utilities related to byte
swapping in the future (should they be needed). This also makes it nicer
to identify which files depend on the byte swapping utilities in
particular.

Since this is a completely new header, moving the code uncovered a few
indirect includes, as well as making some other inclusions unnecessary.
2017-03-03 17:18:18 -05:00
Lioncash
ee61bd6f2e CMakeLists: Normalize whitespace
Normalizes tabs to spaces to follow our codebase's indentation style.
2017-03-01 14:53:23 -05:00
Jules Blok
94522d4cf3 OGL: Add support for glDepthRangedNV to handle oversized depth ranges. 2017-02-24 14:54:16 +01:00
Lioncash
1fa81f24d3 VertexManagerBase: Make CreateNativeVertexFormat return a unique_ptr
Much safer as opposed to just returning raw allocated memory.
2017-02-18 03:16:24 -05:00
Lioncash
d9d069e024 OpcodeDecoding: Convert #defines into enum constants
Gets several constants out of global scope.
2017-02-08 00:05:17 -05:00
Lioncash
c85e0a2586 FramebufferManagerBase: Return a std::pair from GetTargetSize
Keeps associated data together. It also eliminates the possibility of out
parameters not being initialized properly. For example, consider the
following example:

-- some FramebufferManager implementation --

void FBMgrImpl::GetTargetSize(u32* width, u32* height) override
{
  // Do nothing
}

-- somewhere else where the function is used --

u32 width, height;
framebuffer_manager_instance->GetTargetSize(&width, &height);

if (texture_width != width) <-- Uninitialized variable usage
{
  ...
}

It makes it much more obvious to spot any initialization issues, because
it requires something to be returned, as opposed to allowing an
implementation to just not do anything.
2017-02-03 15:27:53 -05:00
Lioncash
70cf774a5c RenderBase: Forward declare EFBAccessType 2017-01-23 12:41:26 -05:00
Lioncash
5b461f50af VideoBackendBase: Convert EFBAccessType into an enum class 2017-01-23 03:53:38 -05:00
degasus
f12460d1f4 VideoSW: Fix GL ES shader. 2017-01-07 12:32:15 +01:00
degasus
41b0c74e30 VideoCommon: Make dst_alpha state implicit. 2017-01-04 20:02:31 +01:00