You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-04 17:04:49 +00:00
Ensure we use DATA_FORMAT_R32_SFLOAT for depth resolve buffer on Forward+
This commit is contained in:
@@ -730,11 +730,8 @@ uint32_t RenderSceneBuffersRD::get_color_usage_bits(bool p_resolve, bool p_msaa,
|
|||||||
}
|
}
|
||||||
|
|
||||||
RD::DataFormat RenderSceneBuffersRD::get_depth_format(bool p_resolve, bool p_msaa, bool p_storage) {
|
RD::DataFormat RenderSceneBuffersRD::get_depth_format(bool p_resolve, bool p_msaa, bool p_storage) {
|
||||||
// TODO Our rendering engine does not support just having a depth attachment, it always assumed we combine with stencil.
|
if (p_resolve && (p_storage || !RenderingDevice::get_singleton()->has_feature(RD::SUPPORTS_FRAMEBUFFER_DEPTH_RESOLVE))) {
|
||||||
// We thus can't configure our depth resolve with RD::DATA_FORMAT_R32_SFLOAT.
|
// Use R32 for resolve on Forward+ (p_storage == true), or if we don't support depth resolve.
|
||||||
// We should add support for TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT or add a TEXTURE_USAGE_DEPTH_RESOLVE_ATTACHMENT_BIT
|
|
||||||
|
|
||||||
if (p_resolve && !RenderingDevice::get_singleton()->has_feature(RD::SUPPORTS_FRAMEBUFFER_DEPTH_RESOLVE)) {
|
|
||||||
return RD::DATA_FORMAT_R32_SFLOAT;
|
return RD::DATA_FORMAT_R32_SFLOAT;
|
||||||
} else {
|
} else {
|
||||||
const RenderingDeviceCommons::DataFormat preferred_formats[2] = {
|
const RenderingDeviceCommons::DataFormat preferred_formats[2] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user