Commit graph

2353 commits

Author SHA1 Message Date
Pokechu22
4595b89ad8 VideoCommon: Remove bSupportsOversizedViewports
I think this is a relic of D3D9.  D3D11 and D3D12 seem to work fine without it.  Plus, ViewportCorrectionMatrix just didn't work correctly (at least with the viewports being generated by the new scissor code).
2022-04-16 10:26:11 -07:00
Pokechu22
59f299d5d6 Software: Fix zfreeze with CullMode::All 2022-04-08 20:05:32 -07:00
Pokechu22
164e0f742d Software: Store offset in Slope
This is needed since we need a separate offset for zfreeze to work correctly.  It also makes the code a bit less jank.
2022-04-08 20:05:32 -07:00
Pokechu22
3a742e99bb Software: Remove config to disable ZComploc and ZFreeze
These aren't particularly useful, and make the code a bit more confusing.  If for some reason someone wants to test what happens when these functions are disabled, it's easier to just edit the code that implements them.  They aren't exposed in the UI, so one would need to restart Dolphin to do it anyways.
2022-04-08 20:05:32 -07:00
Pokechu22
af316f7bfe Software: Implement pixel engine alpha read mode 2022-03-29 15:34:43 -07:00
iwubcode
69e79045a3 VideoBackends: fix opengl object label which was given an invalid enumeration as the identifier parameter. Most implementations will warn in this case but there is an implementation that will crash (ANGLE) 2022-03-24 00:25:59 -05:00
Pokechu22
c657b80996 Software/EfbInterface: Remove logspam for RGB565_Z16 being unsupported
This message would be logged, usually multiple times, for EVERY. SINGLE. PIXEL. That's pretty much useless and just makes the log unreadable. Plus, the current support (which acts as RGB8) is close enough that for end-user purposes, it's fine.  I don't think the hardware backends support RGB565_Z16 and its antialiasing functionality correctly either, but they don't have similar logspam.
2022-03-08 13:59:55 -08:00
Pokechu22
7d76eea4ea OGLRender: Log video backend info, in addition to showing it via OSD
This is mainly intended for debugging fifo.ci.
2022-02-23 18:30:02 -08:00
Pokechu22
444f6fd0cb Treat alpha as 0 if alpha is 1 for blending
This removes the white box in fortune street again, without causing Mario Kart Wii to regress.
2022-02-08 15:15:15 -08:00
Pokechu22
0327e6acb4 Use the same logic for lerp bias for color and alpha
It doesn't make sense for alpha to add the bias ONLY when dividing by 2, while color doesn't apply the bias for divide by 2 only; hardware testing indicates that alpha should have the bias.

This fixes the menus in Mario Kart Wii (https://bugs.dolphin-emu.org/issues/11909) but reintroduces the white rectangle in Fortune Street.

This reverts commit 5aaa5141ed (and several other matching changes elsewhere).
2022-02-08 15:15:15 -08:00
OatmealDome
a9b5188047 OGLMain: Set default value for bSupportsSettingObjectNames 2022-02-08 14:53:51 -05:00
Mai M
40cda23491
Merge pull request #10404 from iwubcode/vulkan_headers_update
Externals / Vulkan: update Vulkan headers to v1.3.204
2022-02-04 01:04:29 -05:00
JMC47
4d1e6ff76a
Merge pull request #10422 from OatmealDome/opengl-shader-crash
VideoConfig: Add flag for whether the system supports setting object names
2022-01-31 01:25:46 -05:00
OatmealDome
8be3572c83 D3D12: Assume support for setting object names 2022-01-31 01:17:40 -05:00
OatmealDome
73d957f65c D3DMain: Assume support for setting object names 2022-01-31 01:17:40 -05:00
OatmealDome
4c7fe45475 VKShader: Only set shader name if supported 2022-01-31 01:17:40 -05:00
OatmealDome
28f3cb3d97 VKTexture: Only set texture name if supported 2022-01-31 01:17:40 -05:00
OatmealDome
a8ce71fcd4 VulkanContext: Set bSupportsSettingObjectNames based on extension initialization result 2022-01-31 01:17:40 -05:00
OatmealDome
801897467c VulkanEntryPoints: Make vkSetDebugUtilsObjectNameEXT an instance function 2022-01-31 01:17:40 -05:00
OatmealDome
a720083a7e Revert "Vulkan: Check for vkSetDebugUtilsObjectNameEXT before using it"
This reverts commit 2ab66390f8.
2022-01-31 01:17:40 -05:00
OatmealDome
b36c866398 OGLTexture: Only set texture name if supported 2022-01-31 01:17:40 -05:00
OatmealDome
ea1ac73c38 OGLShader: Only set shader name if supported 2022-01-31 01:17:40 -05:00
OatmealDome
390cc13834 OGLRender: Set object name support on GL >4.3 and GL ES 3.2 2022-01-31 01:17:40 -05:00
OatmealDome
947b562e06 VideoConfig: Add flag for whether the system supports setting object names 2022-01-31 01:17:37 -05:00
iwubcode
8e3dbe9671 Externals / Vulkan: update Vulkan headers to v1.3.204. Fix default present mode in Vulkan swap chain 2022-01-29 00:47:51 -06:00
JosJuice
7b8e846d0a
Merge pull request #10367 from Pokechu22/fmt-8.1.1
Update to fmt 8.1.1
2022-01-20 21:14:41 +01:00
Léo Lam
83c5446d85
Fix static initialisation order fiasco issue for Version variables
Fixes a crash that could occur if the static constructor function for
the MainSettings.cpp TU happened to run before the variables in
Common/Version.cpp are initialised. (This is known as the static
initialisation order fiasco.)

By using wrapper functions, those variables are now guaranteed to be
constructed on first use.
2022-01-14 00:04:22 +01:00
Pokechu22
78e43a4404 Make all custom fmt::formatter's format functions const
fmt 8.0.0 requires this.
2022-01-13 11:11:08 -08:00
Pokechu22
ca9bf3174f Use HRWrap in remaining locations
Note that D3DCommon can't use DX11HRWrap or DX12HRWrap since it's shared between them.
2022-01-09 12:44:55 -08:00
Pokechu22
1b32e6dae2 VideoBackends/D3D12: Include HRESULT in error messages 2022-01-09 12:44:53 -08:00
Pokechu22
23cdb5c576 VideoBackends/D3D11: Include HRESULT in error messages 2022-01-09 12:44:15 -08:00
Pokechu22
82acfa6a46 VideoBackends/D3D: Eliminate CHECK in favor of ASSERT_MSG 2022-01-09 12:44:13 -08:00
Pokechu22
161c627466 Treewide: Remove unused inclusions of <cinttypes>
Most of these became unneeded when fmt was introduced.
2022-01-09 12:43:11 -08:00
JosJuice
2ab66390f8 Vulkan: Check for vkSetDebugUtilsObjectNameEXT before using it
Fixes a crash that has been present on Android (and probably also
macOS) since f6883a0.
2022-01-03 20:17:57 +01:00
Admiral H. Curtiss
8af737d3bd
D3D12: Fix nullptr dereference when creating a shader with a name. 2022-01-03 17:14:09 +01:00
Léo Lam
13939b13d7
Merge pull request #10311 from JosJuice/gles-sampler2dmsarray
GLES: Fix missing precision for sampler2DMSArray
2022-01-01 16:49:34 +01:00
OatmealDome
9ff7f80aa0 VulkanContext: Ensure present queue family is valid before incrementing queueCreateInfoCount 2021-12-28 21:18:47 -05:00
JosJuice
76b508557e GLES: Fix missing precision for sampler2DMSArray
We don't use sampler2DMS, but we do use sampler2DMSArray.

I can't reproduce it on my phone, but a user who was running GLES
on a Tegra X1 reported a shader compilation error related to this.
2021-12-28 11:36:11 +01:00
OatmealDome
91cdeb5aa6 SamplerCache: Check for bSupportsLodBiasInSampler instead of IsGLES 2021-12-25 15:17:19 -05:00
OatmealDome
08396c56e5 VideoConfig: Add bool for sampler LOD bias support 2021-12-25 15:16:27 -05:00
JMC47
b1f79d9ecf
Merge pull request #10215 from OatmealDome/shader-logic-ops
VideoCommon: Support shader logic ops on Metal (Apple GPUs) and OpenGL ES
2021-12-22 16:39:54 -05:00
Pokechu22
27cb704466 Eliminate VarType for ComponentFormat 2021-12-18 15:21:48 -08:00
Pokechu22
3aaeb2b9ef Convert OpcodeDecoder::Opcode and OpcodeDecoder::Primitive to enum class 2021-12-18 12:51:56 -08:00
Pokechu22
3fc12431c5 Remove parameters to SWVertexLoader::SetFormat
They haven't been used since efbe5bc4b6.
2021-12-18 12:51:56 -08:00
Pokechu22
2025763420 Treewide: Adjust order of includes 2021-12-10 14:49:57 -08:00
OatmealDome
1c421444ae ProgramShaderCache: Don't define FB_FETCH_VALUE for GL_EXT_shader_framebuffer_fetch
We will automatically choose between real_ocol0 and ocol0 in the fragment shader.
2021-12-06 22:36:40 -05:00
OatmealDome
f87f704f43 ShaderCompiler: Add helpers for Metal framebuffer fetch 2021-12-06 22:36:39 -05:00
OatmealDome
40eb071562 ShaderCompiler: Add new helper define for input attachment binding 2021-12-06 22:36:39 -05:00
OatmealDome
8e72136eeb VulkanContext: Set Apple GPUs as supporting framebuffer fetch 2021-11-24 17:52:24 -05:00
JMC47
dbaebdc585
Merge pull request #10222 from phire/fix-copy-filter-clamping
Fix copy filter clamping
2021-11-18 17:48:33 -05:00
Pokechu22
1adff1c467 VideoCommon: Skip textureQueryLevels if it doesn't exist 2021-11-17 21:28:39 -08:00
Pokechu22
b9288212a0 Software: Adjust diagonal LOD implementation
This produces behavior matching the behavior on hardware (see Wario's Gold Mine in Mario Kart Wii).
2021-11-17 20:04:34 -08:00
Pokechu22
51e3334526 VideoCommon: Use coarse derivatives for Manual Texture Sampling if possible 2021-11-17 20:04:34 -08:00
Pokechu22
4a9b26de86 VideoCommon: Expose SamplerState to shaders
The benefit to exposing this over the raw BP state is that adjustments Dolphin makes, such as LOD biases from arbitrary mipmap detection, will work properly.
2021-11-17 20:04:34 -08:00
Pokechu22
6236a0d494 Eliminate SamplerCommon 2021-11-17 20:04:34 -08:00
Pokechu22
3096f77ba0 Eliminate SamplerCommon::AreBpTexMode0MipmapsEnabled
This was added in 0b9a72a62d but became irrelevant in 70f9fc4e75 as the check is now self-explanatory due to a rejiggering of the bitfields.
2021-11-17 20:04:34 -08:00
Scott Mansell
9bbc843542 VideoSoftware: Fix copy filter clamping 2021-11-17 09:29:16 +13:00
OatmealDome
2209dc0355 MoltenVK: Use an external project instead of a pre-compiled dylib
Also, update MoltenVK to match Vulkan SDK 1.2.189.
2021-11-13 11:43:23 -08:00
Pokechu22
04d8cdfe88 Convert LOG_TYPE and LOG_LEVELS to enum class 2021-10-24 11:48:36 -07:00
Fletcher Porter
f16e9045a2 Silence the -Wswitch warnings in Tev
The compiler was loudly announcing each and every branch Tev was not checking in
a switch statement, but Tev has learned it's lesson and will produce that
warning no more.
2021-10-13 23:54:06 -07:00
Pokechu22
78bfd25964 Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
Scott Mansell
9fa26624b0 BPMemory: Refactor/consolidate TexUnit Addressing
Currently the logic for addressing the individual TexUnits is splattered all
across dolphin's codebase, this commit attempts to consolidate it all into a
single place and formalise it using our new TexUnitAddress struct.
2021-10-10 09:09:43 +13:00
Léo Lam
ff1cb5a1c0
Merge pull request #9803 from Techjar/bbox-videocommon
VideoCommon: Abstract bounding box
2021-10-08 22:24:38 +02:00
Techjar
1161af8059 VideoCommon: Abstract bounding box
This moves much of the duplicated bounding box code into VideoCommon,
leaving only the specific buffer implementations in each backend.
2021-10-04 15:51:24 -04:00
OatmealDome
a256c11d2f DriverDetails: Add broken dual source blending bug to MoltenVK on Intel GPUs 2021-09-20 19:14:41 -04:00
OatmealDome
aa64f7f14f VulkanContext: Don't assume anv for Intel GPUs on macOS 2021-09-20 18:57:19 -04:00
OatmealDome
7e8f5208fe VulkanContext: Disable subgroup reduction on macOS with AMD GPUs 2021-09-16 23:32:10 -04:00
iwubcode
1f2f505373 VideoBackends / VideoCommon: allow the ability to set debug names for shaders / textures. These names are visible in applications like RenderDoc 2021-08-30 13:47:48 -05:00
Léo Lam
815b590dfe
Update clang-format to version 12
12 is the latest release and various editors (VS, VSCode and CLion)
ship with clang-format 12 by default.
2021-08-30 00:20:18 +02:00
Robin Kertels
40dcf1c2e2
D3D12: Transition compute textures to UAV state 2021-08-11 00:17:04 +02:00
OatmealDome
d453390c48 ShaderCompiler: Attach source text to SPIR-V for debuggers like RenderDoc 2021-08-05 03:04:18 -04:00
Pokechu22
3a4d8379bf Convert NaN to 1 when generating texture coordinates
This fixes eyelids in Shadow the Hedgehog during cutscenes (https://bugs.dolphin-emu.org/issues/11458)
2021-07-24 22:20:35 -07:00
Pokechu22
fa9c43cfaa Software: Handle texture wrapping more accurately
This fixes various texture offsetting issues with negative texture coordinates (bringing the software renderer in line with the hardware renderers).  It also handles the invalid wrap mode accurately (as was done for the hardware renderers in the previous commit).  Lastly, it handles wrapping with non-power-of-2 texture sizes in a hardware-accurate way (which is somewhat broken looking, as games aren't supposed to use wrapping with non-power-of-2 sizes); this has not been done for the hardware renderers.
2021-07-20 19:23:23 -07:00
Pokechu22
2feced2e33 Fix indirect textures when format is not ITF_8 2021-07-08 15:48:14 -07:00
Pierre Bourdon
e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
JMC47
46120a6108
Merge pull request #9742 from Pokechu22/sw-resolution
Software: Fix bad backbuffer size
2021-06-23 18:36:04 -04:00
Pokechu22
51862135d6 Software: Remove texinfo.sourcerow == SourceRow::Colors assert
These asserts were removed for the hardware renderer in #3684.
2021-06-20 18:05:57 -07:00
Léo Lam
2898cf5121
Merge pull request #9784 from PEmu2/master
Update buffer_storage warning message
2021-06-13 12:56:26 +02:00
Pokechu22
c583cac568 Hack to hide debug cubes in Super Mario Sunshine
... while not breaking other games.
2021-06-09 20:50:49 -07:00
Connor McLaughlin
c729852d72
Merge pull request #9782 from Techjar/bbox-ogl-upsidedown-fix
VideoCommon: Perform OpenGL bounding box inversion in pixel shader
2021-06-08 13:24:03 +10:00
Techjar
58238e75a7 Vulkan: Fix subgroup reduction
It seems that we were writing values from helper invocations, which
produces wrong results.
2021-06-07 22:32:25 -04:00
Techjar
4866002c9b VideoCommon: Perform OpenGL bounding box inversion in pixel shader
Running the min/max operation on the upside down, quad-rounded pixel
coordinates before inverting them to the standard upper-left origin
produces wrong results. Therefore, we need to do the inversion before
rounding to pixel quads.
2021-06-06 20:55:06 -04:00
PEmu2
44206b7702
Update buffer_storage warning message 2021-06-05 15:08:47 -07:00
Techjar
2f1b639f0a VideoCommon: Restore BBox* forwarding functions 2021-05-31 18:01:47 -04:00
Connor McLaughlin
b3a414ea9d
Merge pull request #9766 from stenzek/ogl-bbox-memory-barrier
OGL: Force memory barrier when reading back bounding box values
2021-05-29 17:04:57 +10:00
Connor McLaughlin
6393f157f0 OGL: Force memory barrier when reading back bounding box values
We also need to ensure the the CPU does not receive stale values
which have been updated by the GPU. Apparently the buffer here
is not coherent on NVIDIA drivers. Not sure if this is a driver
bug/spec violation or not, one would think that
glGetBufferSubData() would invalidate any caches as needed, but
this path is only used on NVIDIA anyway, so it's fine. A point
to note is that according to ARB_debug_report, it's moved from
video to host memory, which would explain why it needs the
cache invalidate.
2021-05-29 16:57:40 +10:00
Techjar
a24e78b3cf VideoCommon: Remove BBox* forwarding functions 2021-05-29 01:45:21 -04:00
Techjar
e4aef0a85b VideoCommon: Move bounding box pixel quads rounding to shader
This avoids rounding values that the game writes to the bounding box
registers, especially the default values.
2021-05-28 23:30:22 -04:00
Connor McLaughlin
7fd0a526e1 VideoBackends/OGL: Cache bounding box values between reads 2021-05-28 19:30:46 +10:00
Connor McLaughlin
0c11dca121 VideoBackends/D3D: Cache bounding box values between reads 2021-05-28 19:30:46 +10:00
Pokechu22
4a4244f04d Software: Fix bad backbuffer size
MAX_XFB_WIDTH/HEIGHT are the largest XFB sizes seen in practice, but do not make sense to use for the backbuffer size, which should be the size of the window.  The old code created screenshots with a size of 720x540 on NTSC games when "Dump Frames at Internal Resolution" is unchecked; now, the window size is used.
2021-05-24 12:16:39 -07:00
Techjar
0f17990137 VideoCommon: Split BBox* functions into common and backend implementation variants
This will allow for some aspects of bounding box to be handled in
VideoCommon instead of individual backends.
2021-05-22 01:11:57 -04:00
JosJuice
1d3b9fdec2 Fix perf query regression
When trying to do a small optimization in 8a0f5ea, I failed to
take into account that WeakFlush and FlushOne update m_query_count.

Only D3D11 and OGL had this problem, not D3D12 and Vulkan.
2021-05-21 13:39:59 +02:00
JosJuice
8a0f5ea04a Remove all remaining volatile qualifiers 2021-05-15 09:52:04 +02:00
JosJuice
b93983b50a Remove Atomic.h
The STL has everything we need nowadays.

I have tried to not alter any behavior or semantics with this
change wherever possible. In particular, WriteLow and WriteHigh
in CommandProcessor retain the ability to accidentally undo
another thread's write to the upper half or lower half
respectively. If that should be fixed, it should be done in a
separate commit for clarity. One thing did change: The places
where we were using += on a volatile variable (not an atomic
operation) are now using fetch_add (actually an atomic operation).

Tested with single core and dual core on x86-64 and AArch64.
2021-05-13 18:56:27 +02:00
Pokechu22
16c17ed9ce Software: Fix OOB tex coord indices
Previously we set the texture coordinate to zero, now we set
the texture coordinate *index* to zero. This fixes the ripple
effect of the Mario painting in Luigi's Mansion.
2021-05-07 16:28:09 -07:00
Pokechu22
c3668e179c Split TevStageIndirect::mid into matrix_index and matrix_id 2021-05-07 16:27:52 -07:00
Léo Lam
1c6232e95f
Merge pull request #9646 from PatrickFerry/sw-textureencoder-alignedwidth
SW: Fix alignedWidth in TextureEncoder
2021-04-24 20:13:10 +02:00
JMC47
18e84361d9
Merge pull request #9660 from ezio1900/master
VideoCommon: Fix scissorOffset, handle negative value correctly
2021-04-23 21:21:53 -04:00
ezio1900
97ea3a603e VideoCommon: Fix scissorOffset, handle negative value correctly
VideoCommon: Change the type of BPMemory.scissorOffset to 10bit signed: S32X10Y10
VideoBackends: Fix Software Clipper.PerspectiveDivide function, use BPMemory.scissorOffset instead of hard code 342
2021-04-24 08:46:21 +08:00
JMC47
cfc4af76a9
Merge pull request #9321 from Pokechu22/sw-copyregion
Software: Fix out of bounds accesses in CopyRegion
2021-04-23 14:07:46 -04:00
JMC47
4ab92d4757
Merge pull request #9350 from Pokechu22/sw-viewport
Software: Invert backface test when viewport is positive
2021-04-23 14:06:02 -04:00
Patrick A. Ferry
f6a4368192 SW: Fix alignedWidth in TextureEncoder
This was causing issues in Software Renderer. Look at bug 11487
2021-04-19 02:06:52 +01:00
Connor McLaughlin
b24e3f2f1a Vulkan: Work around AMD exclusive fullscreen bug (21.3+) 2021-04-12 12:41:17 +10:00
Pokechu22
5b1c632862 Software: Invert backface test when viewport is positive
Fixes Jimmie Johnson's Anything with an Engine.
2021-03-06 22:00:16 -08:00
Pokechu22
058c7db80b Software: Fix out of bounds accesses in CopyRegion
Fixes issue 11393.

The problem is that left and top make no sense for a width by height array; they only make sense in a larger array where from which a smaller part is extracted.  Thus, the overall size of the array is provided to CopyRegion in addition to the sub-region.  EncodeXFB already handles the extraction, so CopyRegion's only use there is to resize the image (and thus no sub-region is provided).
2021-03-06 21:58:28 -08:00
Pokechu22
70f9fc4e75 Convert BPMemory to BitField and enum class
Additional changes:
- For TevStageCombiner's ColorCombiner and AlphaCombiner, op/comparison and scale/compare_mode have been split as there are different meanings and enums if bias is set to compare.  (Shift has also been renamed to scale)
- In TexMode0, min_filter has been split into min_mip and min_filter.
- In TexImage1, image_type is now cache_manually_managed.
- The unused bit in GenMode is now exposed.
- LPSize's lineaspect is now named adjust_for_aspect_ratio.
2021-03-06 19:27:19 -08:00
Pokechu22
aab81d5aa0 Convert XFMemory to BitField and enum class
Additionally a new ClipDisable union has been added (though it is not currently used by Dolphin).
2021-03-06 19:27:14 -08:00
Pokechu22
f749fcfa9f Convert CPMemory to BitField and enum class
Additionally, VCacheEnhance has been added to UVAT_group1.  According to YAGCD, this field is always 1.

TVtxDesc also now has separate low and high fields whose hex values correspond with the proper registers, instead of having one 33-bit value.  This change was made in a way that should be backwards-compatible.
2021-03-06 19:27:08 -08:00
Pokechu22
fcd3efa1ae Software: Implement points 2021-02-13 15:59:40 -08:00
Pokechu22
8e348b87e9 Software: Fix line-width effects 2021-02-13 15:59:39 -08:00
Pokechu22
7d5ae03219 Software: Always divide the texture coordinates by q.
Equivalent to da43f9a15 for the software renderer.
2021-02-12 16:37:47 -08:00
Léo Lam
a354814240
Merge pull request #9424 from Pokechu22/sw-no-special-case
Software: Remove normalization special case
2021-02-11 19:36:45 +01:00
Shawn Hoffman
500a694ca8 msbuild: bundle all dolphin "core" code into single library 2021-01-27 14:29:49 -08:00
Shawn Hoffman
5770ff01f3 rename D3DCommon/Common to D3DCommon/D3DCommon 2021-01-27 14:29:48 -08:00
Shawn Hoffman
527b5a9761 normalize common filenames in VideoBackends/D3D12 2021-01-27 14:29:48 -08:00
Shawn Hoffman
a0aeb5b0b9 normalize common filenames in VideoBackends/D3D 2021-01-27 14:29:48 -08:00
Shawn Hoffman
d7fd892fde normalize common filenames in VideoBackends/Vulkan 2021-01-27 14:29:48 -08:00
Shawn Hoffman
ef70fe05bf normalize common filenames in VideoBackends/Null 2021-01-27 14:29:48 -08:00
Shawn Hoffman
ff4f67492b normalize common filenames in VideoBackends/OGL 2021-01-27 14:29:48 -08:00
Pokechu22
e825af7b1b Software: Remove normalization special case
The special case doesn't appear to make a significant difference in any games, and the current implementation has a (minor, fixable) issue that breaks Super Mario Sunshine (both with a failed assertion (https://bugs.dolphin-emu.org/issues/11742) and a rendering issue (https://bugs.dolphin-emu.org/issues/7476)).  Hardware testing wasn't able to reproduce the special case, either, so it may just not exist.

PR #9315 contains a fixed implementation of the special case on all video backends, and can serve as a basis for it being reintroduced if it is found to exist under more specific circumstances.  For now, I don't see a reason to keep it present.
2021-01-03 23:22:48 -08:00
Léo Lam
0ad2f3da45
Core: Remove ImageWrite and get rid of -Wmissing-declarations warnings 2020-12-16 16:04:19 +01:00
Léo Lam
eafe005672
Fix -Wclass-memaccess warnings
We want to clear/memset the padding bytes, not just each member,
so using assignment or {} initialization is not an option.

To silence the warnings, cast the object pointer to u8* (which is not
undefined behavior) to make it explicit to the compiler that we want
to fill the object representation.
2020-12-16 15:37:43 +01:00
Lioncash
139d4fc76e General: Convert PanicAlerts over to fmt equivalent
Converts lingering panic alert calls over to the fmt-capable ones.
2020-12-02 13:38:33 -05:00
blåhaj
bf0fe0281a Fix bounding box incorrectly disabled on OpenGL ES 3.1, 3.2 2020-11-24 21:22:39 +01:00
Stenzek
d6ce8eef36 Software: Use same logic for colors as hardware backends 2020-11-20 15:54:06 -08:00
Jonathan Marek
a20e69ff51
Vulkan: fix validation error in bSupportsGeometryShaders=false case
In CreateDescriptorSetLayouts(), one less dynamic binding is created when
bSupportsGeometryShaders=false. Reduce the dynamicOffsetCount argument by
one in that case. Avoids this validation error:

Attempting to bind 3 descriptorSets with 2 dynamic descriptors, but
dynamicOffsetCount is 3. It should exactly match the number of dynamic
descriptors. The Vulkan spec states: dynamicOffsetCount must be equal to
the total number of dynamic descriptors in pDescriptorSets

Signed-off-by: Jonathan Marek <jonathan@marek.ca>

[Applied clang-format]
Signed-off-by: Léo Lam <leo@leolam.fr>
2020-11-20 12:23:34 +01:00
Lioncash
21dd7a8ebb Vulkan: Migrate logging over to fmt
Migrates the vulkan backend over to the fmt-capable logger.
2020-11-09 03:26:16 -05:00
Lioncash
23a8baa605 Software: Migrate logging over to fmt
Migrates the software backend over to the fmt-capable logger.
2020-11-09 03:14:01 -05:00
Lioncash
413d64e7fc OpenGL: Migrate logging over to fmt
Migrates over to the fmt-capable logger.
2020-11-09 03:09:09 -05:00
Lioncash
4d9a7c7a54 D3DCommon: Migrate logging over to fmt
Migrates the logging over to the fmt-capable logger.
2020-11-09 03:03:26 -05:00
Lioncash
2345d5f98d D3D: Migrate logging over to fmt
Migrates the logging over to the fmt-capable logger.
2020-11-09 03:02:00 -05:00
Lioncash
d7834bd6b4 D3D12: Migrate logging over to fmt
Migrates the logging over to the fmt-capable logger.
2020-11-09 02:59:51 -05:00
JosJuice
28aa04312c Common/LinearDiskCache: Replace std::fstream with File::IOFile
File::IOFile is better suited to this type of task.
Split out from a future PR.
2020-11-05 00:31:17 +01:00
Jordan Woyak
d2f80a4595
Merge pull request #9138 from martymac/VK_NULL_HANDLE-fix
Fix build on FreeBSD i386 - nullptr vs VK_NULL_HANDLE
2020-11-03 08:28:11 -06:00
Ganael Laplanche
d456e2e391 Resolve VkDeviceMemory/nullptr type mismatch to fix build on FreeBSD i386 2020-11-03 07:47:43 +01:00
JMC47
6a3a71cfd7
Merge pull request #9141 from Techjar/but-for-how-long
Re-enable GPU Texture Decoding under MoltenVK
2020-10-29 01:22:13 -04:00
mazes-80
f375ee72a2
CMake: Add option to enable/disable Vulkan video backend 2020-10-23 20:14:46 +02:00
Techjar
0c01712d13 DriverDetails: Remove bug for broken GPU Texture Decoding 2020-10-08 10:13:40 -04:00
Stenzek
24bb947eff Vulkan: Use VK_LAYER_KHRONOS_validation for validation
VK_LAYER_LUNARG_standard_validation is deprecated.
2020-10-01 17:21:46 +10:00
Techjar
69358b2186 VideoBackends: Disable GPU Texture Decoding under MoltenVK
It's broken and causes spectacular artifacts and crashes.
2020-09-07 17:28:05 -04:00
JosJuice
6eefc3c524 Make default graphics backend not show up as empty
Fixes https://bugs.dolphin-emu.org/issues/12245.

I considered making a change to DolphinQt instead of
the core, but then additional effort would've been
required to add the same fix to the Android GUI once
we start using the new config system there.
2020-09-06 12:56:45 +02:00
Shawn Hoffman
969ea6e4f5 msvc: enable /Zc:preprocessor and make build compile cleanly 2020-08-27 21:58:48 -07:00
Shawn Hoffman
4db06bf85b ogl: init ProgramShaderCache::s_ubo_align to 1.
silences a warning that it may cause div-by-zero.
2020-08-27 15:15:52 -07:00
Shawn Hoffman
938fd4e438 use constexpr for some compile-time expressions 2020-08-23 13:57:05 -07:00
Shawn Hoffman
6ef9d70701 name some threads 2020-08-22 17:22:07 -07:00
LC
4a34b74e68
Merge pull request #9035 from shuffle2/vs-pretty
misc vcxproj cleanup
2020-08-22 20:13:25 -04:00
Shawn Hoffman
cff4806d8d windows: fix build if pch were to be disabled 2020-08-22 16:18:24 -07:00
Shawn Hoffman
2f47f486af msbuild: re-enable standalone vcxproj processing 2020-08-22 16:17:50 -07:00
Shawn Hoffman
94bf48b67c msbuild: refactor stuff out of project files (for dolphin) 2020-08-22 16:17:50 -07:00
Shawn Hoffman
3a0d8c0208 msbuild: enable D3DCommon to use pch 2020-08-22 16:17:50 -07:00
Shawn Hoffman
36ace8eb52 prettify some constructs in vcxproj files 2020-08-22 16:17:50 -07:00
LC
487cd7abd9
Merge pull request #8905 from JosJuice/jni-encoding
Android: Use correct encoding when converting strings
2020-07-18 22:13:14 -04:00
Filip Gawin
0ede5d1537 Use range loop (if possible) 2020-07-18 18:29:16 -05:00
JosJuice
15d9fab0bb Common: Rename UTF16ToUTF8
This function does *not* always convert from UTF-16. It converts
from UTF-16 on Windows and UTF-32 on other operating systems.

Also renaming UTF8ToUTF16 for consistency, even though it
technically doesn't have the same problem since it only was
implemented on Windows.
2020-07-08 14:51:35 +02:00
JosJuice
6f298378a1 Reword "Please avoid forcing Dolphin to use MSAA by the driver" message
Some users who get this error don't seem to gain much understanding
of how to resolve the problem from reading the error message.
2020-07-08 11:34:36 +02:00
orbea
ba2d04b793 Externals: Fix build failures with the newer glslang.
v2: Don't include glslang project wide.
2020-05-30 18:54:21 -07:00
Lioncash
86f8768268 VideoCommon/ShaderGenCommon: Make template functions regular functions
These are only ever used with ShaderCode instances and nothing else.
Given that, we can convert these helper functions to expect that type of
object as an argument and remove the need for templates, improving
compiler throughput a marginal amount, as the template instantiation
process doesn't need to be performed.

We can also move the definitions of these functions into the cpp file,
which allows us to remove a few inclusions from the ShaderGenCommon
header. This uncovered a few instances of indirect inclusions being
relied upon in other source files.

One other benefit is this allows changes to be made to the definitions
of the functions without needing to recompile all translation units that
make use of these functions, making change testing a little quicker.

Moving the definitions into the cpp file also allows us to completely
hide DefineOutputMember() from external view, given it's only ever used
inside of GenerateVSOutputMembers().
2020-05-25 21:12:29 -04:00
Stenzek
bf74553878 FramebufferManager: Copy to color format for depth readbacks on GLES
glReadPixels() with depth formats is not supported.

Should fix broken EFB access on GLES.
2020-05-24 16:11:11 +10:00
degasus
fc0df37d94 Fix windows build system. 2020-04-29 12:56:52 +02:00
Léo Lam
0fe4985f8d
Merge pull request #8689 from howard0su/cleanup_sign
Remove warnings of -Wsign-compare
2020-04-28 13:36:21 +02:00
Léo Lam
9d44af4c31
Merge pull request #8696 from howard0su/cleanup_shadow
Cleanup warnings of -Wmissing-declarations
2020-04-27 15:33:01 +02:00
Stenzek
a2f4fafe86 Vulkan: Switch from vkCreateMacOSSurfaceMVK() to vkCreateMetalSurfaceEXT()
Since we are calling this off the UI thread, we can't use anything which
accesses the underlying NSView object. We create and set the Metal layer
on the UI thread before the video backend is initialized. This extension
is both compatible with MoltenVK and gfx-portability for accepting a
layer at surface creation.
2020-04-07 18:56:55 +10:00
Jun Su
81f8099cc6 Remove warnings of -Wsign-compare
Cast the variable to the coresponding type.
2020-03-25 07:57:14 +08:00
Jun Su
b6ff15c130 Cleanup warnings of -Wmissing-declarations
Add static to the functions which is not intentionally
export to big scope.
2020-03-24 20:16:10 +08:00
Stenzek
fb947296b0 Vulkan: Pass CAMetalLayer to MoltenVK instead of NSView
Gets rid of the warning for calling [NSView layer] off the main thread.
2020-03-11 23:11:26 +10:00
Stenzek
a545344268 VideoBackends: Make it possible for PrepareWindow to change the surface
Again, needed for MoltenVK.
2020-03-11 23:10:30 +10:00
Stenzek
08cc73108a Vulkan: Treat VK_SUBOPTIMAL_KHR as VK_SUCCESS on Android
Android 10 seems to expect a prerotated/transformed swap chain for optimal
presentation. For now, until we implement that, just ignore the hint.
2020-01-31 19:16:06 +10:00
Stenzek
ead65b0d8c Vulkan: Log when a swap chain resize is occurring
This may help us debug performance problems in the future.
2020-01-31 19:11:43 +10:00
Ryan Meredith
e5f6d9320f Add Dolphin version and current video backend to shader compilation logs 2020-01-24 03:29:38 -05:00
David Korth
f5fe692842 Use pre-increment for iterators instead of post-increment.
Pre-increment is more efficient, since it doesn't have to return the
old iterator.
2019-12-29 23:45:02 -05:00
David Korth
05101b251c OGL/Render.cpp, InitDriverInfo(): Use std::string_view to eliminate string copies.
Consolidate the NVIDIA Tegra and non-Tegra checks into one branch.
2019-12-29 23:45:02 -05:00
Stenzek
6fcb1c6c46 Add an ARM64 target to Visual Studio projects 2019-12-28 19:20:41 +10:00
Casey Carter
222bc6a443 Include <memory> for std::unique_ptr in DXContext.h 2019-12-19 14:25:12 -08:00
Stenzek
e05bc33899 Vulkan: Call VertexManagerBase initialize 2019-12-09 19:16:15 +10:00
Stenzek
07c43b192f D3D12: Call VertexManagerBase initialize 2019-12-09 19:16:04 +10:00
Anthony
fdb78b64e1
Merge pull request #8513 from lioncash/bounding-box
VideoCommon/BoundingBox: Make interface for querying bounding box data
2019-12-07 18:40:02 -08:00
Lioncash
9bd533ebe4 VideoCommon/BoundingBox: Make interface for querying bounding box data
Rather than expose the bounding box members directly, we can instead
provide an interface for code to use. This makes it nicer to transition
from global data, as the interface function names are already in
place.
2019-12-05 11:48:42 -05:00
Lioncash
10f7674651 VideoCommon/IndexGenerator: Eliminate static state
Now that we've extracted all of the stateless functions that can be
hidden, it's time to make the index generator a regular class with
active data members.

This can just be a member that sits within the vertex manager base
class. By deglobalizing the state of the index generator we also get rid
of the wonky dual-initializing that was going on within the OpenGL
backend.

Since the renderer is always initialized before the vertex manager, we
now only call Init() once throughout the execution lifecycle.
2019-12-05 10:49:32 -05:00
Stenzek
dd23a1ee79 Update VS projects/solutions to VS2019 2019-11-30 13:42:52 +10:00
Lioncash
c792961000 Common: Unify logging namespace with Common
Previously the logging was a in a little bit of a disarray. Some things
were in namespaces, and other things were not.

Given this code will feature a bit of restructuring during the
transition over to fmt, this is a good time to unify it under a single
namespace and also remove functions and types from the global namespace.

Now, all functions and types are under the Common::Log namespace. The
only outliers being, of course, the preprocessor macros.
2019-11-28 05:13:21 -05:00
Silent
a68789a70c
D3DCommon: Remove unused GetDebugObjectName and tidy up SetDebugObjectName 2019-11-10 16:07:32 +01:00
Silent
8445644e05
D3DCommon: Migrate few remaining raw pointers to WRL::ComPtr 2019-11-10 16:07:32 +01:00
Connor McLaughlin
5440be96e7
Merge pull request #8378 from stenzek/quad-buffer-stereo
Various quad-buffered ("HDMI 3D") stereo fixes
2019-11-08 10:26:58 +10:00
Stenzek
16f103ab42 Vulkan: Exclusive fullscreen support via VK_EXT_full_screen_exclusive 2019-10-31 22:45:59 +10:00
Stenzek
6fc6444687 Vulkan: Explicitly enable VK_KHR_get_physical_device_properties2
This was missing from the subgroup PR way back.
2019-10-31 22:45:59 +10:00
Stenzek
230190fc36 Vulkan: Allow runtime querying of enabled extensions 2019-10-31 22:45:59 +10:00
Connor McLaughlin
d3ee0a4535
Merge pull request #8379 from stenzek/mali
Vulkan: Optimizations for Mali with EFB2RAM on
2019-10-31 22:44:19 +10:00
Stenzek
ae83d02e54 Drop 3D Vision Support 2019-10-04 13:40:21 +10:00
Stenzek
328d89db70 Vulkan: Add a DriverDetails bug for "slow cached readback memory"
Using the cached memory type appears to be slower on Mali drivers, with
~10-15% CPU spent in the __pi___inval_cache_range kernel function.
2019-10-02 21:34:58 +10:00
Stenzek
c557aa4a15 Vulkan: Add strict flag to memory type selection 2019-10-02 21:27:32 +10:00
Stenzek
e754c8ab26 D3D11: Initialize shader cache before renderer
Otherwise the shaders we need for e.g. postprocessing are null.
2019-10-02 11:50:10 +10:00
Connor McLaughlin
1092efa77a
Merge pull request #8276 from stenzek/adreno-efb-access
Fix CPU EFB access on Adreno with Vulkan backend
2019-08-08 12:23:27 +10:00
Stenzek
d78a9356d2 D3D11: Only use integer RTV when logic op is supported+enabled 2019-08-02 18:47:19 +10:00
Stenzek
2698e311aa Vulkan: Use correct aspect for D24S8 textures 2019-07-31 15:33:05 +10:00
Connor McLaughlin
dea2b9c509
Merge pull request #8258 from CookiePLMonster/dx11.1-detection-fixes
D3D11 resources refactor and DX11.1 feature detection fixes
2019-07-30 01:24:57 +10:00
Silent
baa9636d48
D3D11: Add extra logging to StateCache::Get 2019-07-29 16:48:24 +02:00
Silent
43bfb183c2
D3D11: Show a warning message about unsupported features when switching to D3D11 backend on Windows 7 2019-07-29 16:47:45 +02:00
Silent
ff00873610
D3D11: Query for output merger logic op support and use logic op code only if supported
Previously code assumed that if DX11.1 runtime is supported, logic ops will,
but Windows 7 SP1 with a Platform Update supports DX11.1 runtime without logic ops.
This created pretty jarring visual artifacts, which now should be gone OR replaced
with much less jarring errors.
2019-07-29 16:47:39 +02:00
Silent
a6b8e8b9c3
D3D11: Ownership fixes for objects in DXTexture 2019-07-29 16:43:02 +02:00