Commit graph

3416 commits

Author SHA1 Message Date
Stenzek
134daf3b00 Vulkan: Extend the NVIDIA MSAA bug to render-pass based clears
Calling vkCmdClearAttachments with a partial rect, or specifying a
render area in a render pass with the load op set to clear can cause the
GPU to lock up, or raise a bounds violation. This only occurs on MSAA
framebuffers, and it seems when there are multiple clears in a single
command buffer. Worked around by back to the slow path (drawing quads)
when MSAA is enabled.
2017-09-07 17:05:43 +10:00
Stenzek
b573319f8f D3D: Fix shader compile error with logicop and alpha test enabled 2017-09-07 11:48:01 +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
6d32cce2f5 ShaderGen: Output uint when logic op is enabled for D3D ubershaders 2017-09-05 23:49:42 +10:00
Anthony
ee6930a231 Merge pull request #6013 from stenzek/d3d-logic-op
D3D: Implement logic op support
2017-09-03 19:26:50 -07:00
Anthony
26e777d80b Merge pull request #5337 from stenzek/d3d-common-blending-state
D3D: Use blending state from VideoCommon
2017-09-03 19:25:46 -07:00
Mat M
edf4bfaf5f Merge pull request #5989 from lioncash/constantmgr
ConstantManager: Use std::array where applicable
2017-09-03 13:18:10 -04:00
Jules Blok
75574ec6cc Merge pull request #5946 from stenzek/ubershader-stereo-texture-samples
UberShaderPixel: Fix sampling of EFB copies in stereo modes
2017-09-03 12:26:52 +02:00
Stenzek
0622979d3b ShaderGen: Support writing integer colors when logic op is enabled
This is required for D3D to support logic op.
2017-09-03 16:33:25 +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
22b8cbae35 RenderBase: Drop SetColorMask and SetLogicOpMode
These are now incorporated into the blend state for all backends.
2017-09-03 14:14:54 +10:00
Stenzek
7a4348b641 Merge pull request #5649 from JonnyH/WIP/disable-vk-clear-renderpass
Add DriverDetails::BUG to Disable "LoadOp" clear renderpass in vulkan
2017-09-03 13:49:51 +10:00
Pierre Bourdon
425a8cb378 Merge pull request #5718 from mimimi085181/partial-updates-update
Update to partial texture updates
2017-09-03 03:16:55 +02:00
Mat M
657195fad5 Merge pull request #6006 from JonnyH/WIP/parse-imgtec-gl_version-string
Parse IMGTEC's GL_VERSION string format
2017-09-02 17:10:59 -04:00
Markus Wick
30e01834e2 Merge pull request #6002 from lioncash/include
CommandProcessor: Remove unnecessary include
2017-09-02 23:05:58 +02:00
Jonathan Hamilton
658a4a6e29 Mark an ImgTec driver bug as fixed in 1.8@4693462
Now we correctly parse ImgTec's GL_VERSION string we can actually use
the BugInfo's version stuff correctly here
2017-09-02 14:05:16 -07:00
Lioncash
6f97e3faa6 AsyncShaderCompiler: use std::make_unique in CreateWorkItem()
Same behavior, simpler code.
2017-09-02 14:08:00 -04:00
Lioncash
62615c601e AsyncShaderCompiler: Forward arguments to the specified type's constructor in CreateWorkItem()
As this just hands off the arguments to another type's constructor,
perfect forwarding should be used here to preserve any potential move semantics.
2017-09-02 14:06:48 -04:00
Lioncash
f6e3a39c0e CommandProcessor: Remove unnecessary include
Gets rid of some indirect inclusion.
2017-09-02 13:34:21 -04:00
Jonathan Hamilton
62e8d25cd1 Add Bug to Disable "LoadOp" clear renderpass in vulkan
This optimisation doesn't work on PowerVR's Vulkan implementation. We
(incorrectly) disallow Framebuffer objects to be used with a different
load or store op than that which they were created with, despite the
spec allowing such.

This fixes the windwaker intro "smearing"
2017-08-28 18:01:35 -07:00
Jonathan Hamilton
11057649ee Add VideoLogic (ImgTec) PCI ID 2017-08-28 18:01:16 -07:00
Lioncash
9c1f9c1c00 ConstantManager: Use std::array where applicable
Modernizes the arrays and makes future simplifications possible (e.g. usages within the software renderer).

It also makes cases where we use array->pointer decay explicit.
2017-08-27 15:41:36 -04:00
Chris Burgener
cc03e49024 Remove FFMPEG check for Renderer::IsFrameDumping() 2017-08-24 11:15:50 -04: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
N.E.C
ebda7db437 VideoCommon: Fix bug #10464 (RA4 format not handled in TextureDecoder) 2017-08-21 10:22:15 -07:00
Jules Blok
390f3f13ba RenderState: Fix incorrect blending factors when removing the color usage. 2017-08-21 16:33:10 +02:00
Stenzek
a7f217c3f4 UberShaderPixel: Fix sampling of EFB copies in stereo modes 2017-08-20 18:08:24 +10:00
Anthony
6a272f22de Merge pull request #5478 from stenzek/vulkan-nvidia
Vulkan: Don't use vkCmdClearAttachments on NVIDIA with MSAA
2017-08-14 13:12:41 -07:00
Stenzek
f8a64ab1fc UberShaderPixel: Use an if trees instead of switch statements on GL
The switch statements in these functions appear to get transformed into
an if..else chain on NVIDIA's OpenGL/Vulkan drivers, resulting in lower
performance than the D3D counterparts. Transforming the switch into a
binary tree of ifs can increase performance by up to 20%.
2017-08-12 00:16:19 +10:00
Leo Lam
c91211b6ce Merge pull request #5867 from leoetlino/widescreen
GameINI: Replace Wii.Widescreen with AspectRatio
2017-08-11 18:23:54 +08:00
Léo Lam
b2c41cec0a Config: Include SYSCONF in base layer
Settings that come from the SYSCONF are now included in Dolphin's
config system as part of the base layer. They are handled in a
special way compared to other settings to make sure they are only
loaded from and saved to the SYSCONF (to avoid different, possibly
contradicting sources of truth).
2017-08-11 15:36:31 +08:00
Leo Lam
e41a9905c0 Merge pull request #5744 from JosJuice/remove-non-integer-irs
Remove non-integer IRs
2017-08-10 17:10:26 +08:00
N.E.C
b52aff7966 VideoCommon: Fix typo in comments introduced by #5849 2017-08-09 00:02:27 -07:00
JosJuice
f090a94319 Remove non-integer IRs 2017-08-08 12:09:50 +02:00
mimimi085181
cdbd9863b4 Keep textures that are overwritten by efb copies, if the stride matches
This is supposed to get efb2tex to the same texture as efb2ram, by applying the related efb copies as updates after each other, in the order of their creation.
2017-08-06 03:13:57 +02:00
mimimi085181
4e8ff42503 Do not load overwritten textures by hash
In this case, comparing the hash is not enough to check, if two textures are identical.
2017-08-06 03:13:57 +02:00
mimimi085181
a21ac22e07 fix stored memory stride for normal textures 2017-08-06 03:13:57 +02:00
Léo Lam
e58ba76f07 Don't force the aspect ratio in GameINIs
Instead, add a SuggestedAspectRatio option which tells Dolphin which
aspect ratio to use when the aspect ratio option is set to Auto.
2017-08-05 14:27:16 +08: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
7f88711186 Vulkan: Add a driver bug for NV when MSAA is enabled
This causes the card to lock up when vkCmdClearAttachments is called,
when multisampling is enabled. Seems to be restricted to Maxwell and
newer?
2017-08-03 17:40:15 +10:00
Stenzek
d0bcdc7f89 Merge pull request #5858 from stenzek/ubershader-6-bit-color
Ubershaders: Fix 6-bit color truncation not being applied
2017-08-02 20:10:34 +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
852e30bb8c Ubershaders: Fix 6-bit color truncation not being applied 2017-08-01 00:01:09 +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
b154edb4fb VideoCommon: Move WM_USER_CREATE message to after backend initialization
Fixes the mouse cursor being left visible after ubershader
precompilation when the hide option is checked.
2017-07-30 17:43:59 +10:00
Stenzek
d54ca2a16a PixelShaderGen: Don't include host early z support in UID
Disable it at shader generation time instead. This way the UIDs are
sharable.
2017-07-30 17:43:59 +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