Avoid std::vector copy
authorJulian Eisel <eiseljulian@gmail.com>
Fri, 28 Jun 2019 11:56:10 +0000 (13:56 +0200)
committerJulian Eisel <eiseljulian@gmail.com>
Fri, 28 Jun 2019 11:56:10 +0000 (13:56 +0200)
intern/ghost/intern/GHOST_IXrGraphicsBinding.h
intern/ghost/intern/GHOST_XrGraphicsBinding.cpp

index 6bb53b3b6baa53aef0d82f6341f5bad6d58b03f6..eca2c70cb52d809a8bd53d88fde36dd0190d118b 100644 (file)
@@ -40,7 +40,7 @@ class GHOST_IXrGraphicsBinding {
   } oxr_binding;
 
   virtual void initFromGhostContext(class GHOST_Context *ghost_ctx) = 0;
-  virtual bool chooseSwapchainFormat(std::vector<int64_t> runtime_formats,
+  virtual bool chooseSwapchainFormat(const std::vector<int64_t> &runtime_formats,
                                      int64_t *r_result) const = 0;
   virtual std::vector<XrSwapchainImageBaseHeader *> createSwapchainImages(
       uint32_t image_count) = 0;
index 22f5e80c7ca4ab6025001290342d8cc0ad4a2f3a..5a9a2b26959c8b8a153c5e511b9995bf8f84e4b1 100644 (file)
@@ -75,7 +75,7 @@ class GHOST_XrGraphicsBindingOpenGL : public GHOST_IXrGraphicsBinding {
 #endif
   }
 
-  bool chooseSwapchainFormat(std::vector<int64_t> runtime_formats,
+  bool chooseSwapchainFormat(const std::vector<int64_t> &runtime_formats,
                              int64_t *r_result) const override
   {
     std::vector<int64_t> gpu_binding_formats = {GL_RGBA8};
@@ -127,7 +127,7 @@ class GHOST_XrGraphicsBindingD3D : public GHOST_IXrGraphicsBinding {
     m_ghost_ctx = ctx_d3d;
   }
 
-  bool chooseSwapchainFormat(std::vector<int64_t> runtime_formats,
+  bool chooseSwapchainFormat(const std::vector<int64_t> &runtime_formats,
                              int64_t *r_result) const override
   {
     std::vector<int64_t> gpu_binding_formats = {DXGI_FORMAT_R8G8B8A8_UNORM};