diff options
author | David Snopek <dsnopek@gmail.com> | 2022-11-03 08:47:28 -0500 |
---|---|---|
committer | David Snopek <dsnopek@gmail.com> | 2022-11-03 13:03:30 -0500 |
commit | 7fb8b931d7547fe1f02febc9cca636ef187d2942 (patch) | |
tree | 922df3a645c87ee6fb6aa09b23e9db1cfd1404fb /servers/rendering/renderer_rd | |
parent | c0de8d32d51d579e6dc1a5aac3fbcd6c7104eb61 (diff) |
Collapse three seperate texture storage methods into render_target_set_override()
Diffstat (limited to 'servers/rendering/renderer_rd')
-rw-r--r-- | servers/rendering/renderer_rd/storage_rd/texture_storage.cpp | 20 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/storage_rd/texture_storage.h | 4 |
2 files changed, 5 insertions, 19 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp index bc70c57b69..3785c3899b 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp @@ -2594,11 +2594,13 @@ RID TextureStorage::render_target_get_texture(RID p_render_target) { return rt->texture; } -void TextureStorage::render_target_set_override_color(RID p_render_target, RID p_texture) { +void TextureStorage::render_target_set_override(RID p_render_target, RID p_color_texture, RID p_depth_texture, RID p_velocity_texture) { RenderTarget *rt = render_target_owner.get_or_null(p_render_target); ERR_FAIL_COND(!rt); - rt->overridden.color = p_texture; + rt->overridden.color = p_color_texture; + rt->overridden.depth = p_depth_texture; + rt->overridden.velocity = p_velocity_texture; } RID TextureStorage::render_target_get_override_color(RID p_render_target) const { @@ -2608,13 +2610,6 @@ RID TextureStorage::render_target_get_override_color(RID p_render_target) const return rt->overridden.color; } -void TextureStorage::render_target_set_override_depth(RID p_render_target, RID p_texture) { - RenderTarget *rt = render_target_owner.get_or_null(p_render_target); - ERR_FAIL_COND(!rt); - - rt->overridden.depth = p_texture; -} - RID TextureStorage::render_target_get_override_depth(RID p_render_target) const { RenderTarget *rt = render_target_owner.get_or_null(p_render_target); ERR_FAIL_COND_V(!rt, RID()); @@ -2641,13 +2636,6 @@ RID TextureStorage::render_target_get_override_depth_slice(RID p_render_target, } } -void TextureStorage::render_target_set_override_velocity(RID p_render_target, RID p_texture) { - RenderTarget *rt = render_target_owner.get_or_null(p_render_target); - ERR_FAIL_COND(!rt); - - rt->overridden.velocity = p_texture; -} - RID TextureStorage::render_target_get_override_velocity(RID p_render_target) const { RenderTarget *rt = render_target_owner.get_or_null(p_render_target); ERR_FAIL_COND_V(!rt, RID()); diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.h b/servers/rendering/renderer_rd/storage_rd/texture_storage.h index 00b4e50737..72d4c90159 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.h @@ -718,12 +718,10 @@ public: virtual void render_target_set_vrs_texture(RID p_render_target, RID p_texture) override; virtual RID render_target_get_vrs_texture(RID p_render_target) const override; - virtual void render_target_set_override_color(RID p_render_target, RID p_texture) override; + virtual void render_target_set_override(RID p_render_target, RID p_color_texture, RID p_depth_texture, RID p_velocity_texture) override; virtual RID render_target_get_override_color(RID p_render_target) const override; - virtual void render_target_set_override_depth(RID p_render_target, RID p_texture) override; virtual RID render_target_get_override_depth(RID p_render_target) const override; RID render_target_get_override_depth_slice(RID p_render_target, const uint32_t p_layer) const; - virtual void render_target_set_override_velocity(RID p_render_target, RID p_texture) override; virtual RID render_target_get_override_velocity(RID p_render_target) const override; RID render_target_get_override_velocity_slice(RID p_render_target, const uint32_t p_layer) const; |