diff options
author | Hendrik Brucker <hendrik.brucker@mail.de> | 2022-08-13 01:02:32 +0200 |
---|---|---|
committer | Hendrik Brucker <hendrik.brucker@mail.de> | 2022-08-13 01:09:48 +0200 |
commit | e96b1a2c0c46f575454603631e85daf78081764a (patch) | |
tree | ba270cb9b65cd6199c05d9c33293c2749355027f /drivers/gles3/storage | |
parent | f2a61684143af02a8cbe7002645af817607f9bd6 (diff) |
Implement MSAA for 2D [Vulkan only]
Diffstat (limited to 'drivers/gles3/storage')
-rw-r--r-- | drivers/gles3/storage/texture_storage.cpp | 13 | ||||
-rw-r--r-- | drivers/gles3/storage/texture_storage.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index 543638e8ff..b8ab4d6839 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -1564,6 +1564,19 @@ void TextureStorage::render_target_clear_used(RID p_render_target) { rt->used_in_frame = false; } +void TextureStorage::render_target_set_msaa(RID p_render_target, RS::ViewportMSAA p_msaa) { + RenderTarget *rt = render_target_owner.get_or_null(p_render_target); + ERR_FAIL_COND(!rt); + if (p_msaa == rt->msaa) { + return; + } + + WARN_PRINT("2D MSAA is not yet supported for GLES3."); + _clear_render_target(rt); + rt->msaa = p_msaa; + _update_render_target(rt); +} + void TextureStorage::render_target_request_clear(RID p_render_target, const Color &p_clear_color) { RenderTarget *rt = render_target_owner.get_or_null(p_render_target); ERR_FAIL_COND(!rt); diff --git a/drivers/gles3/storage/texture_storage.h b/drivers/gles3/storage/texture_storage.h index 71f713bc9f..4f4032723b 100644 --- a/drivers/gles3/storage/texture_storage.h +++ b/drivers/gles3/storage/texture_storage.h @@ -528,6 +528,7 @@ public: virtual void render_target_set_direct_to_screen(RID p_render_target, bool p_direct_to_screen) override; virtual bool render_target_was_used(RID p_render_target) override; void render_target_clear_used(RID p_render_target); + virtual void render_target_set_msaa(RID p_render_target, RS::ViewportMSAA p_msaa) override; // new void render_target_set_as_unused(RID p_render_target) override { |