|
45 | 45 | id<MTLTexture> texture, |
46 | 46 | bool requires_blit, |
47 | 47 | std::optional<IRect> clip_rect) { |
48 | | - // compositor_context.cc will offset the rendering by the clip origin. Here we |
49 | | - // shrink to the size of the clip. This has the same effect as clipping the |
50 | | - // rendering but also creates smaller intermediate passes. |
51 | | - ISize root_size; |
52 | | - if (requires_blit) { |
53 | | - if (!clip_rect.has_value()) { |
54 | | - VALIDATION_LOG << "Missing clip rectangle."; |
55 | | - return std::nullopt; |
56 | | - } |
57 | | - root_size = ISize(clip_rect->size.width, clip_rect->size.height); |
58 | | - } else { |
59 | | - root_size = {static_cast<ISize::Type>(texture.width), |
60 | | - static_cast<ISize::Type>(texture.height)}; |
61 | | - } |
62 | | - |
63 | 48 | TextureDescriptor resolve_tex_desc; |
64 | 49 | resolve_tex_desc.format = FromMTLPixelFormat(texture.pixelFormat); |
65 | | - resolve_tex_desc.size = root_size; |
| 50 | + resolve_tex_desc.size = {static_cast<ISize::Type>(texture.width), |
| 51 | + static_cast<ISize::Type>(texture.height)}; |
66 | 52 | resolve_tex_desc.usage = static_cast<uint64_t>(TextureUsage::kRenderTarget) | |
67 | 53 | static_cast<uint64_t>(TextureUsage::kShaderRead); |
68 | 54 | resolve_tex_desc.sample_count = SampleCount::kCount1; |
|
110 | 96 | color0.store_action = StoreAction::kMultisampleResolve; |
111 | 97 | color0.resolve_texture = std::move(resolve_tex); |
112 | 98 |
|
113 | | - RenderTarget render_target_desc; |
114 | | - render_target_desc.SetColorAttachment(color0, 0u); |
| 99 | + auto render_target_desc = std::make_optional<RenderTarget>(); |
| 100 | + render_target_desc->SetColorAttachment(color0, 0u); |
115 | 101 |
|
116 | 102 | return render_target_desc; |
117 | 103 | } |
|
0 commit comments