Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Metal support to MinimalScene and Qt Application #323

Merged

Commits on Jan 26, 2022

  1. [Metal] Add Metal support to MinimalScene and Qt Application

    Allow MinimalScene to use either OpenGL or Metal render systems
    
    Add classes to abstract out render hardware interfaces:
    - IgnCameraTextureRhi
    - RenderThreadRhi
    - TextureNodeRhi
    
    Add implementations for OpenGL and Metal in:
    - MinimalSceneRhiOpenGL
    - MinimalSceneRhiMetal
    - Modify the existing MinimalScene class to forward rendering calls to the (virtual) render hardware interface functions.
    - Modify plugin CMakeLists.txt to conditionally compile Metal support if the platform is macOS
    - Update Application.cc to support either OpenGL or Metal
    
    Refactor MinimalScene to use GraphicAPI
    - Use the GraphicsAPI enum to set the choice of graphics interface (OpenGL or Metal).
    - Change the MinimalScene plugin element to <graphics_api>...</graphics_api>
    
    Add documentation and confirm to code style
    - Document the OpenGL and Metal render interface classes
    - Revert default engine to ogre
    
    Set graphics API to Metal for macOS, otherwise use OpenGL
    - Update Application.cc to only use Metal for macOS
    - Fix issues with code check
    
    Remove unused variable from Application.cc
    
    Change pointer casts to satisfy code check
    - Code check requires we use reinterpret_cast rather than static_cast.
    
    Combine initialisation methods
    - Revert to original spelling and names for Initialize()
    - In RenderItem call Ready() using invokeMethod when not using Metal
    - Attempting to resolve residual QSG threading issue (use of threaded QSG is inconsistent between platforms)
    
    Force both OpenGL and Metal to use QSG_RENDER_LOOP "basic"
    - Force QSG to run on the main application thread
    - This will resolve the exception on Ubuntu but a better solution is required.
    
    Resolve issue with QSG render loop for Metal
    - Metal version now supports "threaded"  QSG_RENDER_LOOP
    - OpenGL version still unresolved.
    
    Update src/plugins/minimal_scene/MinimalScene.hh
    
    Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
    
    Update src/plugins/minimal_scene/MinimalSceneRhi.hh
    
    Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
    
    Fix issues with OpenGL context thread affinity
    - The OpenGL context must be moved from the QSGRenderThread to the main thread for initialisation
    - After initialisation the OpenGL context is then moved to the Ignition render thread
    
    Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
    srmainwaring committed Jan 26, 2022
    Configuration menu
    Copy the full SHA
    4f62f19 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5da6b23 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2022

  1. [Metal] suppress cpplint warnings

    - Suppress cpplint warnings in MinimalSceneRhi and MinimalSceneRhiOpenGL that look like false positives
    
    Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
    srmainwaring committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    ec6b239 View commit details
    Browse the repository at this point in the history
  2. [Metal] ensure parameter names and documentation are consistent

    - Update MinimalScene.hh to fix CI error
    
    Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
    srmainwaring committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    5cef8a1 View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2022

  1. [Metal] incorporate feedback from review

    - Update include guard
    - Remove comment after function parameter
    - Document graphics_api XML element
    - Add error message for unsupported graphics APIs
    
    Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
    srmainwaring committed Jan 28, 2022
    Configuration menu
    Copy the full SHA
    ca52977 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8363f0f View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2022

  1. [Metal] incorporate feedback from review

    - Add list of available graphics APIs
    - Set default graphics API to 'metal' if the platform is Apple, otherwise use 'opengl'.
    
    Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
    srmainwaring committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    6749a92 View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2022

  1. Configuration menu
    Copy the full SHA
    5f7e81d View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2022

  1. Update src/plugins/minimal_scene/MinimalScene.hh

    Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
    Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
    srmainwaring and ahcorde committed Mar 4, 2022
    Configuration menu
    Copy the full SHA
    5b0e214 View commit details
    Browse the repository at this point in the history
  2. Apply suggestions from code review

    Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
    Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
    srmainwaring and ahcorde committed Mar 4, 2022
    Configuration menu
    Copy the full SHA
    f22261c View commit details
    Browse the repository at this point in the history