Closed werman closed 1 month ago
On the D3D11 side of things, the sampling usage already mostly depends on whether the game passes the equivalent D3D11 bind flag. There are a few cases where we add USAGE_SAMPLING without that but in those cases it's usually necessary for meta passes like blits/copies.
I need to re-check the D3D9 side, I think we can probably indeed get rid of the sampling usage in a lot of scenarios. IIRC D3D9 doesn't allow sampling depth buffers aside from a few special driver-hack texture formats but I need to make sure my memory isn't wrong there. On top of that I also need to make sure we don't need it for some internal meta pass like D3D9Device::StretchRect.
Ok, with the additional discussion in discord, it seems that the best solution is to ignore this edge case for DXVK and VKD3D-proton in Turnip, since there is no app that relies on this behavior.
Added the workaround in turnip: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30545
I'll have a look at removing unnecessary SAMPLE_BIT flags regardless but ignoring it for engine name = DXVK obviously covers all cases.
This was addressed in 2.4.1.
All depth-stencil attachments in DXVK have
VK_IMAGE_USAGE_SAMPLED_BIT
set (I'm sure about d3d9, but haven't looked at d3d11 too close), which is fine for Turnip for all formats butVK_FORMAT_D24_UNORM_S8_UINT
. For this format whencustomBorderColorWithoutFormat
is enabled we have to use different internal format and disable compression (UBWC) for it, which is obviously bad.In
D3D9_COMMON_TEXTURE_DESC
I seeIsAttachmentOnly
. Maybe in such case DS image may skip SAMPLED flag?Anyway, I'm not versed in D3D api, so the question is whether it's possible to skip
VK_IMAGE_USAGE_SAMPLED_BIT
for DS attachments?