doitsujin / dxvk

Vulkan-based implementation of D3D9, D3D10 and D3D11 for Linux / Wine
zlib License
12.25k stars 783 forks source link

Support ROV via new VK_EXT_fragment_shader_interlock extension.. #1114

Closed oscarbg closed 5 years ago

oscarbg commented 5 years ago

the demo: https://software.intel.com/en-us/articles/programmable-blend-with-pixel-shader-ordering uses D3D11.3 ROV feature: download "Code samples add win 10 support": https://software.intel.com/en-us/file/programmableblend-win10zip

I attach precompiled executable in case you don't want to build: ProgrammableBlend_R64.zip extract executable on main folder (same as ProgrammableBlend.sln)

with DXVK 1.2.3 option "RGBE with Rasterizer Order Views" is not selectable as it doesn't expose ROV support.. and default RGBE option doesn't render correctly transparent objects (this is on purpose as DX11 also renders incorrectly).. D3D ROV support should be implementable with VK_EXT_fragment_shader_interlock.. NV and Mesa ANV support that extension now..

System information

doitsujin commented 5 years ago

I don't have any hardware to test this with. Which games/applications require this feature?

Do note that DXVK does not even support D3D11.2 simply because nobody uses it.

oscarbg commented 5 years ago

any Intel Skylake or newer GPU or any NV newer than Maxwell should support it.. you don't have any of these?.. in that case let's wait for AMD VK support.. should be supp. in Vega or newer hardware..

yep.. really seems no DX11 games use it.. another Intel similar sample is (using D3D11.3 ROV): https://github.com/GameTechDev/AOIT-Update I can compile if needed..

sadly the only games that maybe using it are using "PixelSync" Intel HLSL extension: from: https://software.intel.com/en-us/articles/oit-approximation-with-pixel-synchronization-update-2014

The Order Independent Transparency sample using Intel® Iris™ graphics extension for pixel synchronization shows a real-time solution using the extensions available on 4th Generation Intel® Core™ processors. Codemasters used the algorithm in GRID* 2 and GRID Autosport to improve rendering of foliage and semi-transparent track side objects as shown in Figure 1.

all I can find is recent Lumberyard engine has (D3D11.2 and D3D12) OIT support using ROV : https://docs.aws.amazon.com/lumberyard/latest/userguide/graphics-rendering-order-independent-transparency.html for D3D12 situation is better, we have: Xenia D3D12 uses ROV feature to "better" emulate EDRAM.. and also can find some github projects make some use of it: Voxellization using ROVs and conservative raster (D3D12) (My weekend project: voxelizing on the GPU using Rasterizer Order Views: https://twitter.com/MyNameIsMJP/status/937552329359859712) code here: https://github.com/TheRealMJP/BakingLab commit adding ROV: TheRealMJP/BakingLab@5b29f2e commit adding conser raster: TheRealMJP/BakingLab@54d8e2f

maybe some new DX12 games optionally use it?

you can see my complete findings when I requested support for that extension: https://github.com/KhronosGroup/Vulkan-Ecosystem/issues/27

doitsujin commented 5 years ago

Not going to bother if there aren't going to be any real-world benefits.

SeongGino commented 2 years ago

Sorry to necrobump but I've found this relevant in a separate/tangentially related issue from another project. https://github.com/SleepKiller/shaderpatch/ is a rendering update/overhaul for SWBF2 (2005) which will not recognize my GPU's OIT support (despite being a GTX 1060) for optimal functionality. The discussion in this issue regarding the mod's Proton support, towards the bottom, suggests _VK_EXT_fragment_shaderinterlock is needed to have feature parity with W10.

It's a stretch to assume this alone justifies the work needed to make this working, but I felt this should still be made known regardless.

oscarbg commented 1 year ago

@doitsujin please don't get angry because of updating this issue, but seems ANGLE D3D11 backend (used by default on Firefox and Chrome on Windows for WebGL1/2?) has gained support for a new extension ANGLE_shader_pixel_local_storage (https://chromium.googlesource.com/angle/angle/+/refs/heads/main/extensions/ANGLE_shader_pixel_local_storage.txt) and supporting it on D3D11 requires usage of ROV.. see: https://github.com/google/angle/commit/9d41585e1408603a254fe661a8c49248740ab9a7 https://github.com/google/angle/commit/51de3837499465ea0cc3f939ace25c144719e660 just pointing out..

Blisto91 commented 1 year ago

@oscarbg https://github.com/doitsujin/dxvk/commit/a14ce8d1b0e392b2c3e71e32b5dee90641933075