|
3 | 3 | // found in the LICENSE file. |
4 | 4 |
|
5 | 5 | #include "impeller/entity/render_target_cache.h" |
| 6 | +#include "impeller/core/formats.h" |
6 | 7 | #include "impeller/renderer/render_target.h" |
7 | 8 |
|
8 | 9 | namespace impeller { |
@@ -52,10 +53,10 @@ RenderTarget RenderTargetCache::CreateOffscreen( |
52 | 53 | const auto other_config = render_target_data.config; |
53 | 54 | if (!render_target_data.used_this_frame && other_config == config) { |
54 | 55 | render_target_data.used_this_frame = true; |
55 | | - auto color0 = render_target_data.render_target.GetColorAttachments() |
56 | | - .find(0u) |
57 | | - ->second; |
58 | | - auto depth = render_target_data.render_target.GetDepthAttachment(); |
| 56 | + ColorAttachment color0 = |
| 57 | + render_target_data.render_target.GetColorAttachment(0); |
| 58 | + std::optional<DepthAttachment> depth = |
| 59 | + render_target_data.render_target.GetDepthAttachment(); |
59 | 60 | std::shared_ptr<Texture> depth_tex = depth ? depth->texture : nullptr; |
60 | 61 | return RenderTargetAllocator::CreateOffscreen( |
61 | 62 | context, size, mip_count, label, color_attachment_config, |
@@ -102,10 +103,10 @@ RenderTarget RenderTargetCache::CreateOffscreenMSAA( |
102 | 103 | const auto other_config = render_target_data.config; |
103 | 104 | if (!render_target_data.used_this_frame && other_config == config) { |
104 | 105 | render_target_data.used_this_frame = true; |
105 | | - auto color0 = render_target_data.render_target.GetColorAttachments() |
106 | | - .find(0u) |
107 | | - ->second; |
108 | | - auto depth = render_target_data.render_target.GetDepthAttachment(); |
| 106 | + ColorAttachment color0 = |
| 107 | + render_target_data.render_target.GetColorAttachment(0); |
| 108 | + std::optional<DepthAttachment> depth = |
| 109 | + render_target_data.render_target.GetDepthAttachment(); |
109 | 110 | std::shared_ptr<Texture> depth_tex = depth ? depth->texture : nullptr; |
110 | 111 | return RenderTargetAllocator::CreateOffscreenMSAA( |
111 | 112 | context, size, mip_count, label, color_attachment_config, |
|
0 commit comments