1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Metal: Ensure correct output texture format selection

This commit is contained in:
Stuart Carnie
2025-08-08 06:15:54 +10:00
parent 80a219a58a
commit c8b5982d0f
2 changed files with 11 additions and 1 deletions

View File

@@ -255,11 +255,20 @@ void RenderSceneBuffersRD::ensure_mfx(RendererRD::MFXSpatialEffect *p_effect) {
if (mfx_spatial_context) {
return;
}
RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton();
RenderingDevice *rd = RD::get_singleton();
// Determine the output format of the render target.
RID dest = texture_storage->render_target_get_rd_texture(render_target);
RD::TextureFormat tf = rd->texture_get_format(dest);
RD::DataFormat output_format = tf.format;
RendererRD::MFXSpatialEffect::CreateParams params = {
.input_size = internal_size,
.output_size = target_size,
.input_format = base_data_format,
.output_format = RD::DATA_FORMAT_R8G8B8A8_UNORM,
.output_format = output_format,
};
mfx_spatial_context = p_effect->create_context(params);

View File

@@ -1352,6 +1352,7 @@ void RendererViewport::viewport_set_use_hdr_2d(RID p_viewport, bool p_use_hdr_2d
}
viewport->use_hdr_2d = p_use_hdr_2d;
RSG::texture_storage->render_target_set_use_hdr(viewport->render_target, p_use_hdr_2d);
_configure_3d_render_buffers(viewport);
}
bool RendererViewport::viewport_is_using_hdr_2d(RID p_viewport) const {