Commit Graph

3546 Commits

Author SHA1 Message Date
de632fc9c8 Renderer: Handle resize events on-demand instead of polling
We now differentiate between a resize event and surface change/destroyed
event, reducing the overhead for resizes in the Vulkan backend. It is
also now now safe to change the surface multiple times if the video thread
is lagging behind.
2018-02-20 01:15:55 +10:00
c1b39ecc58 BPFunctions: Move upscaling of scissor rect to VideoCommon 2018-02-20 00:49:32 +10:00
5359396099 BPFunctions: Move GX viewport conversion to VideoCommon 2018-02-20 00:49:32 +10:00
340ee8fff8 PixelShaderGen: Implement table-based fog range as in software renderer 2018-02-15 22:19:21 +10:00
93fb0e1e1c TextureCache: Add an option to disable EFB copies to VRAM
The option is named DisableCopyToVRAM under the Hacks section in
GFX.ini. It is intentionally not exposed to the GUI, as users should not
need to use it under normal circumstances. The main use is debugging
issues in the EFB-to-RAM shaders.
2018-02-11 15:48:46 +10:00
84b990faa0 VideoConfig: Remove bForceCopyToRam field
It's the inverse of supports-copy-to-vram.
2018-02-11 15:29:37 +10:00
096131c908 Merge pull request #6334 from stenzek/startup
Video Backend Initialization/Core Boot Improvements
2018-02-07 23:35:54 -08:00
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
fe5150cc31 Merge pull request #6303 from TraceBullet/auto-adjust-window-size
Fix Auto-Adjust Window Size option making the window too large
2018-01-29 17:28:44 +10:00
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
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
ab6f932347 Fix Auto-Adjust Window Size option making the window too large 2018-01-26 10:47:19 -05:00
3f197480ef Renderer: Fix crash on shutdown when frame dumping or taking screenshots 2018-01-26 12:12:00 +10:00
81ae88d2d5 AbstractTexture: Fix crash in Vulkan backend when freeing texture 2018-01-26 19:12:11 +10:00
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
a5a0599145 CustomTexture: Drop old texture format. 2018-01-20 17:08:47 +01:00
0b466249e0 CustomTextures: Drop format convertion. 2018-01-20 16:39:04 +01:00
2441fd28d5 AVIDump: Remove incorrect usage of s_ prefix 2018-01-17 22:19:14 +01:00
e02025b45e Merge pull request #6307 from rukai/fix-frame-dump-path
Handle framedump path not existing
2018-01-17 22:02:51 +01:00
6c7e6016fb Handle framedump path not existing 2018-01-18 07:53:30 +11:00
cb7eede193 VideoCommon: Apply custom texture scale for arbitrary mipmaps.
We want to get the same mipmap level. And if the IR and the custom
texture upscaling fits, we don't need to modify the LOD bias.
2018-01-17 09:02:36 +01:00
2a43f41ace Merge pull request #6297 from JosJuice/custom-texture-arb-filename
Treat custom textures with "_arb" suffix as having arbitrary mipmaps
2018-01-15 09:58:30 +01:00
b93ae14272 Merge pull request #6300 from JonnyH/WIP/glsl-es-implicit-int-float-conversions-in-gpu-texture-decode
GLSL-ES doesn't allow implicit int/uint conversions
2018-01-11 22:22:05 +01:00
46254a2cf2 Some more implicit uint/float conversions in the texture decode shaders 2018-01-11 11:15:40 -08:00
f23dd992dd GLSL-ES doesn't allow implicit int/uint conversions 2018-01-11 10:54:55 -08:00
226b65bd38 Clean up variable naming in HiresTextures::Update 2018-01-10 17:53:51 +01:00
c25fffc9a0 Treat custom textures with "_arb" suffix as having arbitrary mipmaps
This is adapted from Bighead's code that was posted at
https://forums.dolphin-emu.org/Thread-dolphin-custom-texture-mipmaps?pid=460867#pid460867

In master, custom textures are never treated as having arbitrary mipmaps,
so we need either a change like this or a change that makes us apply the
arbitrary mipmap heuristic even when a custom texture is used.
2018-01-10 17:51:45 +01:00
22f469697b Merge pull request #6290 from JosJuice/invalid-aspect-ratio
Treat invalid aspect ratio setting values as Auto
2018-01-08 13:46:30 +01:00
1557e6ab05 Specify underlying types for enums that get casted from integers
Otherwise we might get UB if the value we cast is larger than the
max value of the underlying type that the compiled picked for the enum.

I haven't done any extensive check through Dolphin to find cases
of this, I'm just fixing the cases I already know of.
2018-01-08 12:14:18 +01:00
a2404c42a1 Treat invalid aspect ratio setting values as Auto 2018-01-06 12:53:53 +01:00
56d153f548 VideoCommon: Apply the yscale as upscaling of the XFB. 2018-01-06 10:36:33 +01:00
ceb1f8c8cb Enable shader_framebuffer_fetch blend path on ubershaders
Tested on a linux Intel Skylake integrated graphics with
blend_func_extended force-disabled, as it's the only platform I have
that doesn't crash with ubershaders and supports fb_fetch
2018-01-05 09:56:46 -08:00
8d68adcaf3 Workaround qualcomm driver bug
It seems it doesn't like modifying inout variables in place - so instead
use a temporary for ocol0/ocol1 and only write them once at the end of
the shader
2018-01-05 09:56:46 -08:00
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
330881ae80 Allow users to specify the encoder used for framedumping. 2018-01-03 13:23:10 +01:00
44935c23e0 MAX_XFB_HEIGHT: PAL value off by two fixed 2017-12-30 20:22:10 +01:00
50d96a4411 BPStructs: Use static cast for XFB/EFB copies 2017-12-21 21:19:26 -06:00
e1332b1d7e Texture Cache Base: Move PAL vertical scaling to be baked into the texture size. This saves on a number of multiplications and fixes an issue where we were multiplying the y-scaling factor by the srcRectangle's height + 1 which was causing a crash in some GC titles 2017-12-21 21:19:26 -06:00
a3355a3e4a Only use the "Scaled EFB Copy" setting for EFB, not XFB
The hybrid XFB PR made it apply to both EFB copies and XFB copies.
2017-12-19 12:59:36 +01:00
d9c2de90c0 Reimplement EFB copy for intensity formats
This is the direct continuation of #5887, and removes the last usage of
the colmat matrix in EFB copy conversion shaders.
2017-12-19 12:04:56 +01:00
0bf24f549a Merge pull request #6190 from JosJuice/is-trivially-copyable-vs
Remove IsTriviallyCopyable hack for VS
2017-12-19 11:15:58 +01:00
5afd07c033 Merge pull request #6254 from iwubcode/frame_counter_and_advance_fix
Video Common: frame logic fix
2017-12-19 09:44:49 +01:00
4973ae9952 Rename GFX_HACK_COPY_EFB_ENABLED to GFX_HACK_COPY_EFB_SCALED
Not sure why it was named like this... It doesn't affect whether
the copy happens or not, only what resolution it uses.
2017-12-18 21:55:02 +01:00
2f7eacd08c Video Common: move frame advance and counter logic to only happen when we actually render a frame. 2017-12-15 12:46:18 -06:00
a38103afbf Fix GLES GPU texture conversion shader
GLES doesn't support C-style array initialisers, so stuff like:

Type var[2] = {
VALUE_A,
VALUE_B
};

isn't supported in GLES (it was added in
GL_ARB_shading_language_420pack).

The texture conversion shader used this, so would fail to compile on
GLES.
2017-12-12 22:01:10 +00:00
a70c03a1c0 Merge pull request #6249 from stenzek/texture-dump
Texture dumping regression fixes
2017-12-11 08:44:09 +01:00
e401004766 Fix an invalid (uint < int) comparison in GLES with ubershaders 2017-12-10 10:52:32 -08:00
2579f8eaa5 TextureCache: Don't dump custom textures
They don't have a basename, therefore were being saved to empty files, and potentially can be compressed.
2017-12-10 15:31:46 +10:00
ecf30cfc74 Merge pull request #6240 from JosJuice/stream-path-encoding
Don't use wrong encoding for paths when opening streams on Windows
2017-12-07 10:04:55 +01:00
02dd062518 VideoCommon: Drop now unused efb2tex matrix generation. 2017-12-06 09:30:03 +01:00