- Accumulation blend: Require 32 bit RT is only when texture barriers/multidraw fb copies are on/supported.
- Barrier DATE:
Always use barrier date if texture barrier/multidraw fb copies are supported.
Check if texture barriers/multidraw fb copies are supported before enabling barrier date for AA1.
Move conflict check inside OMSetRenderTargets, it's easier to track and gets rid of duplicate code.
Move shader resource binding after rtv/dsv binding, easier to track and manage srv conflicts.
Get rid of shader resource pre binding, while it may work it's more of a headache to track so many states and things can go wrong easily, so just get rid of it, especially with shader binding after rtv/dsv binding.
Only in Force Enabled mode as it's not guaranteed to work, otherwise use multidraw fb copy.
Also added nv texture barrier fallback when regular texture barrier isn't supported.
Currently pre binding doesn't work correctly/to it's full capacity as I forgot to update PSUnbindConflictingSRVs.
When doing a pre bind idea is to update local state, then if there are no conflicts to use that newly updated local state instead of unbinding the slot, this will avoid unnecessary re bindings.
Don't set blend state and color mask when writing depth stencil only.
Blend state and color mask is used when writing to render target.
Don't set depth stencil state when writing render target only.
Depth stencil state is used when writing to depth stencil only.
Don't set blend state when writing depth stencil only.
Blend state is used when writing to render target.
Don't set depth stencil state when writing render target only.
Depth stencil state is used when writing to depth stencil only.
In some cases if we don't have a first ate pass but we do a second pass we swap the ate second pass to the first, in such case we can also allow date one/primid/date barrier cases enabled.
When alpha is written extend only when there's no alpha second pass to date one/date barrier/date primid.
When alpha isn't written extend to date barrier.
1. Expand 4 pixel boundaries correction to non overlapping draws.
2. If the copy area covers 95% or more of the render target size switch to full copies using CopyResource instead of CopySubresourceRegion.
At this size using full copies should be faster.
Currently it is only used when texture barriers are disabled but can be used when Depth testing/Afail copies are implemented.
3. Backport to other renderers DX12/GL/VK.
Idea:
PSSetShaderResource binds local state only (ps_sr_views).
PSUnbindConflictingSRVs binds/updates local and gpu state (ps_sr_views, ps_cached_sr_views and srv gpu state)
What we can do is before checking for conflicts we can preemptively bind new tex on the local state if it's not already bound to the current render target, depth target, then PSUnbindConflictingSRVs will update the gpu state when it checks for conflicts.
Then the following update that happens during the Draw which calls for a gpu upgrade will be ignored since it's already been updated.
Add the copy counters in the function themselves, easier to track.
This also tracks other shader copies such as setupdate, primid date,
post processing such as shade boost and others which weren't tracked before.
If not then use DXGI_FORMAT_R16G16B16A16_FLOAT,
it will be less precise but will still work on feature level 10.0 and some 10.1 gpus and allow for hardware blending.
Fixes api warning in specific scenario when force running through dxcpl:
D3D11 INFO: ID3D11DeviceContext::OMSetRenderTargets: Forcing OM Render Target slot 0 to NULL , since calling Present for DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL SwapChains unbinds backbuffer 0 from all GPU writeable bind points, except for DXGI_PRESENT_DO_NOT_SEQUENCE or DXGI_PRESENT_TEST usage. [ STATE_SETTING INFO 49: OMSETRENDERTARGETS_UNBINDDELETINGOBJECT]
On older versions of Windows 10 (example 2019 LTSC) D3D12GetInterface may fail because it doesn't exist, in such case we can check if D3D12GetInterface exists first.
DX12 trades blows with Vulkan on AMD depending on cpu usage and will be stable on RDNA 3 so let's default to it.
NVIDIA: 590 drivers on Nvidia are bad causing performance regressions so let's switch to DX12 as the default.
Check if depth copies are supported first.
If depth copies aren't supported fallback to doing full depth copies, also make sure source and destination rects match.
dx11 doesn't support partial depth copies.
dx12 supports depth copies with Programmable Sample Positions tier 1 and up.
Add missing osd copy counts for moves.
We can just do blit for all since performance is the same.
VK/GL: Tex is fb requires the copy to be bound on slot 0 as well.
Fixes validation errors on VK when barriers are force disabled.
DX12: Always create a copy if barriers aren't supported for sw blend or tex is fb.
Fixes issues when barriers are force disabled.
Fixes api warning on dx11: The Pixel Shader expects a Render Target View bound to slot 1, but none is bound.
Might also fix some potential crashes on intel gpus on all apis (mostly dx11/12).
No longer needed, these conditions were originally used to use less copies on dx11/12 on basic blend.
Currently all renderers by default will hit the code so the old checks are kinda redundant, also copies are faster than they used to be.
Don't enable color_dest_blend if it's a channel shuffle or dithering draw.
Don't enable color_dest_blend2 if it's preferring sw blend or dithering draw.
Don't enable blend_zero_to_one_range if it's preferring sw blend or dithering draw.
We currently have a barrier so let's do date_one in a single pass, plus this avoids any issues with copies and stencil issues.
On dx copies are slower so we can only use the optimization if we have barriers already present.
We don't need to unbind conflicting srv with dsv if the dsv itself is read only, it is used for depth testing and both can be bind at the same time.
Avoids re binding srv using a read only dsv.
Properly unbind slot 0 if previous draw was tex is fb or tex is ds.
Mirrors vk behavior.
Don't recycle draw_rt_clone in colclip, it's null at this point anyway.
Don't bind rt on slot 2 if we have multidraw fb copy enabled.
Mirrors barrier behavior on vk.
If alpha write is masked and barrier/copy enabled then we can switch to DATE_BARRIER since it uses the destination alpha for testing anyway.
By default this is enabled on vk/gl but not on dx11/12 as copies are slow so we can enable it now since rt alpha is read anyway.
When barriers/multidraw fb copy is supported no change.
When barriers/multidraw fb copy isn't supported keep the same levels but only enable them if there's no overlap.
Since dx11/12 now supports sw blending and copies/draw area/quads optimizations have been made perf impact will be lower so we can use the same unified path if texture barriers are disabled.