[embedder] [metal] Add support for Metal Renderer Config in the embedder API #22854
Conversation
bb95a27
to
65fe820
| /// Handle for the MTLDevice. | ||
| FlutterMetalDevice device; | ||
| /// Handle for the MTLCommandQueue. | ||
| FlutterMetalCommandQueue command_queue; |
chinmaygarde
Dec 8, 2020
Member
present_command_queue for clarity.
present_command_queue for clarity.
chinmaygarde
Dec 8, 2020
Member
I forget, does the embedder need to own a reference to the main command queue? Or, can the engine create a command queue on behalf of the embedder?
I forget, does the embedder need to own a reference to the main command queue? Or, can the engine create a command queue on behalf of the embedder?
iskakaushik
Dec 9, 2020
Author
Contributor
I think this provides the embedder with most flexibility since it might want to time when the commit needs to happen, see: https://github.com/flutter/engine/pull/22606/files#diff-112f37d852d26e9e2c1040c0f0ab516a94450e5d48c37338612bd254040881d3R85. I will rename to present_command_queue for clarity.
I think this provides the embedder with most flexibility since it might want to time when the commit needs to happen, see: https://github.com/flutter/engine/pull/22606/files#diff-112f37d852d26e9e2c1040c0f0ab516a94450e5d48c37338612bd254040881d3R85. I will rename to present_command_queue for clarity.
|
@chinmaygarde I think i've addressed the comments. PTAL |
d13f423
to
ba5b639
|
Other than the nits about naming in the public API, everything else looks fine to me. Mostly there. |
| typedef const void* FlutterMetalCommandQueue; | ||
|
|
||
| /// Alias for id<MTLTexture>. | ||
| typedef const void* FlutterMetalTextureBuffer; |
chinmaygarde
Dec 17, 2020
Member
Nit: Just FlutterMetalTexture should be fine and matches the Apple API naming convention.
Nit: Just FlutterMetalTexture should be fine and matches the Apple API naming convention.
chinmaygarde
Dec 17, 2020
Member
Oh, I see. There is already the struct named that. Can be append Handle to these void * typedefs?
Oh, I see. There is already the struct named that. Can be append Handle to these void * typedefs?
| int64_t texture_id; | ||
| /// Handle to the MTLTexture that is owned by the embedder. Engine will render | ||
| /// the frame into this texture. | ||
| FlutterMetalTextureBuffer* texture; |
chinmaygarde
Dec 17, 2020
Member
FlutterMetalTextureBuffer is already a pointer. Why the pointer to a pointer?
FlutterMetalTextureBuffer is already a pointer. Why the pointer to a pointer?
| /// `FlutterMetalTextureCallback` callback. | ||
| typedef bool (*FlutterMetalPresentCallback)( | ||
| void* /* user data */, | ||
| const FlutterMetalTexture* /* texture */); |
chinmaygarde
Dec 17, 2020
Member
Again, a pointer to a pointer. Those are usually only required for out parameters.
Again, a pointer to a pointer. Those are usually only required for out parameters.
chinmaygarde
Dec 31, 2020
Member
I think you missed this double pointer indirection.
I think you missed this double pointer indirection.
| FlutterMetalCommandQueue present_command_queue; | ||
| /// The callback that gets invoked when the engine requests the embedder for a | ||
| /// texture to render to. | ||
| FlutterMetalTextureCallback get_next_drawable_texture_callback; |
chinmaygarde
Dec 17, 2020
Member
Nit: The _texture_ in these ivars is redundant.
Nit: The _texture_ in these ivars is redundant.
This change adds a FlutterMetalRendererConfig that lets embedders specify metal as rendering api. Also adds a test that validates rendering a gradient using metal.
ba5b639
to
36675aa
|
@chinmaygarde this addresses all the review comments. PTAL. |
36675aa
to
3a25c8a
|
I believe you missed one comment. Other than that, LGTM. Sorry about the late replies. |
| /// `FlutterMetalTextureCallback` callback. | ||
| typedef bool (*FlutterMetalPresentCallback)( | ||
| void* /* user data */, | ||
| const FlutterMetalTexture* /* texture */); |
chinmaygarde
Dec 31, 2020
Member
I think you missed this double pointer indirection.
I think you missed this double pointer indirection.
|
Tree is red because of a flake. This is the only commit tagged for CQ passing all presubmits. Landing manually. |
70f0702
into
flutter:master
…der API (flutter#22854) This change adds a FlutterMetalRendererConfig that lets embedders specify metal as rendering api. Also adds a test that validates rendering a gradient using metal.
…der API (flutter#22854) This change adds a FlutterMetalRendererConfig that lets embedders specify metal as rendering api. Also adds a test that validates rendering a gradient using metal.
No description provided.