Commit Graph

2487 Commits

Author SHA1 Message Date
Admiral H. Curtiss 839db591d9
HW/Memmap: Refactor Memory to class, move to Core::System. 2022-12-03 13:27:02 +01:00
TellowKrinkle ffb73f43e1 VideoBackends:Metal: Fix min/max lod when setting non-zero-based samplers 2022-11-30 21:11:37 -06:00
Robin Kertels 35a6d16d9e
VideoBackends: Rename query_type to query_group 2022-11-29 23:14:23 +01:00
Robin Kertels df2e07ad29
VideoBackends:Vulkan: Fix incorrect barriers in StagingBuffer
HOST barriers need to be issued regardless of
whether the memory type is coherent
and we need to properly synchronize writes to the buffer.
2022-11-29 23:14:23 +01:00
Robin Kertels 57b2ea663e
VideoBackends:D3D12: Set query type 2022-11-29 23:14:23 +01:00
Robin Kertels 6ba7573877
VideoBackends:Vulkan: Fix queries
Fixes both checking whether queries are done
and actually resets query pools.
2022-11-29 23:14:07 +01:00
TellowKrinkle e3cc42069f VideoBackends:OGL: Creating vertex formats shouldn't unbind anything 2022-11-28 21:28:24 -06:00
Pokechu22 f5d11c1e38 VideoBackends/D3D11: Simplify vertex attribute code 2022-11-23 13:45:43 -08:00
Pokechu22 cc5640245c Fix build errors related to formatting non-scoped enums 2022-11-23 13:45:43 -08:00
Robin Kertels 3beb22ed7f
VideoBackends:Vulkan: Synchronize presentation
Synchronize with the submission thread
if the last present is not done yet.
2022-11-07 02:20:22 +01:00
Admiral H. Curtiss 26b68f1f84
Merge pull request #11228 from Pokechu22/statistics-macros
VideoCommon/Statistics: Require semicolons after statistics macros
2022-11-04 23:15:52 +01:00
TellowKrinkle 83ca1ad8a6 VideoBackends:Metal: Headless render support 2022-11-03 02:35:24 -05:00
Tillmann Karras 22eb7e6645 OGL: use already known object label lengths
Passing -1 means the driver has to call strlen().
2022-11-01 01:10:03 +00:00
Tillmann Karras 4b8fe959d4 OGL: fix compute shader labels
This fixes GL_INVALID_VALUE errors when using GPU texture decoding.
2022-11-01 01:04:46 +00:00
Robin Kertels f5fecaf964
VideoBackends:Vulkan: Fix 0 size descriptor pools
[ VUID-VkDescriptorPoolCreateInfo-maxSets-00301 ] Object 0:
handle = 0x7f1,b8d,3cd,e70, type = VK_OBJECT_TYPE_DEVICE; |
MessageID = 0xa1,70e,236 | vkCreateDescriptorPool():
pCreateInfo->maxSets is not greater than 0.
The Vulkan spec states: maxSets must be greater than 0
2022-10-31 22:41:16 +01:00
Pokechu22 fe559f3ed3 VideoCommon/Statistics: Require semicolons after statistics macros
This is clearer and reduces IntelliSense problems.
2022-10-29 15:39:41 -07:00
Robin Kertels a07ee729e5
VideoBackends:D3D12: Defer binding framebuffer in SetAndDiscardFramebuffer
BindFramebuffer depends on the pipeline which might not be set yet.
That's why the framebuffer dirty flag exists in the first place.
I assume BindFramebuffer was called directly here, in order to handle
the texture state transitions necessary for DiscardResource.
The state is tracked anyway, so we can just issue those transitions there
too and defer binding the actual framebuffer.

Fixes an issue in Zelda Twilight Princess with EFB depth peeks.
Dolphin would bind a frame buffer which doesn't have an integer format
descriptor for the color target before binding the new pipeline.
So it would accidentally use the 0 descriptor.

Debug layer error:
D3D12 ERROR: ID3D12CommandList::OMSetRenderTargets:
Specified CPU descriptor handle ptr=0x0000000000000000 does not refer to
a location in a descriptor heap. pRenderTargetDescriptors[0] is the issue.
[ EXECUTION ERROR #646: INVALID_DESCRIPTOR_HANDLE]
2022-10-29 23:41:32 +02:00
Robin Kertels a6aa651291
VideoBackends:D3D12: Use COMMON as initial state for default heap buffer
Fixes the following error in the D3D12 debug layer:

D3D12 WARNING: ID3D12Device::CreateCommittedResource:
Ignoring InitialState D3D12_RESOURCE_STATE_UNORDERED_ACCESS.
Buffers are effectively created in state D3D12_RESOURCE_STATE_COMMON.
[ STATE_CREATION WARNING #1328: CREATERESOURCE_STATE_IGNORED]
2022-10-29 23:39:32 +02:00
Robin Kertels 22fecb41fc
VideoBackends:D3D12: Don't query GPU descriptor handle for non-shader visible heap
Fixes the following error in the D3D12 debug layer:

D3D12 ERROR: ID3D12DescriptorHeap::GetGPUDescriptorHandleForHeapStart:
GetGPUDescriptorHandleForHeapStart is invalid to call on a descriptor
heap that does not have DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE set.
If the heap is not supposed to be shader visible, then
GetCPUDescriptorHandleForHeapStart would be the appropriate method
to call. That call is valid both for shader visible and non shader
visible descriptor heaps.
[ STATE_GETTING ERROR #1315: DESCRIPTOR_HEAP_NOT_SHADER_VISIBLE]
2022-10-29 23:39:27 +02:00
iwubcode 0e1ffe009a VideoBackends: fix d3d12 subresource calculation 2022-10-28 19:07:08 -05:00
JMC47 027e10460a
Merge pull request #10977 from tellowkrinkle/FixBackendMultithreading
VideoBackends:Vulkan: Improve backend multithreading
2022-10-25 04:14:01 -04:00
TellowKrinkle fa8134deda VideoBackends:Metal: Default to presentDrawable when vsync is on 2022-10-24 17:55:30 -05:00
JMC47 b66793194e
Merge pull request #11028 from tellowkrinkle/MetalFixes
Various Metal renderer improvements
2022-10-24 15:22:37 -04:00
JMC47 cdcbe51b2a
Merge pull request #10890 from tellowkrinkle/VertexLineExpand
VideoCommon: Add vertex shader point/line expansion
2022-10-23 01:49:26 -04:00
Robin Kertels aa1679f2c7
VideoBackends:Vulkan: Clean up unused memory allocation code 2022-10-23 03:21:29 +02:00
Robin Kertels 1ba58e83ca
VideoBackends:Vulkan: Use VMA for stream buffer 2022-10-23 03:21:29 +02:00
Robin Kertels 0e1b7a7b35
VideoBackends:Vulkan: Use VMA for bounding box 2022-10-23 03:21:29 +02:00
Robin Kertels 0532f4a05a
VideoBackends:Vulkan: Use VMA for staging buffers 2022-10-23 03:21:14 +02:00
TellowKrinkle 1eeba6dcca VideoBackends:D3D12: Add support for vertex shader point and line expansion 2022-10-22 20:13:24 -05:00
TellowKrinkle 9624479933 VideoBackends:OGL: Add support for vertex shader point and line expansion 2022-10-22 20:13:24 -05:00
TellowKrinkle 3a5901d12e VideoBackends:Vulkan: Add support for vertex shader point and line expansion 2022-10-22 20:13:24 -05:00
TellowKrinkle 678ee48bfc VideoBackends:Metal: Add support for vertex shader point and line expansion 2022-10-22 20:13:24 -05:00
TellowKrinkle 68f49df0f8 VideoCommon: Add vertex shader point and line expansion 2022-10-22 20:13:24 -05:00
Robin Kertels 3ffbf94b2a
VideoBackends:Vulkan: Set up VMA
Co-authored-by: iwubcode <iwubcode@users.noreply.github.com>
2022-10-23 02:54:35 +02:00
TellowKrinkle 6fd933915b VideoBackends:Vulkan: Improve backend multithreading
Makes the multiple threads actually able to run at the same time
2022-10-17 00:05:35 -05:00
Admiral H. Curtiss 10f973a87f
Merge pull request #11122 from K0bin/descriptor-overhaul
VideoBackends:Vulkan: Allocate descriptor pools as needed
2022-10-17 04:25:35 +02:00
Robin Kertels 6992b0d8e1
VideoBackends:Vulkan: Allocate descriptor pools as needed 2022-10-16 17:04:35 +02:00
Pokechu22 ae7b14887b Remove varargs support from LOG_VULKAN_ERROR
Nothing currently uses it. It could theoretically be replaced with fmt support, but I don't think the LOG_VULKAN_ERROR macro is that useful and it'd be better to replace it with regular logging instead.
2022-10-12 16:50:51 -07:00
Pokechu22 f9fe25291d Remove most uses of StringFromFormat in favor of fmt 2022-10-12 16:50:47 -07:00
Robin Kertels 332824f7d5
VideoBackends:Vulkan: Fix command buffer cleanup 2022-10-08 21:40:33 +02:00
TellowKrinkle fd2680d8b4 VideoBackends:Metal: Use a temporary buffer for large texture uploads 2022-10-08 04:46:07 -05:00
TellowKrinkle a13f09433c VideoBackends:Metal: Add config option to use presentDrawable 2022-10-08 04:46:07 -05:00
TellowKrinkle 5a1b90c7f3 VideoBackends:Metal: Explicitly disable arc
Makes it easier to enable arc elsewhere without breaking the Metal backend
2022-10-08 04:46:07 -05:00
TellowKrinkle c08de82e90 VideoBackends:Metal: Bring back unified memory config
Turns out it was helpful.  (Most improvement in ubershaders.)  This time with much better auto mode.
2022-10-08 04:46:05 -05:00
TellowKrinkle 93ce7bf344 VideoBackends:Metal: Unroll lighting loop 2022-10-08 04:44:48 -05:00
TellowKrinkle 45ee1be6da VideoBackends:Metal: Properly set vsync on creation 2022-10-08 04:44:48 -05:00
TellowKrinkle 274d4679ca VideoBackends:Multiple: More GPUs with broken subgroup ops 2022-10-08 04:44:48 -05:00
Admiral H. Curtiss eea31db781
Vulkan/CommandBufferManager: Show error code in PanicAlerts. 2022-10-04 19:50:23 +02:00
JMC47 c196c47e81
Merge pull request #11090 from K0bin/submit-rework
Vulkan: Raise number of command buffers
2022-09-30 20:15:25 -04:00
Robin Kertels e5fb9c9adf
VideoBackends:Vulkan: Raise number of command buffers
Avoid waiting for earlier submissions when we flush more often.
The vertex manager will flush more often if the game accesses the EFB
on the CPU, to give the GPU a head start.
2022-10-01 01:26:04 +02:00
Robin Kertels fba7d35f94
VideoBackends:Vulkan: Associate descriptor pool with frame rather than command buffer 2022-10-01 01:26:04 +02:00
Robin Kertels ed75a58061
VideoBackends:Vulkan: Decouple available command buffers from frames in flight 2022-10-01 01:26:04 +02:00
Robin Kertels e8fa867f14
VideoBackends:Vulkan: Only synchronize with submission thread when necessary
We only need to synchronize with the submission thread
when submitting on the GPU thread or when waiting for a command buffer.
2022-10-01 01:26:04 +02:00
Robin Kertels 2e6d8d6575
VideoBackends:Vulkan: Fix validation error around surface_capabilities2 2022-10-01 01:26:03 +02:00
JMC47 68eda7f887
Merge pull request #11084 from K0bin/qcom-workaround
Vulkan: Workaround slow vkCmdCopyImageToBuffer on QCom
2022-09-30 15:33:00 -04:00
Robin Kertels 81c817c54d
VideoBackends:Vulkan: Workaround slow vkCmdCopyImageToBuffer on QCom driver 2022-09-30 21:13:42 +02:00
Mai 0c19a1d87c
Merge pull request #11100 from Pokechu22/software-settings-merge
Use the same settings for the software renderer as other backends
2022-09-29 09:05:51 -04:00
Pokechu22 b90d23158f Software: Fix mipmaps and uneven strides in SWTexture
I think this is only used for texture dumping, but this resolves some failed assertions and glitchy results.
2022-09-26 19:43:57 -07:00
Pokechu22 a6c00c7633 D3D12: Fix backend multithreading incorrectly being marked as supported 2022-09-26 19:24:52 -07:00
Pokechu22 56fce3ba8a Software: Remove dedicated texture/frame dumping infrastructure
Texture dumping can already be done using VideoCommon's system (and in fact the same setting already enabled *both* of these). Dumping objects/TEV stages/texture fetches doesn't currently have an equivalent, but could be added to the FIFO player instead.
2022-09-26 18:25:54 -07:00
TellowKrinkle ee692abbe1 VideoBackends:Metal: Use BitField for stuffing bits in pipeline ids
Also removes cullmode all handling, it's handled in CPU and DX11 backend doesn't specially handle it either
2022-09-20 01:45:18 -05:00
TellowKrinkle 1eb3aaa548 VideoCommon: Use std::array in PortableVertexDeclaration 2022-09-19 16:28:24 -05:00
TellowKrinkle 28b31b8327 VideoBackends:Vulkan: Make dynamic vertex loader optional
Makes it easier to disable in the future if support for VK_EXT_vertex_input_dynamic_state is added
2022-09-19 16:28:24 -05:00
TellowKrinkle dae56a24b8 VideoBackends:D3D12: Dynamic vertex loader support 2022-09-19 16:28:24 -05:00
TellowKrinkle 936b4d5d0d VideoBackends:Vulkan: Dynamic vertex loader support 2022-09-19 16:28:24 -05:00
TellowKrinkle 7edc8b4e79 VideoBackends:Metal: Don't set primitive on ubershaders 2022-09-19 16:28:24 -05:00
TellowKrinkle 99533d2840 VideoCommon: Add separate pipeline usage for UberShaders 2022-09-19 16:28:24 -05:00
TellowKrinkle d3dae1cd7e VideoBackends:Metal: Dynamic vertex loader support 2022-09-19 16:28:24 -05:00
TellowKrinkle 4c629c2bee VideoCommon: Add dynamic vertex loader to ubershaders 2022-09-19 16:28:23 -05:00
Pokechu22 2dfe91336a
Merge pull request #10549 from Pokechu22/sw-tev-enum-map
Refactor various bits of graphics code for readability
2022-09-08 09:42:12 -07:00
Merry 362167fde5 MTLObjectCache: Correct signature of equality operator
Not doing so produces a warning in clang:
    ISO C++20 considers use of overloaded operator '!=' (with operand types
    'Metal::DepthStencilSelector' and 'Metal::DepthStencilSelector') to be
    ambiguous despite there being a unique best viable function with
    non-reversed arguments

The underlying reason for this warning is an incorrect method signature.
2022-08-29 21:23:23 +01:00
Pokechu22 5ef8a7973e BPMemory: Make TevKSel more clear
It stores both the konst selection value for alpha and color channels (for two tev stages per ksel), and half of a swap table row (there are 4 total swap tables, which can be used for swizzling the rasterized color and the texture color, and indices selecting which tables to use are stored per tev stage in the alpha combiner).  Since these are indexed very differently, the old code was hard to follow.
2022-08-29 11:10:05 -07:00
Pokechu22 4206ac243b SW/Rasterizer: Use RAS1_IREF::getTexCoord and getTexMap 2022-08-29 11:10:05 -07:00
Pokechu22 ae0fcd9a9f SW/Tev: Replace Tev::SetRegColor with Tev::SetKonstColors 2022-08-29 11:10:05 -07:00
Pokechu22 3b9a048291 SW/Tev: Use std::clamp for Clamp255 and Clamp1024 2022-08-29 11:10:05 -07:00
Pokechu22 bae0f21f74 SW/Tev: Remove Tev::Init 2022-08-29 11:10:05 -07:00
Pokechu22 c9936f8c1c SW/Tev: Use EnumMap for scale/bias tables 2022-08-29 11:10:05 -07:00
Pokechu22 b02992548e SW/Tev: Use EnumMap for Reg 2022-08-29 11:10:03 -07:00
Pokechu22 2db7569463 SW/Tev: Use TevColorRef/TevAlphaRef instead of raw s16 pointers 2022-08-29 11:05:10 -07:00
Pokechu22 e04d23e086 SW/Rasterizer: Fix indirect stage using texture coordinates/maps >= 4
The masking was incorrect. This affects the main menu of The Last Avatar, though that menu also relies on copy filter functionality that is not correctly handled in the software renderer so the difference is not obvious; that game shuffles textures across all indices for some reason, so this issue would presumably result in subtle flickering.
2022-08-28 12:19:36 -07:00
Pokechu22 0cced44142 Use `__VA_OPT__(, ) __VA_ARGS__` instead of `##__VA_ARGS__`
Per https://en.cppreference.com/w/cpp/preprocessor/replace#.23_and_.23.23_operators the `##` behavior is a nonstandard extension; this extension seems to be supported by all compilers we care about, but IntelliSense in visual studio doesn't correctly handle it, resulting in false errors in the IDE (but not when compiling).

Per https://en.cppreference.com/w/cpp/preprocessor/replace#Function-like_macros C++20 introduced a workaround, where `__VA_OPT__(, )` generates a comma if and only if `__VA_ARGS__` is non-empty.

This PR replaces all occurrences, with the exception of Externals, DSPSpy (which is not likely to be edited in MSVC and does not target C++20 currently), and JitArm64_Integer.cpp (which uses `Function(__VA_ARGS__)`, and thus does not ever need a comma).
2022-08-23 12:09:57 -07:00
Pokechu22 3c38f5c1d2 D3DCommon: Remove unused swap chain functions
These were added in ea15080d8f (which added D3DCommon), but never were used.
2022-08-17 18:16:50 -07:00
Pokechu22 da7aded00d Vulkan: Remove unused swap chain functions
These were added in 5e29508b8f and 1f2d43c870, but were replaced with CONFIG_CHANGE_BIT_VSYNC and CONFIG_CHANGE_BIT_STEREO_MODE in e4b205c769.
2022-08-17 18:16:17 -07:00
OatmealDome 700162b8bd MTLUtil: Include TargetConditionals 2022-07-23 17:22:11 -04:00
OatmealDome 77f44f1600 MTLMain: Include TargetConditionals 2022-07-23 17:22:11 -04:00
OatmealDome b32b27ae9a MTLMain: Only compile NSView manipulation code on macOS 2022-07-23 17:22:04 -04:00
OatmealDome 8ad7fa0313 MTLUtil: Return invalid for non-supported texture formats on non-macOS platforms 2022-07-23 13:53:31 -04:00
OatmealDome 7edd3aff75 MTLUtil: Don't attempt to get all GPUs on non-macOS platforms 2022-07-23 13:53:22 -04:00
OatmealDome 50d3ad58df CMakeLists: Link videometal with Foundation 2022-07-23 13:53:15 -04:00
TellowKrinkle 6559c6b8ee VideoBackends:Multiple: Grammar fixes 2022-07-21 20:44:19 -05:00
TellowKrinkle a41345127f VideoBackends:Metal: Remove unified memory config
Not worth the extra code
2022-07-21 20:44:19 -05:00
TellowKrinkle 5065767abd VideoBackends:Metal: Avoid submitting draw calls with no vertices/indices 2022-07-21 20:44:19 -05:00
TellowKrinkle ee3f2b8fcb VideoBackends:Metal: Implement PerfQuery 2022-07-21 20:44:19 -05:00
TellowKrinkle c48035908c VideoBackends:Metal: Use unified memory path by default on all GPUs 2022-07-21 20:44:19 -05:00
TellowKrinkle 6ee0248eab VideoBackends:Metal: MSAA support 2022-07-21 20:44:19 -05:00
TellowKrinkle c0fd128171 VideoBackends:Metal: Use base vertex 2022-07-21 20:44:19 -05:00
TellowKrinkle 5742ccf8de VideoBackends:Metal: Cache pipelines
Metal pipelines hold less stuff than Dolphin pipelines, so duplicates will appear
2022-07-21 20:44:19 -05:00
TellowKrinkle e32213d031 VideoBackends:Metal: Create samplers on demand 2022-07-21 20:44:19 -05:00
TellowKrinkle 61705b05da VideoBackends:Metal: FBFetch for Intel GPUs 2022-07-21 20:44:19 -05:00
TellowKrinkle a5ef9dfd53 VideoBackends:Metal: Use DriverDetails for bugs 2022-07-21 20:44:19 -05:00
TellowKrinkle 716c0980d7 VideoBackends: Add Metal renderer 2022-07-21 20:44:19 -05:00
JMC47 70b0b03c3c
Merge pull request #10747 from tellowkrinkle/LateUIDFixup
Add a post-cache shader UID fixup pass
2022-07-17 00:43:16 -04:00
Pokechu22 2f43889141 Software: Use hardware-verified numbers for RGB->YUV conversion 2022-07-16 00:07:10 -07:00
Pokechu22 791bd16b28 Restructure parameters to TetxureConverterShaderGen/TextureConversionShader
This will be used for later refactoring for increased accuracy.
2022-07-16 00:07:10 -07:00
TellowKrinkle 6ab24e6c17 VideoCommon: Better driver bug handling
Adds a pass to process driver deficiencies between UID caching and use, allowing a full view of the whole pipeline, since some bugs/workarounds involve interactions between blend modes and the pixel shader
2022-07-13 21:51:24 -05:00
JMC47 cce6133ef6
Merge pull request #10749 from tellowkrinkle/IntelUbershaders
VideoCommon: Fix ubershaders on MoltenVK Intel
2022-07-10 19:35:55 -04:00
JosJuice 6e09b13ce3
Merge pull request #10829 from AdmiralCurtiss/spirv-cross-cmake-fix
Fix CMake Windows build after #10673 (HLSL from SPIRV).
2022-07-10 09:08:24 +02:00
OatmealDome 1c6a0073d2 ShaderCompiler: Use compute shader header in compute shaders 2022-07-09 19:01:58 -04:00
Admiral H. Curtiss cdd3571491
D3DCommon: Add glslang include directories in CMake. 2022-07-10 00:59:32 +02:00
JMC47 828afc6735
Merge pull request #10673 from iwubcode/spirv-backends
D3D: Generate HLSL from SPIRV*
2022-07-08 15:29:58 -04:00
Minty-Meeo 69e32dea52 Resolve GCC Warnings 2022-06-30 15:26:48 -05:00
iwubcode dda1479ecf VideoBackends / VideoCommon: refactor Vulkan to use new SPIRV functionality 2022-06-24 18:09:53 -05:00
iwubcode 0eb9352579 D3D: update BoundingBox to match generated shader code 2022-06-24 18:09:53 -05:00
iwubcode 5dd2704416 D3D / VideoCommon: generate HLSL from SPIRV 2022-06-24 18:09:53 -05:00
TellowKrinkle 26529a31ab VideoCommon: Fix SSBO layout and remove associated "bug" 2022-06-16 20:26:11 -05:00
TellowKrinkle db6e928c8d VideoCommon: Fix Intel GPUs on Metal/Vulkan locking up in ubershaders 2022-06-14 00:48:47 -05:00
OatmealDome 803a0de5a4 VKMain: Remove check for macOS 10.14 2022-06-01 22:57:56 -04:00
Admiral H. Curtiss 580c721c82
cmake: Don't use PCH with Qt6. 2022-05-22 01:19:44 +02:00
Pokechu22 8df55b492c Show a panic alert if the CP matrix indices don't match the XF matrix indices
This almost certainly never happens, but if it does we want to know.
2022-05-18 14:43:14 -07:00
JMC47 c0488de482
Merge pull request #10251 from Pokechu22/negative-scissor
Rework scissor handling
2022-04-24 15:00:42 -04:00
Pokechu22 8e7c848425
Merge pull request #10601 from Pokechu22/vulkan-shader-compile-error
Vulkan: Improve shader compile error handling
2022-04-24 11:43:10 -07:00
JMC47 c42392c565
Merge pull request #10290 from OatmealDome/m1-earlyz-bug
DriverDetails: Add broken discard with early-Z bug on Apple Silicon GPUs
2022-04-24 13:30:04 -04:00
Pokechu22 784079853d VideoCommon: Add comment explaining why only the first normal gets normalized
Co-authored-by: Scott Mansell <phiren@gmail.com>
2022-04-22 16:54:38 -07:00
Pokechu22 2a5c77f43f VideoCommon: Handle emboss texgen with only a single normal
Fixes a large number of effects in Rogue Squadron 2 and 3.
2022-04-22 16:54:38 -07:00
Pokechu22 04fdadd9d5 VideoCommon: Rename norm0/norm1/norm2 to normal/tangent/binormal 2022-04-22 16:54:36 -07:00
Pokechu22 0f92ab380e Vulkan: Include the info log in the shader compile error panic alert
The other backends do this, and it is helpful for quickly identifying errors during development.
2022-04-22 16:38:35 -07:00
Pokechu22 7ae71e643e Vulkan: Close the output stream on shader compile error before showing the panic alert
This fixes the file showing up as 0 bytes in Windows Explorer (although the file would still display properly when opened).
2022-04-22 16:37:43 -07:00
OatmealDome 259a5fc7c0 DriverDetails: Add broken discard with early-Z bug on Apple Silicon GPUs 2022-04-20 14:56:34 -04:00
OatmealDome e7f5e5172c DriverDetails: Introduce new VENDOR_APPLE for Apple GPUs 2022-04-19 10:55:27 -04:00
OatmealDome bad0283ff7 VKPipeline: Add shader blending support 2022-04-19 10:55:26 -04:00
Pokechu22 4d1e1db3c5 Software: Fix scissor rectangle always being block-aligned 2022-04-16 12:35:00 -07:00
Pokechu22 8745d84949 Software: Disable clipping based on xfmem
This fixes https://bugs.dolphin-emu.org/issues/12562, and is also needed for a hardware test of mine.
2022-04-16 12:35:00 -07:00
Pokechu22 925ceab82f Software: Use new scissor logic
Unlike the hardware backends, the software renderer can use multiple scissor rectangles (though this will result in extra rasterization).
2022-04-16 12:34:58 -07:00
Pokechu22 076392a0f6 VideoCommon: Rework scissor handling
This increases accuracy, fixing the white rendering in Major Minor's Majestic March.  However, the hardware backends can only have one viewport and scissor rectangle at a time, while sometimes multiple are needed to accurately emulate what is happening.  If possible, this will need to be fixed later.
2022-04-16 10:26:11 -07:00
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