Commit Graph

567 Commits

Author SHA1 Message Date
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
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
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
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
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
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 005d0b39f7 Merge pull request #6009 from lioncash/async
AsyncShaderCompiler: Make WorkItem-derived class constructors explicit
2017-09-03 14:11:41 +10:00
Lioncash 2d45204f12 VideoBackends: Add the explicit keyword to WorkItem-derived class constructors
Prevents implicit conversions
2017-09-02 17:35:20 -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 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
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
JosJuice f090a94319 Remove non-integer IRs 2017-08-08 12:09:50 +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 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 fee08cf63d Vulkan: Use optimal tiling for dummy texture
Fixes a crash on some NVIDIA drivers. Apparently calling
vkCmdClearColorImage on an image with linear tiling causes the
GPU/driver to lock up.
2017-08-02 21:33:10 +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 25338c53e0 NativeVertexFormat: Drop unused virtual method SetupVertexPointers 2017-07-30 17:43:59 +10:00
Stenzek 33f6668544 Vulkan: Multithreaded creation of UID pipeline caches
Should give a decent speedup to boot time.
2017-07-30 17:43:59 +10:00
Stenzek 81b4ed2a81 Vulkan: 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 357c55442f Vulkan: Clear decoding texture before usage
Fixes a validation layer warning.
2017-07-30 12:38:50 +10:00
Stenzek aff44684a4 Vulkan: Move shader/pipeline-related methods to ShaderCache 2017-07-30 12:38:49 +10:00
Stenzek d23fd17e1a Vulkan: Use VK_NV_glsl extension where available, and skip glslang
Seems to produce faster ubershaders, at least.
2017-07-30 12:38:49 +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 7c5bbafdd1 Vulkan: Don't save/load pipeline UID cache when shader cache is disabled 2017-07-20 17:46:59 +10:00
Stenzek b380f292b4 Vulkan: Reload pipeline cache when relevant host config changes 2017-07-20 17:46:59 +10:00
Stenzek a8343cc19a Vulkan: Don't save pipeline cache if shader cache is disabled
We still create a pipeline cache object, since that speeds up driver's
creation of pipelines at runtime. However, we should not save it.
2017-07-20 17:46:59 +10:00
Stenzek d9a3b29a07 Vulkan: Emit input/output locations for EFB poke geometry shader 2017-07-20 17:46:59 +10:00
Jules Blok 1f2d43c870 Vulkan: Implement Quad-Buffered stereoscopy support. 2017-07-05 22:43:39 +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 8f460a1cda Merge pull request #5611 from JosJuice/reorganize-file-namespace
Reorganize File namespace
2017-06-15 23:28:36 +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
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
Stenzek 8a56ef42dc Vulkan: Fix image layout assertion failing for palette textures 2017-06-13 14:47:09 +10:00
shuffle2 2b86cf02a8 Merge pull request #5589 from stenzek/vulkan-validation-fixes
Vulkan: Don't transition image layouts inside render passes
2017-06-11 16:59:02 -07:00
MerryMage a0b41c83e7 VideoConfig: Remove bRunning
Value was set but not used.
2017-06-11 15:06:12 +01:00
Stenzek ca55ba6c1d Vulkan: Transition texture cache entries before usage 2017-06-10 23:52:39 +10:00
Stenzek 8bb6abacf8 Vulkan: Transition EFB/XFB buffers before beginning swap render pass
Image layouts shouldn't be changed within a render pass.
2017-06-10 23:52:32 +10:00
Shawn Hoffman 5480efdff2 video: change multisample/AA setting to u32 2017-06-07 20:20:25 -07:00
Shawn Hoffman 7431dd3dce msbuild: make Externals inclusion methods uniform 2017-06-03 18:20:41 -07:00
Shawn Hoffman a3caa14ade remove duplicate code in msbuild files 2017-06-03 18:20:40 -07: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 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 c53a60f3c3 Vulkan: Support native compressed textures 2017-04-29 13:46:42 +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 417a4ca206 Vulkan: Implement post-processing backend
No new features, just parity with OpenGL.
2017-04-25 14:27:02 +10:00
Stenzek d1dc9d5a0c Merge pull request #5284 from stenzek/vulkan-videocommon-blending-state
Vulkan: Use BlendingState from VideoCommon
2017-04-18 22:16:32 +10:00
Stenzek ddc5275071 VideoCommon: Drop SetDitherMode()
It was a no-op on all backends apart from GL anyhow.
2017-04-18 21:55:22 +10:00
Stenzek 9dc7358395 Vulkan: Use BlendingState from VideoCommon
Remove the internal BlendState union. Also fixes Kirby's Return to
Dreamland shadows.
2017-04-18 21:55:22 +10:00
Stenzek 3fd1e6c2f6 Vulkan: Ensure all frames are written before resizing framedump buffer
Prevents destroying a framebuffer that may still be in use by a previous
frame dump.
2017-04-15 20:00:40 +10:00
Stenzek 48da42b49f Vulkan: Ensure framedump texture is incorrect layout for render/readback 2017-04-15 19:57:25 +10:00
Stenzek 69b0a31938 Vulkan: Clamp framebuffer resolve rectangle to texture size
This is invalid and was causing the NVIDIA driver to throw an error.
2017-04-15 19:55:32 +10:00
Stenzek eef7b6cf7a Vulkan: Fix invalid resolve at swap time when MSAA is enabled 2017-04-15 18:35:58 +10:00
Stenzek c8b98dca1a Vulkan: Raise the number of texel buffer/storage image descriptors
Running with GPU texture decoding enabled could cause us to run out of
descriptors within a single frame.
2017-04-14 18:29:53 +10:00
Stenzek f4bdfe3e0c Vulkan: Fix incorrect render pass area for out-of-range clears
This occured when a game set an out-of-range EFB clear region.
2017-04-14 18:29:48 +10:00
Stenzek 5e7bd03d0b Vulkan: Linear filter >1xIR EFB copies, matching the other backends 2017-04-12 00:11:22 +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
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
Stenzek 739aced97c Vulkan: Implement compute-shader based GPU texture decoding 2017-04-01 12:32:57 +10:00
Stenzek 5fbc63fbcf Vulkan: Compute shader support 2017-04-01 12:32:57 +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
Michael Maltese de940a5fd6 VideoConfig: add bSupportsFragmentStoresAndAtomics 2017-03-15 17:20:47 -07: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
Stenzek 27d7a1646c Merge pull request #5065 from JosJuice/character
Fix issue 10146 (compilation issue because of colliding defines)
2017-03-11 18:26:26 +10:00
JosJuice 40e707348c Fix issue 10146 (compilation issue because of colliding defines) 2017-03-11 08:59:14 +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
Markus Wick ef74c5eabd Merge pull request #5051 from stenzek/renderer-fixes
VideoBackends: Fix crashes introduced by #4999
2017-03-09 21:06:50 +01:00
JosJuice ced1614cac Unify the way of setting game ID, title ID, revision
The existing code from ConfigManager, ES and MIOS is merged
into a new set of functions called SetRunningGameMetadata.
2017-03-09 15:34:14 +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 4cea9a2f99 Vulkan: Fix underflow in StreamBuffer::WaitForClearSpace
This could cause the assertion on line 212 to fail when uploading large
amounts of data in between command buffer executions.
2017-03-04 18:07:04 +10:00
Stenzek 00a0a91513 VideoCommon: Move last EFB scale handling to CalculateTargetSize 2017-03-04 16:53:07 +10:00
Stenzek afc25fdca0 VideoCommon: Rename Renderer s_ prefixes to m_ 2017-03-04 16:42:21 +10:00
Stenzek 238a70b006 VideoCommon: Move some common initialization logic to RenderBase 2017-03-04 16:42:16 +10:00
Stenzek 277829d842 VideoCommon: Eliminate static state in Renderer 2017-03-04 16:39:50 +10:00
Stenzek 2fd77895a2 Vulkan: Fix issue where target rectangle changes weren't detected
This was causing issues when toggling the crop setting, as well as some
widescreen hacks.
2017-03-02 21:53:42 +10: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 a15555fe03 VideoBackends: Use vertex shader depth range if ztexture is used. 2017-02-26 11:34:48 +01:00
Jules Blok bde8126913 VideoBackends: Remove depth range clamping hacks.
Oversized depth ranges are handled correctly now, we don't need to hack around them with clamps anymore.
2017-02-24 14:54:20 +01:00
Jules Blok 94522d4cf3 OGL: Add support for glDepthRangedNV to handle oversized depth ranges. 2017-02-24 14:54:16 +01:00
Jules Blok 28e6e259ed VideoBackends: Set the maximum range when the depth range is oversized.
The depth values generated by the vertex shader need to be clamped correctly.
2017-02-21 02:57:23 +01:00
Jules Blok 21967b1f6e VideoBackends: Add a developer option to disable the shader cache.
Makes it easier to disable the cache while working on the shaders.
2017-02-19 12:05:44 +01:00
Stenzek b8eb1080ce Merge pull request #4924 from stenzek/vulkan-list-restart
Vulkan: Fix GPU hangs on AMD Polaris
2017-02-18 21:58:30 +10: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
Stenzek 50fa135594 Vulkan: Handle BUG_PRIMITIVE_RESTART 2017-02-18 15:07:34 +10:00
Stenzek 4094268009 Vulkan: Use TRIANGLE_LIST when primitive restart is not supported 2017-02-18 15:07:33 +10:00
Stenzek 6965dc0481 Vulkan: Don't enable primitive restart on list topologies 2017-02-18 15:07:32 +10:00
Florent Castelli 8c82607c95 cmake: Don't use unqualified target_link_libraries
You can't mix unqualified and qualified link libraries (PUBLIC / PRIVATE).
Use the modern form.
2017-02-08 03:07:43 +01: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 468f623d27 ShaderGenCommon: Remove unnecessary includes 2017-02-01 12:19:55 -05:00
Lioncash 273ace7bb7 LightingShaderGen: Remove unnecessary includes 2017-02-01 01:06:00 -05:00
Stenzek 3b218c64b1 Vulkan: Refactor initialization to only use a single instance
Hopefully will fix the crash in vkDestroyInstance on the NV Shield TV,
and likely reduce boot times slightly for drivers that take a while
to create instances.
2017-01-29 22:18:53 +10: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
BhaaL 23d99f2f2c specify custom brace style to fix unions
BreakBeforeBraces: Allman apparently includes all styles,
except for AfterUnion (which is false) when using clang-format -dump-config
2017-01-05 12:55:13 +01:00
degasus 41b0c74e30 VideoCommon: Make dst_alpha state implicit. 2017-01-04 20:02:31 +01:00
degasus b7d8bd13a6 OGL/Vulkan: Drop dual pass alpha. 2017-01-04 19:59:41 +01:00
Markus Wick 96314a0ec1 Merge pull request #4574 from stenzek/vulkan-alpha-clear
Vulkan: Clear alpha channel to 0 when pixel format has no alpha channel
2017-01-02 12:29:36 +01:00
Jules Blok ee7a2edf35 Update comments 2016-12-27 21:32:52 +01:00
Jules Blok 65b5765858 VideoBackends: Clamp the range to the maximum depth value supported in the z buffer. 2016-12-27 20:25:40 +01:00
Jules Blok 2ab6711f43 VideoBackends: Use the full depth range when inverted depth range is unsupported. 2016-12-27 14:31:17 +01:00
Jules Blok ef82aebb97 VideoCommon: Don't process the depth range in the vertex shader if it's not oversized. 2016-12-27 14:31:17 +01:00
Stenzek e6249619a0 Vulkan/GL: Set the alpha channel to 0 when creating the EFB framebuffer 2016-12-27 13:06:08 +10:00
Stenzek d1dd910f17 Vulkan: Clear alpha channel to 0 when pixel format has no alpha channel 2016-12-27 12:59:52 +10:00
degasus abf9bb170b TextureCache: Drop unused parameter in backend API. 2016-12-26 22:10:32 +01:00
degasus 04f319066d TextureCache: Extract BP enum check to VideoCommon.
We have TOO many video backends.
2016-12-26 22:10:21 +01:00
Mat M 9160be50db Merge pull request #4224 from lioncash/tcache
TextureCacheBase: Eliminate static state
2016-12-23 04:33:42 -05:00
Markus Wick b5fe0b5b83 Merge pull request #4528 from stenzek/vulkan-descriptor-crash
Vulkan: Fix crash where a potentially deleted buffer is referenced
2016-12-20 11:11:54 +01:00
Stenzek 9290bf5844 Vulkan: Fix crash where a potentially deleted buffer is referenced
This happened when the geometry shader was disabled, and the uniform
buffer was grown to a larger size. The update would be skipped, leaving
the old buffer to be included in the descriptor set.
2016-12-19 22:00:42 +10:00
Stenzek accce4294a TextureCache: Use same color coefficients for EFB2Tex as EFB2RAM 2016-12-15 02:20:46 +10:00
Lioncash 58a5395173 TextureCacheBase: Eliminate static state 2016-12-09 16:50:37 -05:00
Stenzek af706efaef Vulkan: Fix viewport depth when depth clamp is unsupported 2016-12-09 22:45:10 +10:00
Léo Lam 31ccfffd38 Common: Add alignment header
Gets rid of duplicated alignment code.
2016-12-06 20:33:53 +01:00
Stenzek bff394ec8a Merge pull request #4489 from stenzek/vulkan-minor-fixes
Vulkan: Minor fixes
2016-12-05 12:19:49 +10:00
Stenzek 8f97a24904 Vulkan: Enable GS instancing 2016-12-04 20:53:49 +10:00
Stenzek 9736198c3b Vulkan: Use explicit barriers instead of dependancies
At least on NV, some of these don't seem to have the intended effect. One
known instance of this is in texture conversion.
2016-12-04 20:10:13 +10:00
Stenzek a475792163 Vulkan: Fix incorrect logic in readback preemption
This could have been causing a large number of command buffer
submissions per frame, depending on when the readbacks occured.
2016-12-04 20:10:13 +10:00
Stenzek 58978c1440 Vulkan: Faster path for decoding XFB data
Using a texel buffer as the copy destination removes the need to copy to
an intermediate texture first.
2016-12-04 20:10:13 +10:00
Stenzek 804cd0ff03 Vulkan: Move XFB encoding/decoding to TextureConverter 2016-12-04 20:10:13 +10:00
Stenzek d67463e0a7 Vulkan: Simplify palette texture conversion 2016-12-04 20:10:13 +10:00
Stenzek add638538b Vulkan: Combine PaletteTextureConverter and TextureEncoder classes 2016-12-04 20:10:13 +10:00
Stenzek 804af42ccc Vulkan: Support binding texel buffers in UtilityShaderDraw 2016-12-04 20:10:13 +10:00
Stenzek e241ec6666 Vulkan: Implement StagingTexture2D on top of StagingBuffer
Greatly simplifies things, and we weren't using the linear texture
implementation anyway.
2016-12-04 20:10:13 +10:00
Stenzek 4bc0e14995 Vulkan: Use an enumeration to index pipeline layouts 2016-12-04 20:10:13 +10:00
Stenzek cd3481fbc7 Vulkan: Differentiate between descriptor set layouts and bind points
This also moves the pipeline and descriptor set layouts used for texture
conversion (texel buffers) to ObjectCache, and shares a binding location
with the SSBO set.
2016-12-04 20:10:13 +10:00
Stenzek 4e9018049d Vulkan: Support logging debug reports without enabling validation layers
There is a caveat, Host GPU must be checked prior to starting the game, as
we can't enable the extension at runtime without recreating the instance.
2016-12-04 19:55:12 +10:00
Stenzek 1cfb0a1185 Vulkan: Fix deadlock in some resize scenarios
Only have experienced this on a few occasions when using the anv driver.
2016-12-04 19:12:33 +10:00
Stenzek 2ef884893a Vulkan: Fix map error when texture dumping is enabled 2016-12-04 00:23:34 +10:00
Stenzek 4c860ddb70 Vulkan: Fix typo in PopulateBackendInfoMultisampleModes 2016-12-04 00:23:30 +10:00
Stenzek 730ec3809a Vulkan: Remove unused variable 2016-12-04 00:23:25 +10:00
Stenzek 7b1966a680 Vulkan: Fix assertion triggering when geometry shaders are unsupported
Happened when loading the pipeline UID cache.
2016-12-02 17:37:10 +10:00
Stenzek ca691a9d95 Vulkan: Allow re-use of uniform buffers when doing per-stage uploads
This is safe now because we invalidate the pointers after submitting a
command buffer.
2016-11-30 23:34:46 +10:00
Stenzek 6a4eba1153 Vulkan: Replace explicit command buffer submits with wrapper function
Should we ever introduce anything else that has to be done when a command
buffer is executed (e.g. invalidating constants from previous commit), we
don't have to update all the callers.
2016-11-30 23:14:36 +10:00
Stenzek 3adeacb78d Vulkan: Fix case where uniforms could be overwritten
If a draw caused a command buffer submission, the current uniform storage
should not be used for the new command buffer.
2016-11-30 23:14:35 +10:00
Stenzek 4c11735bd5 Vulkan: Fix case where a draw's vertices could be overwritten
This could happen because the vertex memory was already committed, if a
uniform buffer allocation failed and caused a command buffer to be
executed, it would be associated with the previous command buffer rather
than the buffer containing the draw that consumed these vertices.
2016-11-30 22:45:00 +10:00
Stenzek 37550501cc Vulkan: Fix incorrect handling of buffer wrap-around in StreamBuffer
This was happening when a fence wait happened mid-frame. The data written
between the fence being queued and the allocation occuring was incorrectly
assumed to be consumed by the GPU.
2016-11-30 22:44:52 +10:00
Stenzek 0212741574 Merge pull request #4436 from stenzek/vulkan-full-ir-framedump
VideoBackends: Internal resolution frame dumping
2016-11-28 22:05:16 +10:00
Stenzek 1c1a686f63 Vulkan: Support full resolution frame dumping 2016-11-28 21:54:55 +10:00
Stenzek 8d48319414 Vulkan: Validate the pipeline cache before using it
This ensures that if a user changes adapters or vendors we're not passing
invalid data to the driver.
2016-11-28 21:21:55 +10:00
Stenzek 9604b336c8 Vulkan: Don't destroy the device's pipeline cache on MSAA mode change
The user could switch back again, and this would mean this data would be
lost. Disk space is cheap, and it's not going to be much.
2016-11-28 21:21:54 +10:00
Stenzek aac66a1b61 Vulkan: Implement a pipeline UID cache
This stores enough information to recreate the pipeline, including the
shader UIDs, blend/depth/rasterization state, primitive and vertex format.
2016-11-28 21:21:53 +10:00
Stenzek 6db0ee9561 VideoCommon: Remove backbuffer size parameters from methods
We have the s_backbuffer_{width,height} fields to represent this, so
there's no point in passing them as parameters every time.
2016-11-28 20:14:59 +10:00
Stenzek a0a62c0f46 VideoConfig: Add option for full-resolution frame dumping 2016-11-28 20:14:59 +10:00
Stenzek e66373b7ff Merge pull request #4456 from stenzek/vulkan-framedump-fix-2
Vulkan: Fix black borders in frame dumps
2016-11-28 20:03:08 +10:00
Léo Lam 72e3f1ecec Remove unnecessary ConfigManager includes
Making changes to ConfigManager.h has always been a pain, because
it means rebuilding half of Dolphin, since a lot of files depend on
and include this header.

However, it turns out some includes are unnecessary. This commit
removes ConfigManager includes from files which don't contain
SConfig or GPUDeterminismMode or GPU_DETERMINISM (which means the
ConfigManager include is not used).

(I've also had to get rid of some indirect includes.)
2016-11-27 22:38:38 +01:00
Stenzek 6b88a854a7 Vulkan: Handle strided XFB copies
Where src_rect.width * 2 != dst_stride.
2016-11-19 20:29:47 +10:00
Stenzek 725ef4c5dc Vulkan: Pass target_rect to framebuffer draw methods
Fixes the black borders in frame dumps when the window was not sized to
the framebuffer aspect ratio.
2016-11-18 22:55:22 +10:00
Stenzek 3c92b35422 Vulkan: Use multiple command pools, one per frame
Instead of resetting two command buffers, now we only have to call
vkResetCommandPool once at the start of a frame.

NV's recommends using one pool per frame/thread. May offer a very small
boost in performance on some systems.
2016-11-15 00:40:15 +10:00
Stenzek bd67adb362 Vulkan: Use correct sample count for EFB pokes with MSAA enabled 2016-11-14 20:24:16 +10:00
Stenzek 89176fe2ab Vulkan: Fix crash on EFB poke 2016-11-14 20:19:59 +10:00
Markus Wick bc98ec77be Merge pull request #4441 from stenzek/vulkan-max-image-count
Vulkan: Handle maxImageCount of zero when creating swap chain
2016-11-13 14:12:32 +01:00
Markus Wick c723532f0d Merge pull request #4430 from stenzek/vulkan-no-relaxed-vsync
Vulkan: Don't use FIFO_RELAXED present mode for vsync.
2016-11-13 14:10:58 +01:00
Stenzek 160fee6791 Vulkan: Handle maxImageCount of zero when creating swap chain
anv seems to set this to zero, which is fine according to the spec, but
we were using it as a maximum, which was resulting in a swap chain
without any buffers being created.
2016-11-11 23:33:40 +10:00
Stenzek 38c3ca5cd4 Vulkan: Implement asynchronous frame dumping 2016-11-10 01:07:46 +10:00
Stenzek c09ce029df Vulkan: Don't use FIFO_RELAXED present mode for vsync. 2016-11-07 19:22:27 +10:00
degasus be29090aae AVIDump: Add a struct for the state.
So AddFrame use no global state and can be threaded well.
2016-11-04 18:35:42 +01:00
Stenzek c880c37244 Vulkan: Rename screenshot buffer to frame dump buffer.
Name makes more sense given the methods it calls in the base class.
2016-11-03 22:38:48 +10:00
Stenzek 9aed27cdcf Vulkan: Combine frame dumping and present into one command buffer.
Small optimization that should make things slightly more efficient when
frame dumping is enabled.
2016-11-03 22:38:48 +10:00
Stenzek 690a6deeb3 Vulkan: Fix swapped top/bottom images in TAB stereo mode 2016-11-03 22:33:24 +10:00
Stenzek 70eb904536 Vulkan: Fix incorrect geometry shader input/output usage 2016-11-03 22:33:24 +10:00
Stenzek 5250f3c6a4 Vulkan: Add missing call to ObjectCache::RecompileSharedShaders
This was causing issues when the stereo mode was changed at runtime.
2016-11-03 22:33:24 +10:00
Stenzek d67877d27e Vulkan: Fix fast clear path not being used in all cases 2016-11-03 22:33:24 +10:00
Stenzek 5182e6b549 Vulkan: Implement virtual/real XFB support 2016-11-03 22:33:24 +10:00
Stenzek 3593fa27ab Vulkan: Move CopyRectangleFromTexture to TextureCache 2016-11-03 22:01:55 +10:00
Stenzek 01b3c0f036 Vulkan: Make TextureCache::TCacheEntry public 2016-11-03 22:01:54 +10:00
Stenzek b066d51dfa Vulkan: Remove parameters/members of single-instance classes
There's not a lot of point in passing these around or storing them
(texture cache/state tracker mainly) as there will only ever be a single
instance of the class.

Also adds downcast helpers such as Vulkan::Renderer::GetInstance().
2016-11-03 22:01:54 +10:00
JosJuice 1081497cad DiscIO/SConfig: Rename GetUniqueID to GetGameID
We call this "game ID" everywhere else, and it's not
actually completely unique.
2016-10-29 15:24:02 +02:00
Jules Blok 2536e37ec5 Merge pull request #4194 from Armada651/efb-source-format
PixelShaderGen: Add support for RGBA6 EFB format truncation.
2016-10-21 21:45:29 +00:00
Jules Blok ab5054c34e VideoBackends: Always enable dual-source blending if supported. 2016-10-10 17:32:51 +02:00
degasus 9f264c0872 AVIDump: Move CoreTiming into caller. 2016-10-10 12:03:18 +02:00
degasus 64927a2f81 Renderer: Merge screenshot logic into VideoCommon. 2016-10-08 19:38:57 +02:00
degasus db0509560e AVIDump: Hard code rgba. 2016-10-08 18:16:32 +02:00
degasus 0864ef4352 VideoCommon: Add custom stride for framedumping. 2016-10-08 15:44:54 +02:00
degasus b5a91e1dfa Framedumps: Add finish() function to limit memory lifetime. 2016-10-08 15:39:22 +02:00
Markus Wick 6e8901de17 Merge pull request #4315 from stenzek/vulkan-aspect
Vulkan: Handle forced aspect ratio changes at runtime
2016-10-08 11:53:22 +02:00
Stenzek 176b00ded7 Vulkan: Handle forced aspect ratio changes at runtime 2016-10-08 18:59:46 +10:00
degasus e82cf46436 Vulkan: Use VideoCommon framedump helpers. 2016-10-07 23:17:16 +02:00
Stenzek 010514bd39 Vulkan: Use correct source format to determine palette size
Fixes blur in fortune street fifologs.
2016-10-06 21:55:27 +10:00
Stenzek b39ac950eb Vulkan: Don't save borders to screenshots/frame dumps
This matches the behavior on GL, making for easier comparisons.
2016-10-05 22:28:51 +10:00
Stenzek 400ba3c7e5 Vulkan: Stop dumping frames on shutdown if left enabled 2016-10-05 22:28:51 +10:00
Stenzek c422fb7e82 Vulkan: Set alpha channel of swap chain buffers to 1.0.
Copying the alpha channel from the game causes issues with frame dumping,
since we're using a buffer directly from the GPU as a source for AVIDump.
2016-10-05 22:02:04 +10:00
Stenzek abb5a64919 Merge pull request #4295 from stenzek/vulkan-dbz-bloom
Vulkan: Fix bug with palette converted EFB copies
2016-10-05 20:24:36 +10:00
Markus Wick ef1bfc26b2 Merge pull request #4291 from degasus/shader_gen
PixelShaderGen: Fix UID issues.
2016-10-05 12:20:58 +02:00
Stenzek db09c05eec Vulkan: Fix bug with palette converted EFB copies
This happened when the source texture was an EFB copy, therefore it had
not been populated prior to the draw command buffer being executed, and
the conversion was occurring in the init command list.
2016-10-04 22:30:37 +10:00
shuffle2 ea33405feb Merge pull request #4270 from stenzek/vulkan-defer-fix
Vulkan: Miscellaneous minor fixes
2016-10-04 01:47:59 -07:00
degasus 829fc8f0ad PixelShaderGen: Drop dstAlphaMode constant in shader generation.
It is already stored within the UID.
2016-10-04 10:13:46 +02:00
Shawn Hoffman 86112c7258 VideoCommon: Minor changes
Make Renderer::GetMaxTextureSize return u32 instead of int.
2016-10-03 06:51:46 -07:00
Stenzek 28e5fa8d26 Vulkan: Handle both destination alpha and logic ops being enabled
Same way as GL with the dual-pass fallback. Not highly accurate, but does
fix the Kirby shadow bug.
2016-10-03 19:11:50 +10:00
Stenzek f595fe080f Vulkan: Fix bug with fractional LOD bias and min/max LOD 2016-10-03 19:11:48 +10:00
Stenzek 5e29508b8f Vulkan: Fix vsync behavior when throttler is temp disabled 2016-10-03 19:11:48 +10:00
Stenzek b193282830 Vulkan: Correct logic for handling target and window size changes
Should fix a possible reference to deleted framebuffers, as well as fixing
the issues with the render area being correct if the game's source area
changes, or auto-scaling is enabled.
2016-10-03 19:11:47 +10:00
Stenzek 7d14b9b48b Vulkan: Add missing call to TextureCache::OnConfigChanged
This was preventing certain settings from being updated when changed at
runtime.
2016-10-03 19:11:47 +10:00
Stenzek 4a8766cec4 Vulkan: Fix resource leaks present at shutdown and mode changes
Infrequent, but still happened.
2016-10-03 19:11:47 +10:00
Stenzek 1286c309e3 Vulkan: Fix compilation on 32-bit targets 2016-10-03 19:11:47 +10:00
Lioncash 9395b8efa9 Vulkan: Amend header includes
Adds headers where necessary to eliminate indirect includes.
Also adds headers to ensure certain standard constructs always
resolve correctly
2016-09-30 23:26:03 -04:00
Stenzek 5f66cf5ed7 Vulkan: Only submit init/upload command buffer when it has commands
This way we're not submitting empty buffers when it's unnecessary.
2016-10-01 02:40:03 +10:00
Stenzek f6cdc38c8b Vulkan: Use render-pass based clears where possible 2016-10-01 02:40:02 +10:00
Stenzek c290398320 Vulkan: Ensure fast path is used for non-RGBA formats when clearing 2016-10-01 02:40:02 +10:00
Stenzek f4944f006d Vulkan: Support frame dumping/screenshots 2016-10-01 02:40:02 +10:00
Stenzek 77a128ab87 Implement experimental Vulkan backend 2016-10-01 02:40:01 +10:00