GS/HW: ROV revisions.#14555
Conversation
fa26d11 to
7b35432
Compare
|
Last push rewrites a good chunk on the PR. Instead of having shader access flags tied to the format, it's made a separate flags for greater flexibility (shader write access can be added to RenderTarget or Texture separately). |
65d53c1 to
8159cd8
Compare
There was a problem hiding this comment.
Instead of adding a separate bool for rw, maybe make type a usage enum, since that's how all the backends (except OpenGL) treat it anyways. (You can make the read / srv usage implcit, since we never make unreadable textures.)
There's an EnumOps.h in common that defines a MARK_ENUM_AS_FLAGS(T) to define boolean operators on an enum class for you.
|
Actually while you're at it, could you add a separate usage bit for feedback loop to separate GS RTs from postprocessing effects? Given the mess that was depth feedback on non-Vulkan, I suspect drivers are disabling some optimizations for depth textures with feedback as well. |
3b9fc86 to
e33e2bd
Compare
Yes, that sounds liks a good approach to simplifying things.
Sure, can do. @TheLastRar Is the simultaneous texture flag in DX12 similar to the feedback loop flag in VK? I'm wondering whether it would also be okay to omit it for postprocessing RTs. |
Yes, we only use that flag for feedback support, so we can omit it for the postprocessing RTs. |
That makes sense, thanks. |
|
Last push adds back feedback flags to colorclip textures on all backends, which had been incorrectly omitted. Test dump is attached, which otherwises crashes on my system on DX12. Chronicles of Narnia, The - Prince Caspian_SLES-55145_20230405202229.gs.xz.zip |
42f0062 to
97ace65
Compare
aa51aa7 to
c31df35
Compare
c31df35 to
a28e0a8
Compare
35fe8f7 to
4d56f93
Compare
30ae28a to
c89af13
Compare
c89af13 to
f897c19
Compare
…ormats. Co-authored-by: TellowKrinkle
Usage fits more cleanly with API flags. Also separates out feedback and write usage from render target. Co-authored-by: TellowKrinkle
Use GSTexture::FeedbackTarget RTs by default (not GSTexture::ShaderWriteTarget). Do ROV type conversion for both color and depth (if needed). Make sure the formats for ROV actually support UAV/storage image. Change 'PSSetUnorderedAccess' to 'PSSetROVs' for clarity. DX12: Use enum names instead of raw constants in PSSetShaderResource(). Some string format cleanup to GL_*() macros. VK: Do not enable ROV if FB fetch is available. Other misc cosmetic changes such as whitespace, etc. Co-authored-by: TellowKrinkle
Force color ROV if depth ROV is used. Only force color/depth ROV if the draw actually uses both color/depth (fixes a bug with temporary DS for stencil being used as a ROV). Simplify the ROV activation heuristic a bit (removed unused variables, simplify barrier counting, etc.)
…vice::FetchSurface(). prefer_reuse is the opposite of prefer_unused_texture, so all corresponding arguments are inverted.
f897c19 to
3ca8266
Compare
…oggles, AF + 8x upscale - GS: port PCSX2 PCSX2#14555 ROV revisions + PCSX2#14465 anisotropic-filter shader optimization (early isotropic fallback, cheaper math); bump ShaderCacheVersion - Renderer: add Vulkan framebuffer-fetch (ROAA) accurate-blending fast path on Adreno via EnableAdrenoFramebufferFetch (default off, experimental) - the mobile-native equivalent of ROV, restart to apply, no effect on Mali/OpenGL - Renderer: add ROV, Accurate Alpha Test, and HW AA1 toggles; raise internal upscale range to 8x - GameDB: surface an on-screen notice when a game recommends Accurate Alpha Test or AA1 - TextureCache: port upstream Move correctness fix for destination-target match - Controllers: fall back to the device's own vibration motor when the gamepad exposes no usable rumble actuator (#241; e.g. Odin 3) - Skins: read newer per-side analog filenames (analog_stick_left/right); older single analog_stick + analog_base packs still import - Settings: rename "Game Fixes" to "GameDB Fixes" for clarity
Description of Changes
texture->GetType() == GSTexture::Type::RenderTargettotexture->IsRenderTarget()(cosmetic change).If possible, the following reviews would be helpful. Thanks in advance.
Rationale behind Changes
Usage enum was added to avoid adding unordered access/storage image/shader write flags to all RTs, since this may have a negative performance impact when ROV is not used. It also maps better to the way backends specify texture creation flags.
Other changes are explained in the description above.
Suggested Testing Steps
Test DX11/DX12/VK with ROV enabled.
Testing with dump runs at max blend (DX11/DX12/VK) and max blend + AAT + AA1 (DX11/DX12/VK/GL).
Tested on Metal by @SternXD with AA1 + AAT and FB fetch enabled/disabled.
Future Work
The logic for handling attachments in RenderHW() is a bit complicated since we now have RT, DS, RT ROV, DS ROV, DS as RT, so it might be nice to organize this better, such as by putting them in a RenderAttachments struct.
We might need to make the ROV heuristic less aggressive since it may cause performance regressions, especially with lower blend levels.
Did you use AI to help find, test, or implement this issue or feature?
Yes, for some questions about texture creation on difference backends.