NAP
renderservice.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 // Local Includes
8 #include "vk_mem_alloc.h"
9 #include "pipelinekey.h"
10 #include "renderutils.h"
11 #include "imagedata.h"
12 #include "rendertag.h"
13 
14 // External Includes
15 #include <nap/service.h>
16 #include <windowevent.h>
17 #include <rendertarget.h>
18 #include <material.h>
19 #include <rect.h>
20 #include <color.h>
21 
22 namespace nap
23 {
24  // Forward Declares
25  class CameraComponentInstance;
26  class RenderableComponentInstance;
27  class RenderWindow;
28  class RenderService;
29  class SceneService;
30  class DescriptorSetCache;
31  class DescriptorSetAllocator;
32  class RenderableMesh;
33  class IMesh;
34  class MaterialInstance;
35  class ComputeMaterialInstance;
36  class ComputeComponentInstance;
37  class Texture;
38  class Texture2D;
39  class RenderLayer;
40  class RenderChain;
41 
43  // Render Service Configuration
45 
50  {
51  RTTI_ENABLE(ServiceConfiguration)
52  public:
56  enum class EPhysicalDeviceType : int
57  {
58  Discrete = 4,
59  Integrated = 3,
60  CPU = 2,
61  Virtual = 1,
62  Other = 0
63  };
64 
65  bool mHeadless = false;
66  EPhysicalDeviceType mPreferredGPU = EPhysicalDeviceType::Discrete;
67  std::vector<std::string> mLayers = { "VK_LAYER_KHRONOS_validation" };
68  std::vector<std::string> mAdditionalExtensions = { };
69  uint32 mVulkanVersionMajor = 1;
70  uint32 mVulkanVersionMinor = 0;
71  uint32 mAnisotropicFilterSamples = 8;
72  bool mEnableHighDPIMode = true;
73  bool mEnableCompute = true;
74  bool mEnableCaching = true;
75  bool mEnableDebug = true;
76  bool mEnableRobustBufferAccess = false;
77  bool mPrintAvailableLayers = false;
78  bool mPrintAvailableExtensions = false;
79 
80  virtual rtti::TypeInfo getServiceType() const override { return RTTI_OF(RenderService); }
81  };
82 
83 
85  // Render Physical Device
87 
91  class NAPAPI PhysicalDevice final
92  {
93  public:
94  // Default constructor, invalid object
95  PhysicalDevice() = default;
96 
97  // Called by the render service
98  PhysicalDevice(VkPhysicalDevice device, const VkPhysicalDeviceProperties& properties, const VkQueueFlags& queueCapabilities, int queueIndex);
99 
103  VkPhysicalDevice getHandle() const { return mDevice; }
104 
108  int getQueueIndex() const { return mQueueIndex; }
109 
113  const VkPhysicalDeviceProperties& getProperties() const { return mProperties; }
114 
118  const VkPhysicalDeviceFeatures& getFeatures() const { return mFeatures; }
119 
123  const VkQueueFlags& getQueueCapabilities() const { return mQueueCapabilities; }
124 
128  bool isValid() const { return mDevice != VK_NULL_HANDLE && mQueueIndex >= 0; }
129 
130  private:
131  VkPhysicalDevice mDevice = VK_NULL_HANDLE;
132  VkPhysicalDeviceProperties mProperties;
133  VkPhysicalDeviceFeatures mFeatures;
134  VkQueueFlags mQueueCapabilities;
135  int mQueueIndex = -1;
136  };
137 
138 
140  // Display
142 
146  class NAPAPI Display final
147  {
148  public:
153  Display(int index);
154 
158  int getIndex() const { return mIndex; }
159 
164  float getDiagonalDPI() const { return mDDPI; }
165 
170  float getHorizontalDPI() const { return mHDPI; }
171 
176  float getVerticalDPI() const { return mVDPI; }
177 
182  const std::string& getName() const { return mName; }
183 
187  const glm::ivec2& getMin() const { return mMin; }
188 
192  const glm::ivec2& getMax() const { return mMax; }
193 
197  math::Rect getBounds() const;
198 
203  bool isValid() const { return mValid; }
204 
208  std::string toString() const;
209 
213  bool operator== (const Display& rhs) const { return rhs.getIndex() == this->getIndex(); }
214 
218  bool operator!=(const Display& rhs) const { return !(rhs == *this); }
219 
220  private:
221  std::string mName;
222  int mIndex = -1;
223  float mDDPI = 96.0f;
224  float mHDPI = 96.0f;
225  float mVDPI = 96.0f;
226  glm::ivec2 mMin = { 0, 0 };
227  glm::ivec2 mMax = { 0, 0 };
228  bool mValid = false;
229  };
230  using DisplayList = std::vector<Display>;
231 
232 
234  // Render Service
236 
275  class NAPAPI RenderService : public Service
276  {
277  friend class Texture;
278  friend class Texture2D;
279  friend class GPUBuffer;
280  friend class RenderWindow;
281  friend class RenderTag;
282  friend class RenderChain;
283 
284  RTTI_ENABLE(Service)
285  public:
286  using SortFunction = std::function<void(std::vector<RenderableComponentInstance*>&, const glm::mat4& viewMatrix)>;
287  using VulkanObjectDestructor = std::function<void(RenderService&)>;
288  using RenderCommand = std::function<void(RenderService&)>;
289 
293  struct Pipeline
294  {
299  bool isValid() const { return mPipeline != VK_NULL_HANDLE && mLayout != VK_NULL_HANDLE; }
300 
301  VkPipeline mPipeline = VK_NULL_HANDLE;
302  VkPipelineLayout mLayout = VK_NULL_HANDLE;
303  };
304 
309  RenderService(ServiceConfiguration* configuration);
310 
311  // Default destructor
312  virtual ~RenderService();
313 
334  void beginFrame();
335 
352  void endFrame();
353 
370  bool beginHeadlessRecording();
371 
386  void endHeadlessRecording();
387 
398  void queueHeadlessCommand(const RenderCommand& command);
399 
410  void queueComputeCommand(const RenderCommand& command);
411 
427  bool beginRecording(RenderWindow& renderWindow);
428 
443  void endRecording();
444 
463  bool beginComputeRecording();
464 
480  void endComputeRecording();
481 
491  void renderObjects(IRenderTarget& renderTarget, CameraComponentInstance& camera, RenderMask renderMask = mask::all);
492 
501  void renderObjects(IRenderTarget& renderTarget, CameraComponentInstance& camera, const SortFunction& sortFunction, RenderMask = mask::all);
502 
512  void renderObjects(IRenderTarget& renderTarget, CameraComponentInstance& camera, const std::vector<RenderableComponentInstance*>& comps, RenderMask renderMask = mask::all);
513 
524  void renderObjects(IRenderTarget& renderTarget, CameraComponentInstance& camera, const std::vector<RenderableComponentInstance*>& comps, const SortFunction& sortFunction, RenderMask renderMask = mask::all);
525 
538  void renderObjects(IRenderTarget& renderTarget, const glm::mat4& projection, const glm::mat4& view, const std::vector<RenderableComponentInstance*>& comps, const SortFunction& sortFunction, RenderMask renderMask = mask::all);
539 
545  void computeObjects(const std::vector<ComputeComponentInstance*>& comps);
546 
553  std::vector<RenderableComponentInstance*> filterObjects(const std::vector<RenderableComponentInstance*>& comps, RenderMask renderMask);
554 
560  bool addWindow(RenderWindow& window, utility::ErrorState& errorState);
565  void removeWindow(RenderWindow& window);
566 
572  RenderWindow* findWindow(void* nativeWindow) const;
573 
579  RenderWindow* findWindow(uint id) const;
580 
586  int getDisplayCount() const;
587 
594  const Display* findDisplay(int index) const;
595 
600  const Display* findDisplay(const nap::RenderWindow& window) const;
601 
605  const DisplayList& getDisplays() const;
606 
612  void addEvent(WindowEventPtr windowEvent);
613 
624  RenderableMesh createRenderableMesh(IMesh& mesh, MaterialInstance& materialInstance, utility::ErrorState& errorState);
625 
644  Pipeline getOrCreatePipeline(const IRenderTarget& renderTarget, const IMesh& mesh, const MaterialInstance& materialInstance, utility::ErrorState& errorState);
645 
663  Pipeline getOrCreateComputePipeline(const ComputeMaterialInstance& computeMaterialInstance, utility::ErrorState& errorState);
664 
682  Pipeline getOrCreatePipeline(const IRenderTarget& renderTarget, const RenderableMesh& renderableMesh, utility::ErrorState& errorState);
683 
700  void queueVulkanObjectDestructor(const VulkanObjectDestructor& function);
701 
708  DescriptorSetCache& getOrCreateDescriptorSetCache(VkDescriptorSetLayout layout);
709 
713  VmaAllocator getVulkanAllocator() const { return mVulkanAllocator; }
714 
718  bool isHeadlessCommandQueued() const { return !mHeadlessCommandQueue.empty(); }
719 
723  bool isComputeCommandQueued() const { return !mComputeCommandQueue.empty(); }
724 
731  bool isHeadless() const { return mHeadless; }
732 
740  VkCommandBuffer getCurrentCommandBuffer() { assert(mCurrentCommandBuffer != VK_NULL_HANDLE); return mCurrentCommandBuffer; }
741 
747  RenderWindow* getCurrentRenderWindow() { assert(mCurrentRenderWindow != VK_NULL_HANDLE); return mCurrentRenderWindow; }
748 
753  VkInstance getVulkanInstance() const { return mInstance; }
754 
760  VkPhysicalDevice getPhysicalDevice() const { return mPhysicalDevice.getHandle(); }
761 
766  const VkPhysicalDeviceFeatures& getPhysicalDeviceFeatures() const { return mPhysicalDevice.getFeatures(); }
767 
775  uint32 getPhysicalDeviceVersion() const { return mPhysicalDevice.getProperties().apiVersion; }
776 
781  const VkPhysicalDeviceProperties& getPhysicalDeviceProperties() const { return mPhysicalDevice.getProperties(); }
782 
788  VkDevice getDevice() const { return mDevice; }
789 
794  VkSampleCountFlagBits getMaxRasterizationSamples() const;
795 
800  glm::uvec3 getMaxComputeWorkGroupSize() const;
801 
810  bool getRasterizationSamples(ERasterizationSamples requestedSamples, VkSampleCountFlagBits& outSamples, nap::utility::ErrorState& errorState);
811 
816  bool sampleShadingSupported() const;
817 
822  bool anisotropicFilteringSupported() const;
823 
828  bool getWideLinesSupported() const { return mWideLinesSupported; }
829 
834  bool getNonSolidFillSupported() const { return mNonSolidFillModeSupported; }
835 
840  bool getPolygonModeSupported(EPolygonMode mode) { return mode == EPolygonMode::Fill || mNonSolidFillModeSupported; }
841 
846  bool getLargePointsSupported() const { return mLargePointsSupported; }
847 
853  bool getHighDPIEnabled() const { return mEnableHighDPIMode; }
854 
860  uint32 getAnisotropicSamples() const { return mAnisotropicSamples; }
861 
866  VkFormat getDepthFormat() const { return mDepthFormat; }
867 
873  VkCommandPool getCommandPool() const { return mCommandPool; }
874 
878  VkImageAspectFlags getDepthAspectFlags() const;
879 
884  uint32 getQueueIndex() const { return mPhysicalDevice.getQueueIndex(); }
885 
891  VkQueue getQueue() const { return mQueue; }
892 
897  bool isComputeAvailable() const;
898 
903  Texture2D& getEmptyTexture2D() const { return *mEmptyTexture2D; }
904 
909  TextureCube& getEmptyTextureCube() const { return *mEmptyTextureCube; }
910 
915  Texture2D& getErrorTexture2D() const { return *mErrorTexture2D; }
916 
921  TextureCube& getErrorTextureCube() const { return *mErrorTextureCube; }
922 
927  RenderMask getRenderMask(const RenderTag& renderTag) const;
928 
934  RenderMask getRenderMask(const std::string& tagName);
935 
950  Material* getOrCreateMaterial(rtti::TypeInfo shaderType, utility::ErrorState& error);
951 
965  template<typename T>
966  Material* getOrCreateMaterial(utility::ErrorState& error) { return getOrCreateMaterial(RTTI_OF(T), error); }
967 
974  int getCurrentFrameIndex() const { return mCurrentFrameIndex; }
975 
987  int getMaxFramesInFlight() const { return 2; }
988 
993  void getFormatProperties(VkFormat format, VkFormatProperties& outProperties) const;
994 
1002  bool isRenderingFrame() const { return mIsRenderingFrame; }
1003 
1009  uint32 getVulkanVersion() const { return mAPIVersion; }
1010 
1017  uint32 getVulkanVersionMajor() const;
1018 
1025  uint32 getVulkanVersionMinor() const;
1026 
1034  bool initShaderCompilation(utility::ErrorState& error);
1035 
1040 
1045 
1051  bool isInitialized() const { return mInitialized; }
1052 
1060  void waitForFence(int frameIndex);
1061 
1070  int getRank(const nap::RenderLayer& layer) const;
1071 
1072  protected:
1076  virtual void getDependentServices(std::vector<rtti::TypeInfo>& dependencies) override;
1077 
1083  virtual bool init(nap::utility::ErrorState& errorState) override;
1084 
1088  virtual void preShutdown() override;
1089 
1093  virtual void shutdown() override;
1094 
1098  virtual void preResourcesLoaded() override;
1099 
1103  virtual void postResourcesLoaded() override;
1104 
1109  virtual void update(double deltaTime) override;
1110 
1111  private:
1118  bool initEmptyTextures(nap::utility::ErrorState& errorState);
1119 
1125  void removeTextureRequests(Texture2D& texture);
1126 
1131  void requestTextureClear(Texture& texture);
1132 
1137  void requestTextureUpload(Texture2D& texture);
1138 
1143  void requestTextureDownload(Texture2D& texture);
1144 
1149  void requestBufferClear(GPUBuffer& buffer);
1150 
1155  void requestBufferUpload(GPUBuffer& buffer);
1156 
1161  void requestBufferDownload(GPUBuffer& buffer);
1162 
1168  void removeBufferRequests(GPUBuffer& buffer);
1169 
1175  void transferData(VkCommandBuffer commandBuffer, const std::function<void()>& transferFunction);
1176 
1180  void downloadData();
1181 
1185  void uploadData();
1186 
1191  void updateDownloads();
1192 
1197  void processVulkanDestructors(int frameIndex);
1198 
1203  void waitDeviceIdle();
1204 
1212  bool writeIni(const std::string& path, utility::ErrorState error);
1213 
1221  bool loadIni(const std::string& path, utility::ErrorState error);
1222 
1227  void restoreWindow(nap::RenderWindow& window);
1228 
1235  bool addTag(const RenderTag& renderTag, nap::utility::ErrorState& error);
1236 
1241  void removeTag(const RenderTag& renderTag);
1242 
1247  void addChain(const RenderChain& chain);
1248 
1253  void removeChain(const RenderChain& chain);
1254 
1255  private:
1256  struct UniqueMaterial;
1257  using PipelineCache = std::unordered_map<PipelineKey, Pipeline>;
1258  using ComputePipelineCache = std::unordered_map<ComputePipelineKey, Pipeline>;
1259  using WindowList = std::vector<RenderWindow*>;
1260  using DescriptorSetCacheMap = std::unordered_map<VkDescriptorSetLayout, std::unique_ptr<DescriptorSetCache>>;
1261  using TextureSet = std::unordered_set<Texture*>;
1262  using Texture2DSet = std::unordered_set<Texture2D*>;
1263  using BufferSet = std::unordered_set<GPUBuffer*>;
1264  using VulkanObjectDestructorList = std::vector<VulkanObjectDestructor>;
1265  using UniqueMaterialCache = std::unordered_map<rtti::TypeInfo, std::unique_ptr<UniqueMaterial>>;
1266 
1271  enum EQueueSubmitOp : uint
1272  {
1273  Rendering = 0x01,
1274  HeadlessRendering = 0x02,
1275  Compute = 0x04
1276  };
1277  using QueueSubmitOps = uint;
1278 
1282  struct Frame
1283  {
1284  VkFence mFence;
1285  std::vector<Texture2D*> mTextureDownloads;
1286  std::vector<GPUBuffer*> mBufferDownloads;
1287  VkCommandBuffer mUploadCommandBuffer;
1288  VkCommandBuffer mDownloadCommandBuffer;
1289  VkCommandBuffer mHeadlessCommandBuffer;
1290  VkCommandBuffer mComputeCommandBuffer;
1291  VulkanObjectDestructorList mQueuedVulkanObjectDestructors;
1292  QueueSubmitOps mQueueSubmitOps = 0U;
1293  };
1294 
1299  struct UniqueMaterial
1300  {
1301  UniqueMaterial() = default;
1302  UniqueMaterial(std::unique_ptr<Shader> shader, std::unique_ptr<Material> material);
1303  std::unique_ptr<Shader> mShader = nullptr;
1304  std::unique_ptr<Material> mMaterial = nullptr;
1305  bool valid() const;
1306  };
1307 
1308  bool mEnableHighDPIMode = true;
1309  bool mEnableCaching = true;
1310  bool mSampleShadingSupported = false;
1311  bool mAnisotropicFilteringSupported = false;
1312  bool mWideLinesSupported = false;
1313  bool mLargePointsSupported = false;
1314  bool mNonSolidFillModeSupported = false;
1315  uint32 mAnisotropicSamples = 1;
1316  WindowList mWindows;
1317  DisplayList mDisplays;
1318  SceneService* mSceneService = nullptr;
1319  bool mIsRenderingFrame = false;
1320  bool mCanDestroyVulkanObjectsImmediately = true;
1321 
1322  // Empty textures
1323  std::unique_ptr<Texture2D> mEmptyTexture2D;
1324  std::unique_ptr<TextureCube> mEmptyTextureCube;
1325 
1326  // Error textures
1327  std::unique_ptr<Texture2D> mErrorTexture2D;
1328  std::unique_ptr<TextureCube> mErrorTextureCube;
1329  const RGBAColorFloat mErrorColor = { 1.0f, 0.3137f, 0.3137f, 1.0f };
1330 
1331  TextureSet mTexturesToClear;
1332  Texture2DSet mTexturesToUpload;
1333  BufferSet mBuffersToClear;
1334  BufferSet mBuffersToUpload;
1335 
1336  int mCurrentFrameIndex = 0;
1337  std::vector<Frame> mFramesInFlight;
1338  RenderWindow* mCurrentRenderWindow = nullptr;
1339 
1340  DescriptorSetCacheMap mDescriptorSetCaches;
1341  std::unique_ptr<DescriptorSetAllocator> mDescriptorSetAllocator;
1342 
1343  VkInstance mInstance = VK_NULL_HANDLE;
1344  VmaAllocator mVulkanAllocator = VK_NULL_HANDLE;
1345  VkDebugReportCallbackEXT mDebugCallback = VK_NULL_HANDLE;
1346  VkDebugUtilsMessengerEXT mDebugUtilsMessengerCallback = VK_NULL_HANDLE;
1347 
1348  PhysicalDevice mPhysicalDevice;
1349  VkDevice mDevice = VK_NULL_HANDLE;
1350  VkCommandBuffer mCurrentCommandBuffer = VK_NULL_HANDLE;
1351 
1352  VkCommandPool mCommandPool = VK_NULL_HANDLE;
1353  VkQueue mQueue = VK_NULL_HANDLE;
1354 
1355  PipelineCache mPipelineCache;
1356  ComputePipelineCache mComputePipelineCache;
1357 
1358  VkFormat mDepthFormat = VK_FORMAT_UNDEFINED;
1359  VkSampleCountFlagBits mMaxRasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
1360 
1361  uint32 mAPIVersion = 0;
1362  bool mInitialized = false;
1363  bool mSDLInitialized = false;
1364  bool mShInitialized = false;
1365  bool mHeadless = false;
1366 
1367  UniqueMaterialCache mMaterials;
1368 
1369  // Render command queues
1370  std::vector<RenderCommand> mHeadlessCommandQueue;
1371  std::vector<RenderCommand> mComputeCommandQueue;
1372 
1373  // The registered render tag and layer registries
1374  std::vector<const RenderTag*> mRenderTags;
1375 
1376  // Cache read from ini file, contains saved settings
1377  std::vector<std::unique_ptr<rtti::Object>> mCache;
1378 
1379  // Render chains
1380  std::vector<const RenderChain*> mRenderChains;
1381  };
1382 } // nap
nap::RenderService::getPhysicalDeviceVersion
uint32 getPhysicalDeviceVersion() const
Definition: renderservice.h:775
nap::RenderService::getErrorTextureCube
TextureCube & getErrorTextureCube() const
Definition: renderservice.h:921
nap::uint
unsigned int uint
Definition: numeric.h:23
nap::DisplayList
std::vector< Display > DisplayList
Definition: renderservice.h:230
nap::toString
NAPAPI std::string toString(EDay day)
nap::RenderService::getAnisotropicSamples
uint32 getAnisotropicSamples() const
Definition: renderservice.h:860
nap::IRenderTarget
Definition: irendertarget.h:21
nap::RenderService::isHeadlessCommandQueued
bool isHeadlessCommandQueued() const
Definition: renderservice.h:718
nap::PhysicalDevice::getQueueIndex
int getQueueIndex() const
Definition: renderservice.h:108
nap::DescriptorSetCache
Definition: descriptorsetcache.h:48
nap::RenderService::windowRemoved
nap::Signal< nap::RenderWindow & > windowRemoved
Definition: renderservice.h:1044
nap::RenderWindow
Definition: renderwindow.h:43
nap::RenderService::isComputeCommandQueued
bool isComputeCommandQueued() const
Definition: renderservice.h:723
nap::RenderServiceConfiguration::EPhysicalDeviceType
EPhysicalDeviceType
Definition: renderservice.h:56
nap::RenderService::getDepthFormat
VkFormat getDepthFormat() const
Definition: renderservice.h:866
nap::RenderService::Pipeline
Definition: renderservice.h:293
nap::RenderService::isInitialized
bool isInitialized() const
Definition: renderservice.h:1051
nap::RenderService::isHeadless
bool isHeadless() const
Definition: renderservice.h:731
nap::Texture
Definition: texture.h:28
nap::RenderTag
Definition: rendertag.h:51
nap::TextureCube
Definition: texture.h:298
nap::EPolygonMode
EPolygonMode
Definition: mesh.h:55
nap::Display::getName
const std::string & getName() const
Definition: renderservice.h:182
nap::ERasterizationSamples
ERasterizationSamples
Definition: renderutils.h:25
nap::RenderService::getWideLinesSupported
bool getWideLinesSupported() const
Definition: renderservice.h:828
nap::CameraComponentInstance
Definition: cameracomponent.h:38
nap::math::Rect
Definition: rect.h:19
nap::Display::operator!=
bool operator!=(const Display &rhs) const
Definition: renderservice.h:218
nap::utility::ErrorState
Definition: errorstate.h:19
nap::IMesh
Definition: mesh.h:394
nap::RenderService::getCurrentRenderWindow
RenderWindow * getCurrentRenderWindow()
Definition: renderservice.h:747
nap::Material
Definition: material.h:83
nap::RenderService::getEmptyTexture2D
Texture2D & getEmptyTexture2D() const
Definition: renderservice.h:903
nap::Display
Definition: renderservice.h:146
nap::RenderMask
uint64 RenderMask
Definition: rendertag.h:23
nap::RenderService::getLargePointsSupported
bool getLargePointsSupported() const
Definition: renderservice.h:846
nap::RenderService::getNonSolidFillSupported
bool getNonSolidFillSupported() const
Definition: renderservice.h:834
nap::RenderService::getVulkanVersion
uint32 getVulkanVersion() const
Definition: renderservice.h:1009
nap::uint32
uint32_t uint32
Definition: numeric.h:20
nap::ServiceConfiguration
Definition: service.h:28
nap::RenderService::getPhysicalDeviceProperties
const VkPhysicalDeviceProperties & getPhysicalDeviceProperties() const
Definition: renderservice.h:781
nap::RenderLayer
Definition: renderlayer.h:43
nap::PhysicalDevice::getProperties
const VkPhysicalDeviceProperties & getProperties() const
Definition: renderservice.h:113
nap::Texture2D
Definition: texture.h:128
nap::PhysicalDevice::getFeatures
const VkPhysicalDeviceFeatures & getFeatures() const
Definition: renderservice.h:118
nap::Signal< nap::RenderWindow & >
nap::RenderService::getPhysicalDevice
VkPhysicalDevice getPhysicalDevice() const
Definition: renderservice.h:760
nap::RenderService::getMaxFramesInFlight
int getMaxFramesInFlight() const
Definition: renderservice.h:987
nap::RenderService
Definition: renderservice.h:275
nap::Display::getHorizontalDPI
float getHorizontalDPI() const
Definition: renderservice.h:170
nap::RenderService::getQueue
VkQueue getQueue() const
Definition: renderservice.h:891
nap::RenderService::getCurrentCommandBuffer
VkCommandBuffer getCurrentCommandBuffer()
Definition: renderservice.h:740
nap::RenderService::getVulkanInstance
VkInstance getVulkanInstance() const
Definition: renderservice.h:753
nap::Display::getVerticalDPI
float getVerticalDPI() const
Definition: renderservice.h:176
nap::mask::all
constexpr RenderMask all
Definition: rendertag.h:28
nap::RenderServiceConfiguration::getServiceType
virtual rtti::TypeInfo getServiceType() const override
Definition: renderservice.h:80
nap::Service
Definition: templateservice.h:8
nap::RenderChain
Definition: renderlayer.h:66
nap::PhysicalDevice::isValid
bool isValid() const
Definition: renderservice.h:128
nap::EPolygonMode::Fill
@ Fill
Polygons are interpreted and rendered using the specified 'EDrawMode'.
nap::Display::getMax
const glm::ivec2 & getMax() const
Definition: renderservice.h:192
nap::RenderableMesh
Definition: renderablemesh.h:22
nap::MaterialInstance
Definition: materialinstance.h:297
nap::RenderService::VulkanObjectDestructor
std::function< void(RenderService &)> VulkanObjectDestructor
Definition: renderservice.h:287
nap::RenderService::Pipeline::isValid
bool isValid() const
Definition: renderservice.h:299
nap::WindowEventPtr
std::unique_ptr< WindowEvent > WindowEventPtr
Definition: windowevent.h:189
nap::ComputeMaterialInstance
Definition: materialinstance.h:364
nap::RenderService::getCommandPool
VkCommandPool getCommandPool() const
Definition: renderservice.h:873
nap::RenderService::getDevice
VkDevice getDevice() const
Definition: renderservice.h:788
nap::RenderService::getOrCreateMaterial
Material * getOrCreateMaterial(utility::ErrorState &error)
Definition: renderservice.h:966
nap::PhysicalDevice
Definition: renderservice.h:91
nap::RGBAColorFloat
RGBAColor< float > RGBAColorFloat
Definition: color.h:580
nap::RenderService::getEmptyTextureCube
TextureCube & getEmptyTextureCube() const
Definition: renderservice.h:909
nap::RenderServiceConfiguration
Definition: renderservice.h:49
nap::Display::isValid
bool isValid() const
Definition: renderservice.h:203
nap
Definition: templateapp.h:17
nap::RenderService::getPolygonModeSupported
bool getPolygonModeSupported(EPolygonMode mode)
Definition: renderservice.h:840
nap::Display::getIndex
int getIndex() const
Definition: renderservice.h:158
nap::Display::getMin
const glm::ivec2 & getMin() const
Definition: renderservice.h:187
nap::GPUBuffer
Definition: gpubuffer.h:64
nap::PhysicalDevice::getHandle
VkPhysicalDevice getHandle() const
Definition: renderservice.h:103
nap::PhysicalDevice::getQueueCapabilities
const VkQueueFlags & getQueueCapabilities() const
Definition: renderservice.h:123
nap::RenderService::SortFunction
std::function< void(std::vector< RenderableComponentInstance * > &, const glm::mat4 &viewMatrix)> SortFunction
Definition: renderservice.h:286
nap::rtti::TypeInfo
rttr::type TypeInfo
Definition: typeinfo.h:140
nap::Display::getDiagonalDPI
float getDiagonalDPI() const
Definition: renderservice.h:164
nap::RenderService::getVulkanAllocator
VmaAllocator getVulkanAllocator() const
Definition: renderservice.h:713
nap::RenderService::getQueueIndex
uint32 getQueueIndex() const
Definition: renderservice.h:884
nap::RenderService::windowAdded
nap::Signal< nap::RenderWindow & > windowAdded
Definition: renderservice.h:1039
nap::RenderService::getCurrentFrameIndex
int getCurrentFrameIndex() const
Definition: renderservice.h:974
nap::RenderService::getHighDPIEnabled
bool getHighDPIEnabled() const
Definition: renderservice.h:853
nap::RenderService::isRenderingFrame
bool isRenderingFrame() const
Definition: renderservice.h:1002
nap::RenderService::getErrorTexture2D
Texture2D & getErrorTexture2D() const
Definition: renderservice.h:915
nap::RenderService::getPhysicalDeviceFeatures
const VkPhysicalDeviceFeatures & getPhysicalDeviceFeatures() const
Definition: renderservice.h:766
nap::RenderService::RenderCommand
std::function< void(RenderService &)> RenderCommand
Definition: renderservice.h:288