Commit graph

1637 commits

Author SHA1 Message Date
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
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
c15ea2f1ed D3D: Fix crash if shaders fail to compile 2017-09-07 11:45:43 +10:00
Jules Blok
c97a799c5f Merge pull request #6016 from Armada651/allow-tearing
D3DBase: Support the "allow tearing" DXGI flags.
2017-09-06 13:22:23 +02:00
Jules Blok
e103a58d87 Merge pull request #6012 from stenzek/drop-nv-glsl
Vulkan: Drop VK_NV_glsl extension support
2017-09-06 13:19:47 +02:00
Stenzek
1073053df9 Merge pull request #6026 from stenzek/d3d-ubershader-logicop
ShaderGen: Output uint when logic op is enabled for D3D ubershaders
2017-09-06 18:33:47 +10:00
Stenzek
2e20cd0ffd Merge pull request #6025 from spxtr/present_queue
Vulkan: Use a separate queue for presenting.
2017-09-06 18:32:43 +10:00
iwubcode
1ccfccdcf0 D3D: Properly handle dual source blending 2017-09-05 23:51:31 -05:00
spxtr
a5be5a3a76 Vulkan: Use a separate queue for presenting.
Before this change, we simply fail if the device does not expose one
queue family that supports both graphics and present. Currently this is
fine, since devices tend to lay out their queues in this way. NV, for
instance, tends to have one queue family for all graphics operations and
one more for transfer only. However, it's not a hard requirement, and it
is cheap to use a separate queue, so we might as well.
2017-09-05 12:00:09 -07: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
Jules Blok
347fd065df D3DBase: Support the "allow tearing" DXGI flags.
This makes sure our framerate is unlocked when we disable V-Sync.
2017-09-04 23:12:52 +02: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
Stenzek
90051536bf D3D: Support logic op through integer render target view
This brings D3D to parity with OpenGL and Vulkan.
2017-09-04 10:07:36 +10:00
Markus Wick
9e0df284aa Merge pull request #6018 from lioncash/const
Software/Tev: const correctness
2017-09-03 21:43:10 +02:00
Lioncash
baee3a9c74 Software/Tev: const correctness 2017-09-03 14:15:21 -04:00
Lioncash
36e299ca80 D3DTexture: Remove unused bindflags D3DTexture2D member variable 2017-09-03 13:12:26 -04:00
Lioncash
52099d1b0a D3DTexture: in-class initialize class members where applicable 2017-09-03 13:08:06 -04:00
Jules Blok
8906b26ea5 D3DBase: Use the correct version of CreateDXGIFactory. 2017-09-03 14:33:06 +02:00
Stenzek
99d61906cc Merge pull request #5948 from Armada651/d3d-explicit-stereo
D3DBase: Only use a stereo swapchain if quad-buffering is enabled.
2017-09-03 21:07:24 +10:00
Stenzek
c9d649d27c D3D: Use Direct3D 11.1 where supported 2017-09-03 16:33:47 +10:00
Stenzek
254160691a Revert "Vulkan: Use VK_NV_glsl extension where available, and skip glslang"
This reverts commit d23fd17e1a.

Dynamic sampler indexing is broken in VK_NV_glsl as of 385.41. The
performance gap doesn't seem to be as wide with the updated driver, so
to save maintaining two code paths, it's easier to just drop the
extension support completely.
2017-09-03 15:31:19 +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
5c9bc8b79c D3D11: Use blending state from VideoCommon 2017-09-03 14:14:54 +10:00
Stenzek
c90b0bf532 D3D11: Create debug device when validation layer is enabled in options 2017-09-03 14:14:19 +10:00
Stenzek
ce59121748 Merge pull request #6004 from lioncash/d3d
D3D: Eliminate redundant ID3D11DeviceChild* casts
2017-09-03 14:13:17 +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
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
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
Lioncash
64de8a9d0b D3D: Eliminate redundant ID3D11DeviceChild* casts 2017-09-02 14:45:14 -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
Stenzek
21b3cd4759 OGL: Fix EFB pokes using incorrect color/depth 2017-08-27 11:55:24 +10:00
Jonathan Hamilton
5b41c5ae0d Fix vulkan crash on drivers without atomic load/store support
This would not allocate a SSBO buffer, but still try to update the
descriptor said with a NULL buffer. Which naturally crashed.
2017-08-23 14:49:22 -07: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
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
Jules Blok
f4f6782ae6 D3DBase: Only use a stereo swapchain if quad-buffering is enabled. 2017-08-20 18:25:49 +02: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
Anthony
a7bdd2ee1c Merge pull request #5868 from stenzek/d3d-require-new-compiler
D3DBase: Raise error if d3dcompiler_47.dll cannot be loaded
2017-08-14 09:55:31 -07:00
JosJuice
f090a94319 Remove non-integer IRs 2017-08-08 12:09:50 +02: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
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