summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/storage_rd
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2023-02-24 13:50:13 +1100
committerBastiaan Olij <mux213@gmail.com>2023-02-24 16:13:18 +1100
commit4c2f33cfae9f434eff1d065b6a9c7f98c3e81e9c (patch)
tree80bfb06bc33ecad54b2d84c61161cc32966afa37 /servers/rendering/renderer_rd/storage_rd
parente930c8d3838280e40baabc4426bd8236f7ac50a3 (diff)
Fixing issues with SSIL artifacts
Diffstat (limited to 'servers/rendering/renderer_rd/storage_rd')
-rw-r--r--servers/rendering/renderer_rd/storage_rd/render_scene_buffers_rd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/render_scene_buffers_rd.cpp b/servers/rendering/renderer_rd/storage_rd/render_scene_buffers_rd.cpp
index e1dc9f8624..609fb2afe7 100644
--- a/servers/rendering/renderer_rd/storage_rd/render_scene_buffers_rd.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/render_scene_buffers_rd.cpp
@@ -151,11 +151,11 @@ void RenderSceneBuffersRD::configure(RID p_render_target, const Size2i p_interna
uint32_t usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT;
if (msaa_3d == RS::VIEWPORT_MSAA_DISABLED) {
- format = RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_D24_UNORM_S8_UINT, (RD::TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | RD::TEXTURE_USAGE_SAMPLING_BIT)) ? RD::DATA_FORMAT_D24_UNORM_S8_UINT : RD::DATA_FORMAT_D32_SFLOAT_S8_UINT;
usage_bits |= RD::TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
+ format = RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_D24_UNORM_S8_UINT, usage_bits) ? RD::DATA_FORMAT_D24_UNORM_S8_UINT : RD::DATA_FORMAT_D32_SFLOAT_S8_UINT;
} else {
format = RD::DATA_FORMAT_R32_SFLOAT;
- usage_bits |= RD::TEXTURE_USAGE_CAN_COPY_TO_BIT | RD::TEXTURE_USAGE_STORAGE_BIT;
+ usage_bits |= RD::TEXTURE_USAGE_CAN_COPY_TO_BIT | (can_be_storage ? RD::TEXTURE_USAGE_STORAGE_BIT : 0);
}
create_texture(RB_SCOPE_BUFFERS, RB_TEX_DEPTH, format, usage_bits);