Commit Graph

4659 Commits

Author SHA1 Message Date
Joshua Ashton f3992658a4 [d3d9] Remove unused util_monitor include 2022-08-20 20:27:07 +02:00
Joshua Ashton 69eba93764 [d3d9] Make window proc code use new wsi interface 2022-08-20 20:27:07 +02:00
Joshua Ashton 9690b2a9e4 [d3d9] Make adapter code use new wsi abstraction 2022-08-20 20:27:07 +02:00
Joshua Ashton dac7e38f4b [d3d9] Make swapchain use new wsi abstraction 2022-08-20 20:27:07 +02:00
Joshua Ashton 654b517057 [d3d9] Add helpers for new WSI interface 2022-08-20 20:27:07 +02:00
Joshua Ashton bc8e75fdfa [dxgi] Make adapter code use new wsi interface 2022-08-20 20:27:07 +02:00
Joshua Ashton 59b943cf12 [dxgi] Remove unused util_monitor include 2022-08-20 20:27:07 +02:00
Joshua Ashton 21744198e0 [dxgi] Make swapchain use new wsi interface 2022-08-20 20:27:07 +02:00
Joshua Ashton e13a9f9cf6 [dxgi] Make output code use new wsi interface 2022-08-20 20:27:07 +02:00
Joshua Ashton 71a630801e [dxgi] Add helpers for new wsi interface 2022-08-20 20:27:07 +02:00
Joshua Ashton 9f9c93dcbd [d3d11] Use new wsi interface 2022-08-20 20:27:07 +02:00
Joshua Ashton 4f80ffd830 [vulkan] Use surface creation from wsi interface 2022-08-20 20:27:07 +02:00
Joshua Ashton 86b603b8f9 [dxvk] Link against new wsi lib 2022-08-20 20:27:07 +02:00
Joshua Ashton b875d49c85 [wsi] Move DxvkWindowState to wsi platform header 2022-08-20 20:27:07 +02:00
Joshua Ashton efa6523e3e [wsi] Implement wsi interface for Windows 2022-08-20 20:27:07 +02:00
Joshua Ashton 050e5b327c [wsi] Define wsi interface 2022-08-20 20:27:07 +02:00
Philip Rebohle 76ee76d6da [d3d9,dxso] Use DemoteToHelperInvocation for alpha test
May enable additional compiler optimizations.
2022-08-19 14:49:18 +00:00
Philip Rebohle 2d92679cd1 [dxso] Remove fallback path for discards 2022-08-19 13:36:54 +00:00
Philip Rebohle 165648017e [dxbc] Remove fallback path for discards 2022-08-19 13:36:54 +00:00
Philip Rebohle ea4e0bc470 [d3d9,d3d11] Require shaderDemoteToHelperInvocation feature 2022-08-19 13:36:54 +00:00
Georg Lehmann 155944c2b4 [dxso] normalize 0 to 0 with strict float emulation 2022-08-19 13:36:14 +00:00
Philip Rebohle 85cc87e42a
[d3d9] Fix invalid shader in fixed-function alpha test 2022-08-18 17:08:59 +02:00
Philip Rebohle 658d824ddd
[d3d11] Silence log spam for invalid image operations 2022-08-18 14:48:29 +02:00
Philip Rebohle 4869b0defa
[dxvk] Fix race condition requestCompileShader 2022-08-18 02:57:45 +02:00
Philip Rebohle a695644fea [d3d9] Remove alphaTestWiggleRoom option 2022-08-18 00:10:39 +02:00
Philip Rebohle 5a3cb5ad3e [d3d9] Adjust alpha test precision based on render target format
More or less matches what Nvidia's D3D9 driver does on Turing.
2022-08-18 00:10:39 +02:00
Philip Rebohle 47fa3824dc [d3d9] Re-implement alpha test to support configurable accuracy
The current implementation always uses 12 bits of accuracy.
2022-08-18 00:10:39 +02:00
Philip Rebohle 2c713a34c9 [d3d9,dxso] Factor out common alpha test code 2022-08-18 00:10:39 +02:00
Philip Rebohle 3806bd44d8
[dxvk] Change descriptor info to take only one shader stage
And fix the binding index -> descriptor mapping.
This affects D3D9 since the spec constant change.
2022-08-17 22:40:58 +02:00
Philip Rebohle 3c2fc41e4c [d3d9] Re-bind framebuffer if RT hazards change
Otherwise we never set the feedback loop bits in the backend.
2022-08-17 18:36:30 +00:00
Philip Rebohle 52314ba4fd
[dxvk] Do not log storage image features that we no longer enable 2022-08-17 15:39:03 +02:00
Philip Rebohle 5e394b5554
[dxvk] Remove old format support queries 2022-08-17 15:39:03 +02:00
Philip Rebohle 80fc1d8b25
[d3d9] Use new format support queries 2022-08-17 15:39:03 +02:00
Philip Rebohle 13152088d4
[dxgi] Use new format support queries to initialize format table 2022-08-17 15:39:03 +02:00
Philip Rebohle 4aeb397ba3
[d3d11] Use new format support queries to check D3D11 format support 2022-08-17 15:39:03 +02:00
Philip Rebohle 099c70c2bd
[d3d11] Use new format support queries in resource creation 2022-08-17 15:26:03 +02:00
Philip Rebohle 3717922381
[d3d11,dxbc] Rework check for TypedUAVLoadAdditionalFormats 2022-08-17 15:26:03 +02:00
Philip Rebohle 653a98f01b
[dxvk] Use new format support queries 2022-08-17 15:26:03 +02:00
Philip Rebohle cc8010fb7c
[dxvk] Add format feature queries to DxvkDevice 2022-08-17 15:20:13 +02:00
Philip Rebohle 61025c0079
[dxvk] Don't disable frame rate limiter if vsync is enabled
This only works if we know the actual refresh rate of the display.
However, in a wine virtual desktop or with proton's fshack, this
is often not the case, so we'd see a 60 Hz mode on a high-refresh
rate display and never actually enable the limiter.
2022-08-17 01:53:24 +02:00
Riesi 04bc1bac73 [util] Limit Beyond Good and Evil FPS to 60
UI breaks on higher FPS
2022-08-16 19:11:41 +02:00
Philip Rebohle e0af668f6c
[dxvk] Use DxvkBindingLayoutObjects for set lookup directly
Avoids pointer dereferencing on a really hot code path. This is also
safe since there's a 1:1 mapping between the VkPipelineLayout and the
given ovbject type.
2022-08-16 15:35:57 +02:00
Philip Rebohle 9f9324c421
[dxvk] Use existing bit mask iterator for descriptor set allocation 2022-08-16 15:24:39 +02:00
Joshua Ashton 084969135b [d3d9] Only set feedback loop usage on textures, not plain surfaces 2022-08-16 12:33:17 +00:00
Joshua Ashton cf9e217e7b [util] Support for fps limiter on non-Windows platforms
Defaults to a sleep granularity of 0.5ms, which is slightly on the cautious side.

Calls through to std::this_thread::sleep_for directly, which calls through to nanosleep.
2022-08-16 14:32:07 +02:00
Joshua Ashton d1e2b89282 [util] Use chrono literal for ms in fps limiter 2022-08-16 14:32:07 +02:00
Joshua Ashton 5fcc9a1bd1 [util] Move platform specific sleep to own function in fps limiter 2022-08-16 14:32:07 +02:00
Joshua Ashton 05a5b82f59 [util] Move sleep granularity getting to own function 2022-08-16 14:32:07 +02:00
Joshua Ashton b885883e06 [util] Rename NtTimerDuration to TimerDuration 2022-08-16 14:32:07 +02:00
Joshua Ashton a78aab147e [d3d9] Add feedback loop usage for DS 2022-08-16 10:39:06 +00:00
Joshua Ashton 870dd18f92 [d3d9] Set VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT for render targets
Closes: #2825
2022-08-16 08:43:52 +00:00
Joshua Ashton 6baaa3a5f2 [d3d9] New window proc code on multiple platforms 2022-08-14 17:22:58 +00:00
Joshua Ashton 7506f65801 [d3d9] Move window proc handling code to own file 2022-08-14 17:18:10 +00:00
Robin Kertels de8d2b37bb [d3d9] FF: Don't change flatShadingMask for outputs 2022-08-13 14:38:57 +01:00
Robin Kertels 46cb05ce45 [d3d9+util] Always ignore D3DLOCK_DONOTWAIT
We only ever stall when locking a texture that was
previously used with GetRenderTargetData or
GetFrontBufferData. Games are known to break
if locking those textures doesn't succeed.
2022-08-12 14:18:13 +01:00
Philip Rebohle 0d33d063ca
[dxvk] Remove device LUID workaround
winevulkan properly supports this now.
2022-08-11 16:01:53 +02:00
Philip Rebohle 673797c36a
[dxvk] Fix hang on exit with high priority queue
No idea why I'm not seeing hangs on my end, but this is definitely a bug.
2022-08-11 14:00:57 +02:00
Philip Rebohle 715b5119e6
[dxvk] Fix check in DxvkShaderPipelineLibrary::compilePipeline
Since we destroy pipelines on 32-bit we should just make sure this
doesn't get executed unnecessarily.
2022-08-11 13:43:38 +02:00
Philip Rebohle a4848201f8
[dxvk] Update buffer views in commitGraphicsBarriers
Otherwise we might end up accessing stale buffer slices, since this
happens before descriptor updates. This is not needed for compute.

Also fix weird indentation while we're at it.
2022-08-11 13:13:02 +02:00
Philip Rebohle 9bd0040a90
[d3d9] Request high-priority shader compiles as necessary 2022-08-11 12:39:28 +02:00
Philip Rebohle d3ab905621
[d3d11] Request high-priority shader compiles as necessary
This can reduce stutter in case shaders are needed immediately while
background threads are still busy compiling a different set of shaders.
2022-08-11 12:39:28 +02:00
Philip Rebohle c3a53127d7
[dxvk] Add high-priority queue for shader compiles
As well as an API to queue shaders as high priority.
2022-08-11 12:39:28 +02:00
Philip Rebohle f09f11aad0
[dxvk] Track pipeline library compile for each shader 2022-08-11 12:39:25 +02:00
Robin Kertels b5b74116fa [d3d9] Fix rare hang when waiting for staging buffer markers 2022-08-11 12:37:28 +02:00
Robin Kertels 5cdee45387 [util] Disable direct buffer mapping for GHWT
The game ends up discarding a 11MB buffer which causes it
to run out of address space and crash. Disabling direct buffer
mapping makes it use staging buffers and the staging buffer
limit saves the day.
2022-08-11 04:36:01 +01:00
Philip Rebohle 85c278f515
[dxvk] Don't try to merge buffer ranges in barrier list
Too slow, doesn't work most of the time anyway.
2022-08-11 00:38:49 +02:00
Philip Rebohle 4c7da80c14
[dxvk] Simplify barrier image and buffer slice implementations
Pre-process the given ranges so that compare and merge
operations become both simpler and faster.
2022-08-11 00:29:31 +02:00
Philip Rebohle 8aae9c85bb
[dxvk] Optimize barrier hash table lookup
Using a prime as the table size is technically better, but that
integer division kind of hurts when we're spamming look-ups.
2022-08-10 23:08:28 +02:00
Philip Rebohle ad020c23f9
[dxvk] Optimize barrier logic
The is*Dirty methods can exit early if the resource to check
is only used for reading. Only call get*Access to check for
write-after-write scenarios.
2022-08-10 20:47:52 +02:00
Philip Rebohle 11fbcd3131
[dxvk] Rework compute barrier handling to use common functions
Cleans up code a bit and should technically even make things a bit
more efficient.
2022-08-10 19:28:35 +02:00
Philip Rebohle 01014c1a2b
[dxvk] Rework checkGfx*Barrier methods 2022-08-10 19:28:35 +02:00
Philip Rebohle 9a6c378f3d
[dxvk] Only use one descriptor set for compute shaders
Simplifies things a bit and avoids redundant sets in the pipeline layout.
2022-08-10 19:28:32 +02:00
Philip Rebohle 02f653fdd2 [d3d9] Limit amount of staging memory in flight 2022-08-10 17:31:55 +02:00
Robin Kertels 9d981ec1a8 [dxvk] Introduce DxvkMarker
Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2022-08-10 17:31:55 +02:00
Robin Kertels 8feabc653e [d3d9] Do implicit flush after uploading textures or buffers 2022-08-10 17:31:55 +02:00
Robin Kertels f031ce44cf [util] Set lower memory limits for Guitar Hero WT 2022-08-10 17:31:55 +02:00
Philip Rebohle 67f937111d
[dxvk] Remove shrinkNvidiaHVVHeap workaround
No longer needed.
2022-08-10 16:39:58 +02:00
Philip Rebohle 3edb0ef114
[d3d11] Ensure that all required inputs are defined by input layout 2022-08-10 14:12:39 +02:00
Philip Rebohle 5540df955c
[dxbc] Rework semantic name matching 2022-08-10 14:11:47 +02:00
Philip Rebohle ec0c377cf8
[dxvk] Disable maintenance4 feature
We don't *really* need it (although some of the guarantees are nice to
have). For some reason, this completely destroys GPU-bound performance
on AMDVLK and AMD's Windows driver.
2022-08-10 01:04:38 +02:00
Paul Gofman 59441b1ff5 [dxgi] Also support use after free in IDXGISwapChain::SetFullscreenState() 2022-08-09 23:10:50 +02:00
Joshua Ashton 8580bb32ca [vulkan] Only define VK_USE_PLATFORM_WIN32_KHR on Windows 2022-08-09 14:16:50 +01:00
Joshua Ashton 50018de483 [util] Use topath helper for fstreams 2022-08-09 14:16:50 +01:00
Joshua Ashton 5de058e14a [util] Introduce topath helper
Manages converting strings to the right type for paths per-platform
2022-08-09 14:16:50 +01:00
Joshua Ashton d9000485ea [util] Add stubs for shared resources on other platforms 2022-08-09 14:16:50 +01:00
Joshua Ashton 8c3a44cac4 [util] Add stubs for GDI functions on other platforms 2022-08-09 14:16:50 +01:00
Philip Rebohle ab1d629961 [dxvk] Implement lifetime tracking for graphics pipelines 2022-08-09 13:40:58 +02:00
Philip Rebohle 764de6ff82 [dxvk] Add use counter to pipeline libraries
And destroy Vulkan pipeline objects once the counter reaches zero.
2022-08-09 13:40:58 +02:00
Philip Rebohle 1f9db49727 [dxvk] Change member order in pipeline manager
Ensures that pipelines are destroyed before pipeline libraries.
2022-08-09 13:40:58 +02:00
Philip Rebohle b97dba3712 [dxvk] Use shader module identifier for subsequent pipeline libary compiles
Should further reduce the hit we take from destroying pipeline libraries.
2022-08-09 13:40:58 +02:00
Philip Rebohle 4bc2d713fb [dxvk] Destroy shader pipeline libraries after initial compile on 32-bit
This alone saves ~700 MiB of address space in the Resident Evil 6 main
menu on Nvidia.
2022-08-09 13:40:58 +02:00
Philip Rebohle 915b03ba7b [dxvk] Add option to control pipeline lifetime tracking 2022-08-09 13:40:58 +02:00
Philip Rebohle eddbe73ba4
[dxbc] Fix off-by-one error for primitive vertex counts
Not sure if it's even possible to use this, but this was clearly a bug.
2022-08-09 03:19:59 +02:00
Philip Rebohle d6253aeae6
[dxvk] Order descriptors by type and binding
Reduces the number of unique descriptor set layouts further,
which may help with descriptor pool usage, and also makes
branching more predictable for the CPU.
2022-08-09 03:19:59 +02:00
Robin Kertels 1fcd5dc0af [d3d9] Unmap stored shader bytecode 2022-08-08 23:15:21 +01:00
Robin Kertels 49e9ba2ca7 [d3d9] Move d3d9 bytecode into D3D9Shader
This reduces the amount of times we copy the bytecode
and actually frees it when the game frees the associated shader.
2022-08-08 23:15:21 +01:00
Robin Kertels 1628b9e63a [d3d9] Add 64bit implementation for D3D9MemoryAllocator
This just uses malloc & free but allows us to use
the same code for D3D9 shader bytecode on 64 bit builds.
2022-08-08 23:15:21 +01:00
Robin Kertels 01fb40423d [d3d9] Remove some dead debug code
Oops.
2022-08-08 23:15:21 +01:00
Robin Kertels 36d8bb77a5 [d3d9] Fix synchronization in UpdateTextureFromBuffer 2022-08-08 23:14:30 +01:00
Robin Kertels ac1e44f120 [d3d9] Fix typo 2022-08-08 23:14:30 +01:00
Derek Lesho 57dcf73a54 d3d11: Fix shared textures that export both NT and KMT handles.
We should always create the DxvkImage with the KMT handle type, so that the call later to openKmtHandle succeeds.  Also, don't free sharedHandle when exporting an NT handle.
2022-08-08 23:31:01 +02:00
Philip Rebohle 0ad7a08c49
[dxvk] Get rid of some old debug code for compute pipelines 2022-08-08 18:58:22 +02:00
Philip Rebohle c392308e6f
[dxvk] Fix spec constant selector test for compute shaders
This isn't supported on compute.
2022-08-08 18:54:11 +02:00
Philip Rebohle 7789fd53ff [d3d9] Use new flat shading state for fixed-function pipelines 2022-08-08 13:34:59 +02:00
Philip Rebohle 8f1024c094 [d3d9] Use new flat shading state for DXSO shaders 2022-08-08 13:34:59 +02:00
Philip Rebohle dfdb729476 [dxvk] Add SPIR-V pass to decorate variables as flat on demand 2022-08-08 13:34:59 +02:00
Philip Rebohle a84beae112 [dxvk] Add flat shading field to pipeline state 2022-08-08 13:34:59 +02:00
Philip Rebohle 0adf64f085 [dxvk] Add flat shading parameter to rasterizer state 2022-08-08 13:34:59 +02:00
Joshua Ashton 4f0c217633 [d3d9] Fix recording MultiplyTransform 2022-08-08 03:53:25 +01:00
Philip Rebohle 43df6cfa45
[dxvk] Fix indentation
Thanks, VSCode.
2022-08-08 04:50:50 +02:00
Philip Rebohle 2b2c44aa99
[dxvk] Move image view cookie to DxvkResource 2022-08-07 21:24:57 +02:00
Philip Rebohle 4831909656
[d3d9] Enable apitrace mode for The Witcher 2022-08-07 20:04:37 +02:00
Philip Rebohle a74f8da7b7
[d3d11] Use bindVertexBufferRange whenever possible 2022-08-07 19:03:51 +02:00
Philip Rebohle 97f0d1dfb8
[d3d11] Use bindIndexBufferRange whenever possible 2022-08-07 19:03:51 +02:00
Philip Rebohle 35dde3e1b9
[d3d11] Change how resourece binding treats null resources 2022-08-07 19:03:51 +02:00
Philip Rebohle 897e7816f0
[d3d11] Don't return undefined slices from GetBufferSlice
Instead, return a slice with length zero.
2022-08-07 19:03:51 +02:00
Philip Rebohle 08b9b0eb44
[dxvk] Introduce bindVertexBufferRange and bindIndexBufferRange 2022-08-07 19:03:51 +02:00
Philip Rebohle 26d46e7f80
[dxvk] Handle bound buffers with zero size in the backend 2022-08-07 18:45:17 +02:00
Philip Rebohle d314bee86d
[d3d11] Fix bad signature of various BindToContext methods 2022-08-07 18:44:47 +02:00
Philip Rebohle 45a1587b88
[d3d11] Fix some possible constant buffer binding bugs 2022-08-07 18:44:47 +02:00
Philip Rebohle 2e6a2f1be3
[dxvk] Make shader stage parameter in bindShader a template parameter 2022-08-07 18:44:44 +02:00
Philip Rebohle 29a2cb9a5e
[d3d9,d3d11] Make GetShaderStage functions constexpr 2022-08-07 18:44:44 +02:00
Philip Rebohle 12c2d24d5c
[dxvk] Remove bindResourceView method 2022-08-07 17:59:20 +02:00
Philip Rebohle 69b15b7fe6
[dxvk] Use new resource view binding methods in swapchain blitter 2022-08-07 17:59:20 +02:00
Philip Rebohle eebcfcf973
[hud] Use new resource view binding methods 2022-08-07 17:59:20 +02:00
Philip Rebohle 1c1958be44
[d3d9] Use new resource view binding methods 2022-08-07 17:59:20 +02:00
Philip Rebohle 28ecf8268d
[d3d11] Use new resource view binding methods 2022-08-07 17:59:20 +02:00
Philip Rebohle 317850e16f
[dxvk] Introduce bindResourceImageView and bindResourceBufferView methods 2022-08-07 17:59:20 +02:00
Philip Rebohle 88bdf2b592
[dxvk] Use vertex extent from vertex binding info
Computing this at runtime is fairly expensive, so try to avoid.
2022-08-07 17:58:19 +02:00
Philip Rebohle 6bcb0a0d61
[d3d11] Compute vertex extent in CreateInputLayout 2022-08-07 17:58:19 +02:00
Philip Rebohle 64169316e6
[d3d9] Compute vertex extent in BindInputLayout 2022-08-07 17:58:19 +02:00
Philip Rebohle bb8a87196f
[dxvk] Add vertex extent to vertex binding info 2022-08-07 17:58:19 +02:00
Robin Kertels ddb528cc8e [d3d9] Change texture before updating fetch4 2022-08-07 00:56:38 +01:00
Blisto91 7b28bbae11 [util] Disable unmapping for Saints Row 2 2022-08-06 21:13:32 +01:00
Georg Lehmann 135b8a0e53 [dxso] Setup spec ubo for pixel shaders 2022-08-06 12:35:23 +02:00
Georg Lehmann 6589966fce [d3d9] Fix FF VS fog with GPL 2022-08-06 12:35:23 +02:00
Joshua Ashton 65da0da954 [d3d9] Support for graphics pipeline libraries 2022-08-06 01:20:22 +00:00
Joshua Ashton 9108f8c76c [d3d9] Clean up fetch4 handling 2022-08-06 01:35:43 +01:00
Joshua Ashton 8c9601b4cd [d3d9] Remove generalHazards option
Move everything into MarkRenderHazard.

We are doing a big bump for driver support anyway, no reason to keep this around. Old drivers can take the perf penalty.
2022-08-06 01:33:30 +01:00
Joshua Ashton 63d582a6e7 [d3d9] Use VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_EXT for hazards if available 2022-08-06 01:33:30 +01:00
Joshua Ashton 90abd993d4 [d3d9] Pass feedback loop aspect mask to backend 2022-08-06 01:33:30 +01:00
Joshua Ashton 8d070e54a1 [d3d9] Enable extAttachmentFeedbackLoopLayout feature if available 2022-08-06 01:33:30 +01:00
Joshua Ashton 31d17efb48 [dxvk] Add feedback loop aspect flags to bindRenderTargets 2022-08-06 01:33:30 +01:00
Joshua Ashton dff514c924 [dxvk] Add hazard tracking to fragment output state
We need this to set the right pipeline bits for supporting attachment feedback loops on some vendors.
2022-08-06 01:33:30 +01:00
Joshua Ashton 43f53f3c0e [dxvk] Enable VK_EXT_attachment_feedback_loop_layout if available 2022-08-06 01:33:30 +01:00
Joshua Ashton 49b76fdd07 [dxvk] Support feedback loop layout in pickLayout 2022-08-06 01:33:30 +01:00
Joshua Ashton 9cf5c648d3 [vulkan] Add feedback loop layout to getWritableAspectsForLayout 2022-08-06 01:33:30 +01:00
Philip Rebohle e7b7299ec1
[dxvk] Also consider built-ins declared via OpMemberDecorate
Otherwise we'll miss D3D11 shaders. Oops...
2022-08-06 02:28:39 +02:00
Philip Rebohle 4d9c09b5e7
[dxvk] Don't use pipeline libraries for VS that doesn't export position 2022-08-06 02:09:55 +02:00
Philip Rebohle 3aa786fb6f
[dxvk] Get rid of MaxNumActiveBindings
This only existed due to the binding mask, which we removed with
the null descriptor rework. We can basically support an unlimited
number of descriptors now.
2022-08-06 01:53:08 +02:00
Philip Rebohle b950102233
[dxvk] Don't use MaxNumActiveBindings for descriptor updates 2022-08-06 01:44:56 +02:00
Philip Rebohle 6fba4c47fe
[dxvk] Don't use MaxNumActiveBindings when creating descriptor set layouts 2022-08-06 01:37:17 +02:00
Philip Rebohle 2fe61675bf
[dxvk] Use existing bit mask iterator when updating descriptor sets
And clean up the code a little.
2022-08-05 21:43:11 +02:00
Robin Kertels 9e1ecec79f [d3d9] Disable fetch4 when binding an incompatible texture
Fixes lighting in Spider-Man: Shattered Dimensions.
2022-08-05 19:33:32 +01:00
Philip Rebohle d498551a23 [dxso] Add bit selectors to D3D9ShaderSpecConstantManager
Avoids doing double bitfield extractions which isn't
optimized right now.
2022-08-05 19:31:02 +01:00
Joshua Ashton 9619377723 [dxso] Convert opIEqual 1 -> opINotEqual 0
Better chance of getting optimized
2022-08-05 19:31:02 +01:00
Joshua Ashton b2cbf198e4 [d3d9, dxso] Refactor spec constants to use a bitfield layout
This allows us to use the same information to dump into a push constant for unoptimized pipelines.
2022-08-05 19:31:02 +01:00
Joshua Ashton 438ae5cdfc [dxso] Fix getting sampler type of vertex textures
Fixes: c7afe0dd23
2022-08-05 19:31:02 +01:00
Philip Rebohle 7e237b33b7
[d3d11] Track highest bound unordered access view 2022-08-05 14:13:25 +02:00
Philip Rebohle 934caa3fd7
[d3d11] Track highest bound vertex buffer 2022-08-05 14:13:25 +02:00
Philip Rebohle 3dbd9d8659
[d3d11] Track highest bound sampler 2022-08-05 14:13:25 +02:00
Philip Rebohle 6c372e40f6
[d3d11] Track highest bound shader resource 2022-08-05 14:13:24 +02:00
Philip Rebohle 5dd2b20940
[d3d11] Track highest bound constant buffer 2022-08-05 14:13:24 +02:00
Philip Rebohle 18c4ca8e92
[d3d11] Introduce D3D11MaxUsedBindings
And use it in ResetCommandListState, in order to avoid redundant state changes.
2022-08-05 14:13:24 +02:00
Philip Rebohle ebbb77518a
[d3d11] Clean up after performing video blit
Otherwise, with the upcoming clear/restore optimizations,
we'd possibly leave some resources bound.
2022-08-05 14:13:24 +02:00
Philip Rebohle 9f07bc6532
[d3d11] Refactor shader state 2022-08-05 14:13:24 +02:00
Philip Rebohle 95ab1465ab
[d3d11] Add reset method to more context state 2022-08-05 14:13:24 +02:00
Philip Rebohle 4e1f6e5efd
[d3d11] Refactor unordered access view and output merger state 2022-08-05 14:13:24 +02:00
Philip Rebohle 8383423fbe
[d3d11] Refactor sampler state 2022-08-05 14:13:24 +02:00
Philip Rebohle 1b4cb66dc3
[d3d11] Refactor shader resource state 2022-08-05 14:13:24 +02:00
Philip Rebohle 33e169e85f
[d3d11] Refactor constant buffer state 2022-08-05 14:13:24 +02:00
Philip Rebohle 7685a86494
[d3d11] Change state restoring behaviour in SwapDeviceContextState 2022-08-05 14:13:24 +02:00
Philip Rebohle c7d9201303
[d3d11] Change state clearing behaviour around deferred contexts
Resetting command list state at the end of each D3D11 command list,
as well as before ExecuteCommandList, will allow us to track which
state needs to be reset, which may save us a significant amount of
CPU work.
2022-08-05 14:13:24 +02:00
Philip Rebohle 91fc0a8688
[d3d11] Rename and factor out some state clearing methods 2022-08-05 14:13:21 +02:00
Philip Rebohle 211ad0efcc
[dxvk] Always use init barrier set for initial transition in initImage
This allows us to batch image initialization barriers better.
2022-08-05 12:46:41 +02:00
Philip Rebohle 0f94971193
[d3d11,d3d9] Lock context/device in EndFrame
Fixes #2787.
2022-08-05 12:10:03 +02:00
Philip Rebohle 37a2b02558
[d3d11] Fix compiler error on GCC 10.3 2022-08-04 18:42:13 +02:00
Philip Rebohle 67c11e63e6
[dxvk] Remove old resource binding methods 2022-08-04 13:43:36 +02:00
Philip Rebohle 37337dd4a6
[dxvk] Use new binding methods for swapchain blitter 2022-08-04 13:43:36 +02:00
Philip Rebohle 77e7c7c6b8
[hud] Use new binding methods for HUD rendering 2022-08-04 13:43:36 +02:00
Philip Rebohle 9d967f2fed
[d3d11] Use new binding methods in video context 2022-08-04 13:43:36 +02:00
Philip Rebohle e49524fcb0
[d3d11] Move GetType and GetContextFlags to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 1d2d712dfb
[d3d11] Move d3d11_context_common.* -> d3d11_context.* 2022-08-04 13:43:36 +02:00
Philip Rebohle 30b1cac0ae
[d3d11] Remove old D3D11DeviceContext class 2022-08-04 13:43:36 +02:00
Philip Rebohle 20df9fc899
[d3d11] Move all remaining context code to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle a3ed84c0c1
[d3d11] Move remaining D3D11DeviceContext members to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle b20bfe763e
[d3d11] Move D3D10Multithread instance to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 9a2d8878ef
[d3d11] Move Track*SequenceNumber methods to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 532b3a6add
[d3d11] Move EmitCs and related methods to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle e0ea272c0d
[d3d11] Move misc methods to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 9e916edef9
[d3d11] Move Draw* and Dispatch* methods to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 1d87af062c
[d3d11] Move ResolveSubresource to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 17c318864e
[d3d11] Move Apply* methods to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 7c82ed35b2
[d3d11] Move internal resource update methods to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 956bad5e84
[d3d11] Move GenerateMips to D3D11CommonContext 2022-08-04 13:43:36 +02:00
Philip Rebohle 751d7467df
[d3d11] Move Clear* methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle 50942cd2d9
[d3d11] Move Copy* methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle 163af1309d
[d3d11] Move SetPredication to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle b8b5662461
[d3d11] Move Discard* methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00
Philip Rebohle efea51c254
[d3d11] Move SO* methods to D3D11CommonContext 2022-08-04 13:43:35 +02:00