Commit graph

1181 commits

Author SHA1 Message Date
Stenzek
6bfe4c83a5 OGL: Fix broken stereoscopy geometry shader for EFB copies 2019-01-19 23:22:57 +10:00
zackhow
078fc74b54 Android/OGL: fix bounding box for OpenGL-ES
OpenGL-ES does not have glGetBufferSubData, so use glMapBufferRange instead
2019-01-09 21:08:49 -05:00
weihuoya
66a7db3850 Always flush on swap 2019-01-08 18:28:59 +08: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
7efdd1070b OGL: Fix crash when opening graphics window on another backend 2018-11-07 21:20:12 +10:00
Stenzek
8e2c063d62 TextureCache: Implement deferred/batched EFB copies 2018-11-07 16:25:01 +10:00
Stenzek
0559311f92 GLContext: Runtime selection of EGL/GLX on Linux 2018-10-20 21:11:34 +10: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
1d827a5223 Renderer: Pull dimensions from GLInterface/Swapchain 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
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
Stenzek
2e905455b1 OGL: Disable scissor test when calling glBlitFramebuffer()
glBlitFramebuffer() does not bypass the scissor test, which meant that
part of texture copies (e.g. XFB) could have been clipped when running
under OpenGL ES, as glCopyImageSubData() is not supported.
2018-10-09 22:00:40 +10:00
Stenzek
eb33d7af64 Core: Call InitBackendInfo before loading config 2018-09-28 21:44:41 +10:00
spycrab
392df8a11d GL/TextureCache: Clean up inline shader code 2018-08-30 16:05:39 +02:00
Stenzek
b30342d38f VideoBackends: Support D24S8 abstract texture format 2018-07-19 21:47:42 +10:00
Techjar
dc2f22516c Mark all video backend names for translation 2018-06-30 06:30:19 -04:00
Anthony
36ff2a20d5
Merge pull request #6954 from degasus/coherent
OGL/Streambuffer: Use coherent mapping by default.
2018-06-05 12:06:17 -07:00
Stenzek
640bfb8135 VideoConfig: Add a field for indicating logic op support in the backend 2018-05-26 00:07:20 +10:00
degasus
fdfd8b19d6 OGL/Streambuffer: Use coherent mapping by default.
Coherent mappings have a lower overhead and less GL codes.
So enables coherent mapping by default for all drivers.
Both Qualcomm and ARM performs very bad with explicit flushing, so this change helps them as well.

AFAIK there was one GPU generation which was slower on coherent mapping: nvidia tesla
So Geforce 200 and 300 series should be tested with this PR before merging.
As this was last tested many years ago, this issue might have been fixed as well.
Those GPUs are close to 10 years old and not supported any more by nvidia.
2018-05-24 00:00:02 +02:00
Stenzek
d0c025bf0b OGL: Fix EFB access in MSAA-mode 2018-05-22 15:35:20 +10:00
Stenzek
f74dbc794c EFB2RAM: Apply copy filter as a float coefficient after sampling
Using 8-bit integer math here lead to precision loss for depth copies,
which broke various effects in games, e.g. lens flare in MK:DD.

It's unlikely the console implements this as a floating-point multiply
(fixed-point perhaps), but since we have the float round trip in our
EFB2RAM shaders anyway, it's not going to make things any worse. If we
do rewrite our shaders to use integer math completely, then it might be
worth switching this conversion back to integers.

However, the range of the values (format) should be known, or we should
expand all values out to 24-bits first.
2018-05-22 12:24:08 +10:00
Emmanuel Gil Peyrot
c51ae9c62a Remove SOIL altogether from the project. 2018-05-20 13:44:42 +02:00
Markus Wick
c485efdfe1
Merge pull request #6743 from stenzek/faster-disabled-copy-filter
TextureConversionShader: Don't sample from adjacent rows when not needed
2018-05-17 10:45:50 +02:00
Léo Lam
f91b729b61
Merge pull request #6825 from leoetlino/onion-types
Config: Fix implicit conversions/enum config types
2018-05-12 21:59:43 +02:00
Score_Under
4e7caa2818 Fix syntax error in GLSL_GS 2018-05-12 15:42:18 +01:00
Score_Under
70b00f2b2d Remove stray quote sign
This allows GLSL_EFB_POKE_GEOMETRY_GS to compile again.
2018-05-12 15:21:29 +01:00
Léo Lam
7dca7c237e Config: Fix template deduction for implicit conversions
This excludes the second argument from template deduction.

Otherwise, it is required to manually cast the second argument to
the ConfigInfo type (because implicit conversions won't work).

e.g. to set the value for a ConfigInfo<std::string> from a string
literal, you'd need a ugly `std::string("yourstring")`.
2018-05-12 14:30:18 +02:00
Lioncash
ba01f6dba3 CommonFuncs: Convert ROUND_UP_POW2 macro to a function
Also move it to MathUtils where it belongs with the rest of the
power-of-two functions. This gets rid of pollution of the current scope
of any translation unit with b<value> macros that aren't intended to be
used directly.
2018-05-10 19:42:20 -04:00
Stenzek
501b35bbf2 OGL: Fix broken format changes in i965 driver 2018-05-08 00:11:27 +10:00
Markus Wick
e31c571f51
Merge pull request #6646 from spycrab/fbm_strings
OGL/FramebufferManager: Clean up inline GLSL code
2018-05-07 08:58:56 +02:00
Stenzek
286d594f32 OGL: Fix incorrect clamping in EFB copies 2018-05-05 17:45:54 +10:00
Stenzek
4faac3a627 TextureConversionShader: Don't sample from adjacent rows when not needed 2018-05-03 14:09:32 +10:00
spycrab
b4dc658b2e OGL/FramebufferManager: Clean up inline GLSL code 2018-05-01 15:03:59 +02: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
Tillmann Karras
4cfd900c67 Fix some warnings 2018-04-17 14:10:05 +01:00
spycrab
40bb9974f2 Reformat all the things! 2018-04-12 21:28:39 +02:00
Markus Wick
c6d0d9a01f
Merge pull request #6578 from JosJuice/remove-projection-hacks
Remove support for projection hacks
2018-04-04 09:10:32 +02:00
Lioncash
a3c53ff754
OGL/CMakeLists: Migrate off add_dolphin_library
Continues the migration work started in 3a4c3bbe01
2018-04-02 08:22:39 -04:00
JosJuice
91732e2baf Remove support for projection hacks
This isn't really useful for anything anymore as far as I know.
2018-04-01 21:41:18 +02:00
Lioncash
882d1c1256 OGLShader: Ensure m_id and m_compute_program_id are always initialized
Depending on which constructor is invoked, m_id or m_compute_program_id
can end up in an uninitialized state. We should ensure that the object
is completely initialized to something deterministic regardless of the
constructor taken.
2018-03-16 17:49:34 -04:00
Lioncash
83f17ac59f OGLShader: Fix mismatched assignment in compute shader constructor
This shouldn't be assigning to the regular ID.
2018-03-16 17:44:23 -04:00
Lioncash
75f5fcdfee Assert: Remove unused parameter from DEBUG_ASSERT
This brings the macro in line with the regular ASSERT macro, which only has one
macro parameter.
2018-03-16 13:01:11 -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
dc9012ae08 OGL: Ensure VAO is active before unmapping buffers
Fixes a crash which could occur in platforms which do not support
buffer_storage, and EFB2RAM is enabled (which indirectly uses the
attributeless buffer).
2018-03-15 00:32:39 +10:00
degasus
a5c0739fab OGL: Scale OSD text on big screens. 2018-03-12 20:38:06 +01:00
degasus
d4449971c9 OGL: Warn if buffer_storage isn't available.
Yes, this commit is only to blame OSX and Mali. Through the former supports unsynchronized mappings, the latter supports *no* way to stream dynamic data at all. Let's try to make bad news, as they ignore friendly feature requests. Maybe we just need to make more noise...
2018-03-12 20:38:00 +01:00
Stenzek
93ab50c555 OGL: Move primitive restart enable logic to GLUtil 2018-03-10 16:11:20 +10:00
Stenzek
51a586d11a GLUtil: Encapsulate functions in a namespace 2018-03-10 16:11:19 +10:00
Stenzek
fc1fe0672b OGL: Add some basic state tracking
We would want to improve the granularity here in the future, but for
now, this should avoid any performance loss from switching to the
VideoCommon shader cache.
2018-03-10 15:56:37 +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
bfb4709c80 AbstractPipeline: Allow setting pipeline to null 2018-03-10 15:56:18 +10:00
Stenzek
a61fcb0088 OGL: Fix abstract pipelines on drivers without binding layout support 2018-03-10 15:56:06 +10:00
Stenzek
00204dc988 OGL: Make ProgramShaderCache thread safe 2018-03-10 15:55:56 +10:00
Stenzek
4c24a69710 VideoCommon: Add support for Abstract Framebuffers 2018-03-02 20:20:48 +10:00
Stenzek
2a6d9e4713 AbstractTexture: Add support for depth textures/formats 2018-03-01 17:31:24 +10:00
Stenzek
6374a4c4a8 AbstractTexture: Support multisampled abstract texture 2018-03-01 17:31:24 +10:00
Stenzek
887e3830ba VideoBackends: Restore the framebuffer as part of the API state
It's not often we switch out to draw to the EFB anyway.
2018-03-01 17:31:24 +10:00
Markus Wick
227db66e4f OGL: Use glBufferData on Mali.
tl;dr: This PR speedups dolphin on mobiles with the Mali GPU and ES 3.2
drivers by a factor of 10 by using the method with the biggest overhead.
Please keep care not to buy this shit!

The ARM driver team seems to care very well about their customers. But
bad luck, users and open source developers are *not* their customers. So
even device-independent feature requests are just ignored for *years*:

https://community.arm.com/graphics/f/discussions/4645/gl_ext_buffer_storage-support

The bad point, they neither implement any of the other common ways to
stream dynamic content in unextented GL:
- They just ignore the GL_MAP_UNSYNCHRONIZED_BIT flag
- They don't support on-device buffer updates and just stall with
glBufferSubData

It seems like no benchmark is using any dynamic content - and like no
customer cares about anything but benchmarks, or users...

We have a flag to disable the glBufferSubData way, this PR adds the flag
to also disable the unsychronized mapping way. The second one is
available since their ES 3.2 update, but slow as hell.

So how to continue? The last remaining technical way to stream dynamic
content at all is to alloc a new buffer per draw call with glBufferData.
This is very gross, but still a factor 10 speedup compared to stalling
the GPU. Small tests shows that you can expect another 3-5 times speedup
with EXT_buffer_data, so Mali would be on pair with Adreno here. So if
you have bought such a device unfortunately, please try to make noise on
your vendor forums/support and ask for this extension. If you are going
to buy a new mobile, I'd recormend to avoid *any* mobile with a Mali GPU
in it.
2018-02-25 17:12:36 +01:00
Stenzek
e4d3b5f626 OGL: Only create bad shader files in Dump when compile failed
Warnings are still logged.
2018-02-25 18:03:58 +10:00
Anthony
b66f96c617
Merge pull request #6042 from stenzek/videocommon-pipelines
VideoCommon pipelines ("Abstract Pipeline")
2018-02-23 09:18:19 -08:00
Stenzek
2ba8f67feb OGL: Call GLInterface->Update() on window resize
macOS in particular requires the context be updated manually when the window
is resized.
2018-02-23 22:27:10 +10:00
Stenzek
fec6bb4d56 VideoBackends: Add AbstractShader and AbstractPipeline classes 2018-02-22 22:02:34 +10:00
Stenzek
aaea515d71 GLUtil: Drop now-unused attributeless VAO helpers 2018-02-22 19:09:28 +10:00
Stenzek
052d78bcb1 OGL: Log warnings from shader compiles, even if it compiled successfully 2018-02-22 19:08:54 +10:00
Stenzek
3fd4142f36 OGL: Track state of last bound vertex array object
This reduces the overhead of calling glBindVertexArray() every time
RestoreAPIState() is called, even when it is redundant.
2018-02-22 19:08:52 +10:00
Markus Wick
e01fe46068
Merge pull request #6367 from stenzek/gl-flush
OGL: Use explicit flush instead of GL_SYNC_FLUSH_COMMANDS_BIT
2018-02-19 16:26:35 +01:00
Stenzek
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
Stenzek
5baf3bbe2e OGL: Clear backbuffer before presenting instead of at start of frame 2018-02-20 01:11:40 +10:00
Stenzek
c1b39ecc58 BPFunctions: Move upscaling of scissor rect to VideoCommon 2018-02-20 00:49:32 +10:00
Stenzek
5359396099 BPFunctions: Move GX viewport conversion to VideoCommon 2018-02-20 00:49:32 +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
Stenzek
6490c2b86b OGL: Use explicit flush instead of GL_SYNC_FLUSH_COMMANDS_BIT 2018-02-09 01:25:14 +10:00
Stenzek
4b96db8fc9 OGL: Don't leave staging texture buffer bound after mapping
This could cause glReadPixels() calls which assume no buffer is bound
(e.g. CPU EFB access) to fail. The problem was limited to devices which
don't support persistent mapping, as the map path is not otherwise.
2018-02-09 01:15:27 +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
Greg V
be716a680f Do not link to libusbhid on FreeBSD/NetBSD
Both libusbhid (system library) and libhidapi (3rd party library)
provide a function called hid_init. Dolphin was being linked to both.

The WiimoteScannerHidapi constructor was calling hid_init without
arguments. libusbhid's hid_init expects one argument (a file path).
It was being called as if it was defined without arguments, which
resulted in a garbage path being passed in, and because of that,
the Qt GUI was failing to launch with the following error:
'dolphin-emu-qt2: @ : No such file or directory'
2018-02-05 00:46:59 +03:00
Stenzek
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
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
TraceBullet
ab6f932347 Fix Auto-Adjust Window Size option making the window too large 2018-01-26 10:47:19 -05:00
Stenzek
81ae88d2d5 AbstractTexture: Fix crash in Vulkan backend when freeing texture 2018-01-26 19:12:11 +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
c709f3c2d1 Standardise some enums from ALL_CAPS to CamelCase 2018-01-05 10:03:58 -08:00
Jonathan Hamilton
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
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
Stenzek
5f5aca7870 OGL: Fix incorrect usage of glGetTextureSubImage
Was causing issues with texture dumping on newer drivers.
2017-12-10 15:31:14 +10:00
degasus
02dd062518 VideoCommon: Drop now unused efb2tex matrix generation. 2017-12-06 09:30:03 +01:00
Lioncash
050440fd5b OGL/TextureConverter: Remove unnecessary using declaration 2017-12-03 18:51:22 -05:00
Lioncash
93e85f9a7c OGL/TextureConverter: Resolve -Wmissing-variable-declaration warnings 2017-12-03 18:51:17 -05:00
degasus
e2a9ee384f VideoCommon: Rename TextureConversionShader namespace. 2017-12-02 15:17:39 +01:00
degasus
e8febd0cef VideoCommon: Create a namespace for TextureConversionShaderGen. 2017-12-02 15:17:39 +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
ab44536a3c OGL: Update the window size after swapping buffers, not before
Prevents us from rendering beyond the viewport bounds.
2017-11-23 16:09:59 +10:00
Stenzek
db1d9de933 AbstractTexture: Drop slow map readback path 2017-11-22 18:49:33 +10:00
Stenzek
9da9f26b90 OGL: Use new readback methods for EFB2RAM 2017-11-22 18:47:04 +10:00
Stenzek
c2cc128f1b AbstractTexture: Implement Save using new common methods 2017-11-22 18:47:04 +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
a584ccc7d8 AbstractTexture: Support BGRA8 formats
Used for some driver's swap chains, and EFB to RAM.
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
Stenzek
39559f6358 VideoConfig: Remove bSupportsInternalResolutionFrameDumps
Field is unused as of Hybrid XFB.
2017-11-21 17:19:43 +10:00
Leo Lam
80bcc0d58d
Merge pull request #6186 from lioncash/enum-class
VideoConfig: Make AspectMode and StereoMode enum classes
2017-11-19 15:08:16 +01: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
Lioncash
5337e58284 VideoConfig: Make StereoMode an enum class
Makes for more strongly-typed identifiers (and doesn't pollute
surrounding namespaces)
2017-11-18 23:19:53 -05: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
76b775d5be Video Common: Add XFB decoding via the GPU 2017-11-17 22:11:30 -06:00
iwubcode
33bc286baa Remove old XFB logic 2017-11-17 22:11:29 -06:00
iwubcode
b285188de1 Video Backends: Implement vertical scaling for xfb copies. This fixes the
display of PAL games that run in 50hz mode.
2017-11-17 22:11:29 -06:00
iwubcode
198d3b69b4 Add ability to dump xfb copies to texture for debugging purposes 2017-11-17 22:11:28 -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
JosJuice
a310cbec8e Fix incorrect handling of auto IR
Some lines of code in Dolphin just plainly grabbed the value of
g_ActiveConfig.iEFBScale, which resulted in Auto being treated as
0x rather than the actual automatically selected scale.
2017-11-03 16:04:46 +01:00
Tommaso Checchi
5fb6ceac45 Fixed fog, lava, water in Mario Galaxy (and possibly other games) in higher IRs by detecting & fixing the mipmaps that aren't just used for downscaling, but are handmade to create a gradient. 2017-10-27 00:45:20 -07:00
Michael M
82129d30c9 TextureCache: don't create texture decoding resources if not enabled 2017-10-21 23:06:44 -07:00
Lioncash
dbd9aeb210 OGL/TextureCache: use std::array for the palette shader array 2017-09-17 02:34:02 -04:00
Lioncash
6d9ed9dc32 OGL/TextureCache: Move file statics to the TextureCache class
These rely on instance state, or are used within instance-based class
member functions, so they should belong to the instance itself instead
of being file statics.
2017-09-17 02:33:56 -04:00
Stenzek
24ddea04ce VideoBackends: Move SamplerState to common 2017-09-11 20:01:54 +10: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
Stenzek
2869c570f1 Renderer: Move depth state to VideoCommon and seperate from bpmem 2017-09-11 19:40:26 +10:00
Stenzek
9e1c09e347 StreamBuffer: Don't wait on fences twice when reserve > commit
If we allocate a large amount of memory (A), commit a smaller amount,
then allocate memory smaller than allocation A, we will have already
waited for these fences in A, but not used the space. In this case,
don't set m_free_iterator to a position before that which we know is
safe to use, which would result in waiting on the same fence(s) next
time.
2017-09-09 13:26:30 +10:00
Stenzek
84f8ebd95f VideoBackends: Clear uid bits that are unused for the current backend
Currently, this is only the logic op bit, but this will be extended to
the framebuffer fetch/blend modes. In the future, when/if we move to
VideoCommon pipelines, this state will be part of the pipeline UID
anyway, and we can mask it out in the backend by using a two-level map,
so the shaders/programs are shared.
2017-09-05 23:49:42 +10:00
Stenzek
3dd675e613 Renderer: Change SetBlendState to accept a BlendingState
This decouples the state generation (from the emulated GPU) from the
management of internal backend state.
2017-09-03 14:14:54 +10:00
Stenzek
005d0b39f7 Merge pull request #6009 from lioncash/async
AsyncShaderCompiler: Make WorkItem-derived class constructors explicit
2017-09-03 14:11:41 +10:00
Lioncash
2237a6a04c OGL/VertexManager: Make vertex and index buffer handles private
These are only ever read, but not written to outside of the VertexManager class.
2017-09-02 20:51:54 -04:00
Lioncash
2d45204f12 VideoBackends: Add the explicit keyword to WorkItem-derived class constructors
Prevents implicit conversions
2017-09-02 17:35:20 -04:00
Lioncash
5059332d95 OGL/ProgramShaderCache: Remove unnecessary virtual keyword
This is superfluous, considering the override keyword is present.
2017-09-02 17:27:19 -04:00
Jonathan Hamilton
662abcb2fe Parse IMGTEC's GL_VERSION string format
ImgTec's driver uses a major.minor@changeID versioning system

This is packed into a double so "1.9@4850625" becomes "109.4850625"

The next release brnach is expected to be 1.10, hence the need for 2
digits for the branch minor.

The changeID should be unique for each build, but is shared over all
branches, so only makes sense to compare withing a branch.

It's likely branch 'major' versions will be used for major hardware
revisions, and the drivers for both maintained in parallel. Thus it
may not make sense to compare versions between different major
verisons - if/when this happens we can hook up a DriverDetails::Family
as needed.
2017-09-02 14:05:16 -07:00
Stenzek
21b3cd4759 OGL: Fix EFB pokes using incorrect color/depth 2017-08-27 11:55:24 +10:00
JosJuice
09f3f9b41a Remove NonCopyable
The class NonCopyable is, like the name says, supposed to disallow
copying. But should it allow moving?

For a long time, NonCopyable used to not allow moving. (It declared
a deleted copy constructor and assigment operator without declaring
a move constructor and assignment operator, making the compiler
implicitly delete the move constructor and assignment operator.)
That's fine if the classes that inherit from NonCopyable don't need
to be movable or if writing the move constructor and assignment
operator by hand is fine, but that's not the case for all classes,
as I discovered when I was working on the DirectoryBlob PR.

Because of that, I decided to make NonCopyable movable in c7602cc,
allowing me to use NonCopyable in DirectoryBlob.h. That was however
an unfortunate decision, because some of the classes that inherit
from NonCopyable have incorrect behavior when moved by default-
generated move constructors and assignment operators, and do not
explicitly delete the move constructors and assignment operators,
relying on NonCopyable being non-movable.

So what can we do about this? There are four solutions that I can
think of:

1. Make NonCopyable non-movable and tell DirectoryBlob to suck it.

2. Keep allowing moving NonCopyable, and expect that classes that
   don't support moving will delete the move constructor and
   assignment operator manually. Not only is this inconsistent
   (having classes disallow copying one way and disallow moving
   another way), but deleting the move constructor and assignment
   operator manually is too easy to forget compared to how tricky
   the resulting problems are.

3. Have one "MovableNonCopyable" and one "NonMovableNonCopyable".
   It works, but it feels rather silly...

4. Don't have a NonCopyable class at all. Considering that deleting
   the copy constructor and assignment operator only takes two lines
   of code, I don't see much of a reason to keep NonCopyable. I
   suppose that there was more of a point in having NonCopyable back
   in the pre-C++11 days, when it wasn't possible to use "= delete".

I decided to go with the fourth one (like the commit title says).
The implementation of the commit is fairly straight-forward, though
I would like to point out that I skipped adding "= delete" lines
for classes whose only reason for being uncopyable is that they
contain uncopyable classes like File::IOFile and std::unique_ptr,
because the compiler makes such classes uncopyable automatically.
2017-08-22 16:40:34 +02:00
JosJuice
f090a94319 Remove non-integer IRs 2017-08-08 12:09:50 +02:00
Stenzek
6d91c1b079 ProgramShaderCache: Call glTexImage3D after glTexParameter
Was missed before merge.
2017-08-05 18:18:30 +10:00
Anthony
3c5112bb21 Merge pull request #5856 from stenzek/optimus-crash
Fix ubershader crashes with primus/bumblebee
2017-08-05 00:54:28 -07: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
67997529b8 ProgramShaderCache: Create a FBO for shared contexts to draw into
This way it allows us to use surfaceless contexts in EGL/GLX. It also
ensures that the shared context shares a similar setup to the main
context's framebuffer, potentially reducing the number of variants a
driver needs to generate.
2017-08-02 20:12:28 +10:00
Stenzek
fe65b26d53 Merge pull request #5834 from stenzek/bc7
Support loading BC7 (BPTC) textures from DDS files
2017-08-01 12:39:19 +10:00
Stenzek
63305e9173 HiresTextures: Support loading BC7 (BPTC) from DDS files 2017-08-01 11:59:38 +10:00
Stenzek
d62dcd397d VideoConfig: Drop force vertex/pixel ubershader settings
This was mainly included for debugging, but could end up being confusing
for users, as well as polluting the GL program cache with a mix of uber
and specialized shaders if the option was changed.
2017-07-31 23:21:38 +10:00
Stenzek
e968c191ff Ubershaders: Support per-pixel lighting 2017-07-30 17:43:59 +10:00
Stenzek
c8f31656cb VideoBackends: Support a different number of threads for precompiling
At runtime, we only really want a single shader compiler thread.
However, for initial boots, we can use a higher number to speed things
up.
2017-07-30 17:43:59 +10:00
Stenzek
e17efb1d8d ShaderGen: Use consistent variable names for texture coordinates 2017-07-30 17:43:59 +10:00
Stenzek
25338c53e0 NativeVertexFormat: Drop unused virtual method SetupVertexPointers 2017-07-30 17:43:59 +10:00
Stenzek
cd502990fa OGL: Uber shader support 2017-07-30 17:43:59 +10:00
Stenzek
7d78cf0f6f ShaderGen: Implement pixel ubershaders 2017-07-30 17:43:59 +10:00
Stenzek
3ea9d86faa ShaderGen: Pass host config to shader generation functions
Also moves the host config checks to common.
2017-07-20 17:54:33 +10:00
Stenzek
d01b0bf60f VideoCommon: Move shader cache filename generation to common 2017-07-20 17:46:59 +10:00
Stenzek
62a901508b OGL: Reload shader cache when relevant video config changes 2017-07-20 17:46:59 +10:00
Jules Blok
f3508742ac OGL: Support Quad-Buffered stereoscopy. 2017-07-05 22:43:39 +02:00
Jules Blok
4a7b96c93a FramebufferManager: Fix EFB layers being attached to the wrong FBO.
Fixes typo in commit 56fe938366.
2017-06-27 23:42:42 +02:00
Lioncash
07cddf6f7f AbstractTexture: Add missing includes (and remove unnecessary ones) 2017-06-18 23:29:22 -04:00
shuffle2
e63c337830 Merge pull request #5305 from iwubcode/abstract_texture
Abstract Texture
2017-06-18 12:57:05 -07:00
Leo Lam
bc9c9b9fe4 Merge pull request #5594 from MerryMage/phack
Cleanup Projection Hack
2017-06-16 18:36:39 +02:00
JosJuice
cf94ce6305 Add a namespace to OpenFStream
For consistency with the other functions in FileUtil.h.
2017-06-15 21:34:04 +02:00
JosJuice
f09ceaa735 Move IOFile to a separate file
Reduces the number of files that need to be recompiled
when making changes to FileUtil.h.
2017-06-15 21:33:50 +02:00
MerryMage
f8a99ca192 VertexShaderManager: Rename projection hack variables 2017-06-15 16:38:10 +01:00
iwubcode
e4896d39bd Video Backends: Move and rename HostTextureFormat to AbstractTextureFormat 2017-06-13 00:41:56 -05: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
Shawn Hoffman
5480efdff2 video: change multisample/AA setting to u32 2017-06-07 20:20:25 -07:00
Shawn Hoffman
e1a3e41bf3 fix various instances of -1 being assigned to unsigned types 2017-06-07 19:52:07 -07:00
shuffle2
c8166951a0 Merge pull request #5418 from MerryMage/config-again-and-again
VideoConfig: Port to layered configuration system
2017-06-05 21:11:04 -07:00
Shawn Hoffman
397720a9fe might as well update yet some more pointless version numbers.. 2017-06-03 18:20:40 -07: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
degasus
afb0beb9ab OpenGL: Mute nvidia performance warning about stalling the GPU.
They are right, our perf query implementation is terrible.
But raising a warning makes it just even slower.
2017-05-03 23:48:14 +02:00
Stenzek
cc851c41c1 TextureCache: Move host texture utility functions to VideoCommon
The appropriate place for these would be AbstractTexture, once it is
finished.
2017-04-29 13:46:43 +10:00
Stenzek
f5d95dcc86 OGL: Use native compressed textures on supported drivers 2017-04-29 00:44:34 +10: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
27ae5b8d34 VideoConfigDiag: Move post-processing shader list to post processor
The backends don't use this list at all, and since more than one
backend supports post-processing now, it's duplicate code.
2017-04-25 14:27:05 +10:00
Stenzek
a10e8b1ef5 VideoCommon: Move the blit methods to the backend class
The parameter types will be different for each backend currently,
anyway (e.g. textures/render passes/etc).
2017-04-25 14:25:41 +10:00
Stenzek
fd896bd9e0 OGL: Drop BlendingState.dither
How GL_DITHER works is implementation-defined, and we handle the
non-blended case in the pixel shader.
2017-04-18 21:55:23 +10:00
Stenzek
34ad5b457d VideoCommon: Add usedualsrc field to BlendingState
This is because we re-use BlendingState for our internal drawing (e.g.
RasterFont) and for these shaders, we can't assume the presence of a
second color output.
2017-04-18 21:33:40 +10:00
Stenzek
e370f6a82a OGL: Use struct for post-processing shader options
This removes the need for token pasting, which isn't supported in GLSL
ES. Shouldn't cause any issues unless people are using reserved keywords
as option names.
2017-04-16 14:00:02 +10:00
Stenzek
e9850aa0f2 VideoBackends: Support updated texture encoding shader generators 2017-04-12 00:11:22 +10:00
Markus Wick
4e90c5da8b Merge pull request #5234 from lioncash/tuple
RenderBase: Return tuples from CalculateTargetScale and ConvertStereoRectangle instead of using out parameters
2017-04-11 10:27:16 +02:00
Anthony
c6b553b6d2 Merge pull request #5220 from stenzek/small-nonsquare-mips
TextureCache: Fix incomplete GPU texture decoding of non-square mips
2017-04-09 13:45:38 -07:00
Lioncash
c7ab6861c2 RenderBase: Return a tuple from ConvertStereoRectangle instead of using out parameters 2017-04-09 15:11:59 -04:00
Stenzek
2492f196a7 TextureCache: Fix incomplete GPU texture decoding of non-square mips 2017-04-07 23:03:14 +10:00
Lioncash
f7a2f6ad01 FileSearch: Namespace functions under the Common namespace 2017-04-07 01:02:14 -04:00
Stenzek
02f887ede0 OGL: Add GPUTimer class for measuring execution time of a draw/dispatch 2017-04-01 12:32:57 +10:00
Stenzek
b01bcb80f4 OGL: Implement GPU texture decoding backend 2017-04-01 12:32:56 +10:00
Stenzek
82fd984f3e VideoBackends: Add configuration field for GPU texture decoding 2017-04-01 12:32:05 +10:00
Stenzek
abc662d69c OGL: Support compute shaders and emitting GLSL 4.3
This also changes bSupportsEarlyFragmentTests to
bSupportsImageLoadStore, as it is used for both.
2017-04-01 12:31:41 +10:00
Stenzek
b987f220e1 VideoBackends: Add support flag for compute shaders 2017-04-01 12:31:41 +10:00
Stenzek
a8876a29fe OGL: Use ARB_texture_storage to allocate TextureCache entries
This ensures that they are complete textures by decoding time, as when
using compute shaders we write directly to the destination texture.
2017-04-01 12:31:41 +10:00
Stenzek
f8059eae43 OGL: Fix render-target texture mipmap allocation
The loop was allocating one-too-many levels, as well as incorrect sizes
for each level. Probably not an issue as mipmapped render targets aren't
used, but the logic should be correct anyway.
2017-04-01 12:31:40 +10:00
Stenzek
5326a18fdf OGL: Fix MSAA being forced to 1x
This was a regression from the remove-everything-static-from-renderer
PR. As the comment indicates, it would be nice to move all of this logic
out of the Renderer constructor, but this is a much larger change.
2017-03-31 21:55:26 +10:00