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 "material.h"
11 #include "rendertexturecube.h"
12 #include "renderutils.h"
13 #include "rendertag.h"
14 #include "display.h"
15 #include "videodriver.h"
16 
17 // External Includes
18 #include <nap/service.h>
19 #include <windowevent.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 Texture2D;
38  class TextureCube;
39  class DepthRenderTexture2D;
40  class RenderLayer;
41  class RenderChain;
42 
44  // Render Service Configuration
46 
51  {
52  RTTI_ENABLE(ServiceConfiguration)
53  friend class RenderService;
54  public:
55  // Default constructor
56  RenderServiceConfiguration() = default;
57 
64  RenderServiceConfiguration(void* windowHandle) :
65  mWindowHandle(windowHandle) { }
66 
70  enum class EPhysicalDeviceType : int
71  {
72  Discrete = 4,
73  Integrated = 3,
74  CPU = 2,
75  Virtual = 1,
76  Other = 0
77  };
78 
79  bool mHeadless = false;
81  EPhysicalDeviceType mPreferredGPU = EPhysicalDeviceType::Discrete;
82  std::vector<std::string> mLayers = { "VK_LAYER_KHRONOS_validation" };
83  std::vector<std::string> mAdditionalExtensions = { };
84  uint32 mVulkanVersionMajor = 1;
85  uint32 mVulkanVersionMinor = 2;
86  uint32 mAnisotropicFilterSamples = 8;
87  bool mEnableCompute = true;
88  bool mEnableCaching = true;
89  bool mEnableDebug = true;
90  bool mEnableRobustBufferAccess = false;
91  bool mPrintAvailableLayers = false;
92  bool mPrintAvailableExtensions = false;
93 
94  rtti::TypeInfo getServiceType() const override { return RTTI_OF(RenderService); }
95 
96  private:
97  void* mWindowHandle = nullptr;
98  };
99 
100 
102  // Render Physical Device
104 
108  class NAPAPI PhysicalDevice final
109  {
110  public:
111  // Default constructor, invalid object
112  PhysicalDevice() = default;
113 
114  // Called by the render service
115  PhysicalDevice(VkPhysicalDevice device, const VkPhysicalDeviceProperties& properties, const VkQueueFlags& queueCapabilities, int queueIndex);
116 
120  VkPhysicalDevice getHandle() const { return mDevice; }
121 
125  int getQueueIndex() const { return mQueueIndex; }
126 
130  const VkPhysicalDeviceProperties& getProperties() const { return mProperties; }
131 
135  const VkPhysicalDeviceFeatures& getFeatures() const { return mFeatures; }
136 
140  const VkQueueFlags& getQueueCapabilities() const { return mQueueCapabilities; }
141 
145  bool isValid() const { return mDevice != VK_NULL_HANDLE && mQueueIndex >= 0; }
146 
147  private:
148  VkPhysicalDevice mDevice = VK_NULL_HANDLE;
149  VkPhysicalDeviceProperties mProperties;
150  VkPhysicalDeviceFeatures mFeatures;
151  VkQueueFlags mQueueCapabilities;
152  int mQueueIndex = -1;
153  };
154 
155 
157  // Render Service
159 
198  class NAPAPI RenderService : public Service
199  {
200  friend class Texture;
201  friend class Texture2D;
202  friend class GPUBuffer;
203  friend class RenderWindow;
204  friend class RenderTag;
205  friend class RenderChain;
206 
207  RTTI_ENABLE(Service)
208  public:
209  using SortFunction = std::function<void(std::vector<RenderableComponentInstance*>&, const glm::mat4& viewMatrix)>;
210  using VulkanObjectDestructor = std::function<void(RenderService&)>;
211  using RenderCommand = std::function<void(RenderService&)>;
212 
216  struct Pipeline
217  {
222  bool isValid() const { return mPipeline != VK_NULL_HANDLE && mLayout != VK_NULL_HANDLE; }
223 
224  VkPipeline mPipeline = VK_NULL_HANDLE;
225  VkPipelineLayout mLayout = VK_NULL_HANDLE;
226  };
227 
232  RenderService(ServiceConfiguration* configuration);
233 
234  // Default destructor
235  virtual ~RenderService();
236 
257  void beginFrame();
258 
275  void endFrame();
276 
293  bool beginHeadlessRecording();
294 
309  void endHeadlessRecording();
310 
321  void queueHeadlessCommand(const RenderCommand& command);
322 
333  void queueComputeCommand(const RenderCommand& command);
334 
350  bool beginRecording(RenderWindow& renderWindow);
351 
366  void endRecording();
367 
386  bool beginComputeRecording();
387 
403  void endComputeRecording();
404 
414  void renderObjects(IRenderTarget& renderTarget, CameraComponentInstance& camera, RenderMask renderMask = mask::all);
415 
424  void renderObjects(IRenderTarget& renderTarget, CameraComponentInstance& camera, const SortFunction& sortFunction, RenderMask = mask::all);
425 
435  void renderObjects(IRenderTarget& renderTarget, CameraComponentInstance& camera, const std::vector<RenderableComponentInstance*>& comps, RenderMask renderMask = mask::all);
436 
447  void renderObjects(IRenderTarget& renderTarget, CameraComponentInstance& camera, const std::vector<RenderableComponentInstance*>& comps, const SortFunction& sortFunction, RenderMask renderMask = mask::all);
448 
461  void renderObjects(IRenderTarget& renderTarget, const glm::mat4& projection, const glm::mat4& view, const std::vector<RenderableComponentInstance*>& comps, const SortFunction& sortFunction, RenderMask renderMask = mask::all);
462 
468  void computeObjects(const std::vector<ComputeComponentInstance*>& comps);
469 
476  std::vector<RenderableComponentInstance*> filterObjects(const std::vector<RenderableComponentInstance*>& comps, RenderMask renderMask);
477 
482  void addWindow(RenderWindow& window);
483 
488  void removeWindow(RenderWindow& window);
489 
495  RenderWindow* findWindow(void* nativeWindow) const;
496 
502  RenderWindow* findWindow(uint id) const;
503 
508  int getDisplayCount() const;
509 
515  Display findDisplay(int index) const;
516 
521  Display findDisplay(const nap::RenderWindow& window) const;
522 
527  std::vector<Display> getDisplays() const;
528 
532  std::vector<RenderWindow*> getWindows() const;
533 
539  void addEvent(WindowEventPtr windowEvent);
540 
551  RenderableMesh createRenderableMesh(IMesh& mesh, MaterialInstance& materialInstance, utility::ErrorState& errorState);
552 
571  Pipeline getOrCreatePipeline(const IRenderTarget& renderTarget, const IMesh& mesh, const MaterialInstance& materialInstance, utility::ErrorState& errorState);
572 
590  Pipeline getOrCreateComputePipeline(const ComputeMaterialInstance& computeMaterialInstance, utility::ErrorState& errorState);
591 
609  Pipeline getOrCreatePipeline(const IRenderTarget& renderTarget, const RenderableMesh& renderableMesh, utility::ErrorState& errorState);
610 
627  void queueVulkanObjectDestructor(const VulkanObjectDestructor& function);
628 
635  DescriptorSetCache& getOrCreateDescriptorSetCache(VkDescriptorSetLayout layout);
636 
640  VmaAllocator getVulkanAllocator() const { return mVulkanAllocator; }
641 
645  bool isHeadlessCommandQueued() const { return !mHeadlessCommandQueue.empty(); }
646 
650  bool isComputeCommandQueued() const { return !mComputeCommandQueue.empty(); }
651 
658  bool isHeadless() const { return mHeadless; }
659 
667  VkCommandBuffer getCurrentCommandBuffer() { assert(mCurrentCommandBuffer != VK_NULL_HANDLE); return mCurrentCommandBuffer; }
668 
674  RenderWindow* getCurrentRenderWindow() { return mCurrentRenderWindow; }
675 
680  VkInstance getVulkanInstance() const { return mInstance; }
681 
687  VkPhysicalDevice getPhysicalDevice() const { return mPhysicalDevice.getHandle(); }
688 
693  const VkPhysicalDeviceFeatures& getPhysicalDeviceFeatures() const { return mPhysicalDevice.getFeatures(); }
694 
702  uint32 getPhysicalDeviceVersion() const { return mPhysicalDevice.getProperties().apiVersion; }
703 
708  const VkPhysicalDeviceProperties& getPhysicalDeviceProperties() const { return mPhysicalDevice.getProperties(); }
709 
715  VkDevice getDevice() const { return mDevice; }
716 
721  VkSampleCountFlagBits getMaxRasterizationSamples() const;
722 
727  glm::uvec3 getMaxComputeWorkGroupSize() const;
728 
737  bool getRasterizationSamples(ERasterizationSamples requestedSamples, VkSampleCountFlagBits& outSamples, nap::utility::ErrorState& errorState);
738 
743  bool sampleShadingSupported() const;
744 
749  bool anisotropicFilteringSupported() const;
750 
755  bool getWideLinesSupported() const { return mWideLinesSupported; }
756 
761  bool getNonSolidFillSupported() const { return mNonSolidFillModeSupported; }
762 
767  bool getPolygonModeSupported(EPolygonMode mode) { return mode == EPolygonMode::Fill || mNonSolidFillModeSupported; }
768 
773  bool getLargePointsSupported() const { return mLargePointsSupported; }
774 
780  bool getMipSupport(const SurfaceDescriptor& descriptor) const;
781 
787  [[deprecated]]
788  bool getHighDPIEnabled() const { return true; }
789 
795  uint32 getAnisotropicSamples() const { return mAnisotropicSamples; }
796 
801  VkFormat getDepthFormat() const { return mDepthFormat; }
802 
808  VkCommandPool getCommandPool() const { return mCommandPool; }
809 
813  VkImageAspectFlags getDepthAspectFlags() const;
814 
819  uint32 getQueueIndex() const { return mPhysicalDevice.getQueueIndex(); }
820 
826  VkQueue getQueue() const { return mQueue; }
827 
832  bool isComputeAvailable() const;
833 
838  Texture2D& getEmptyTexture2D() const { return *mEmptyTexture2D; }
839 
844  TextureCube& getEmptyTextureCube() const { return *mEmptyTextureCube; }
845 
850  Texture2D& getEmptyDepthTexture2D() const { return *mEmptyDepthTexture2D; }
851 
856  TextureCube& getEmptyDepthTextureCube() const { return *mEmptyDepthTextureCube; }
857 
862  Texture2D& getErrorTexture2D() const { return *mErrorTexture2D; }
863 
868  TextureCube& getErrorTextureCube() const { return *mErrorTextureCube; }
869 
874  RenderMask getRenderMask(const RenderTag& renderTag) const;
875 
881  RenderMask getRenderMask(const std::string& tagName);
882 
897  Material* getOrCreateMaterial(rtti::TypeInfo shaderType, utility::ErrorState& error);
898 
912  template<typename T>
913  Material* getOrCreateMaterial(utility::ErrorState& error) { return getOrCreateMaterial(RTTI_OF(T), error); }
914 
921  int getCurrentFrameIndex() const { return mCurrentFrameIndex; }
922 
934  constexpr int getMaxFramesInFlight() const { return 2; }
935 
940  void getFormatProperties(VkFormat format, VkFormatProperties& outProperties) const;
941 
949  bool isRenderingFrame() const { return mIsRenderingFrame; }
950 
956  uint32 getVulkanVersion() const { return mAPIVersion; }
957 
964  uint32 getVulkanVersionMajor() const;
965 
972  uint32 getVulkanVersionMinor() const;
973 
978  EVideoDriver getVideoDriver() const { return mVideoDriver; }
979 
985  virtual bool init(nap::utility::ErrorState& errorState) override;
986 
992  bool initEngine(utility::ErrorState& error);
993 
1001  bool initShaderCompilation(utility::ErrorState& error);
1002 
1007 
1012 
1018  bool isInitialized() const { return mInitialized; }
1019 
1027  void waitForFence(int frameIndex);
1028 
1037  int getRank(const nap::RenderLayer& layer) const;
1038 
1039  protected:
1043  virtual void getDependentServices(std::vector<rtti::TypeInfo>& dependencies) override;
1044 
1048  virtual void preShutdown() override;
1049 
1053  virtual void shutdown() override;
1054 
1058  virtual void preResourcesLoaded() override;
1059 
1063  virtual void postResourcesLoaded() override;
1064 
1069  virtual void update(double deltaTime) override;
1070 
1071  private:
1078  bool initEmptyTextures(nap::utility::ErrorState& errorState);
1079 
1085  void removeTextureRequests(Texture2D& texture);
1086 
1091  void requestTextureClear(Texture& texture);
1092 
1097  void requestTextureUpload(Texture2D& texture);
1098 
1103  void requestTextureDownload(Texture2D& texture);
1104 
1109  void requestBufferClear(GPUBuffer& buffer);
1110 
1115  void requestBufferUpload(GPUBuffer& buffer);
1116 
1121  void requestBufferDownload(GPUBuffer& buffer);
1122 
1128  void removeBufferRequests(GPUBuffer& buffer);
1129 
1135  void transferData(VkCommandBuffer commandBuffer, const std::function<void()>& transferFunction);
1136 
1140  void downloadData();
1141 
1145  void uploadData();
1146 
1151  void updateDownloads();
1152 
1157  void processVulkanDestructors(int frameIndex);
1158 
1163  void waitDeviceIdle();
1164 
1172  bool writeIni(const std::string& path, utility::ErrorState error);
1173 
1181  bool loadIni(const std::string& path, utility::ErrorState error);
1182 
1187  void restoreWindow(nap::RenderWindow& window);
1188 
1195  bool addTag(const RenderTag& renderTag, nap::utility::ErrorState& error);
1196 
1201  void removeTag(const RenderTag& renderTag);
1202 
1207  void addChain(const RenderChain& chain);
1208 
1213  void removeChain(const RenderChain& chain);
1214 
1215  private:
1216  struct UniqueMaterial;
1217  using PipelineCache = std::unordered_map<PipelineKey, Pipeline>;
1218  using ComputePipelineCache = std::unordered_map<ComputePipelineKey, Pipeline>;
1219  using WindowList = std::vector<RenderWindow*>;
1220  using DescriptorSetCacheMap = std::unordered_map<VkDescriptorSetLayout, std::unique_ptr<DescriptorSetCache>>;
1221  using TextureSet = std::unordered_set<Texture*>;
1222  using Texture2DSet = std::unordered_set<Texture2D*>;
1223  using BufferSet = std::unordered_set<GPUBuffer*>;
1224  using VulkanObjectDestructorList = std::vector<VulkanObjectDestructor>;
1225  using UniqueMaterialCache = std::unordered_map<rtti::TypeInfo, std::unique_ptr<UniqueMaterial>>;
1226 
1231  enum EQueueSubmitOp : uint
1232  {
1233  Rendering = 0x01,
1234  HeadlessRendering = 0x02,
1235  Compute = 0x04
1236  };
1237  using QueueSubmitOps = uint;
1238 
1242  struct Frame
1243  {
1244  VkFence mFence;
1245  std::vector<Texture2D*> mTextureDownloads;
1246  std::vector<GPUBuffer*> mBufferDownloads;
1247  VkCommandBuffer mUploadCommandBuffer;
1248  VkCommandBuffer mDownloadCommandBuffer;
1249  VkCommandBuffer mHeadlessCommandBuffer;
1250  VkCommandBuffer mComputeCommandBuffer;
1251  VulkanObjectDestructorList mQueuedVulkanObjectDestructors;
1252  QueueSubmitOps mQueueSubmitOps = 0U;
1253  };
1254 
1259  struct UniqueMaterial
1260  {
1261  UniqueMaterial() = default;
1262  UniqueMaterial(std::unique_ptr<Shader> shader, std::unique_ptr<Material> material);
1263  std::unique_ptr<Shader> mShader = nullptr;
1264  std::unique_ptr<Material> mMaterial = nullptr;
1265  bool valid() const;
1266  };
1267 
1268  bool mEnableCaching = true;
1269  bool mSampleShadingSupported = false;
1270  bool mAnisotropicFilteringSupported = false;
1271  bool mWideLinesSupported = false;
1272  bool mLargePointsSupported = false;
1273  bool mNonSolidFillModeSupported = false;
1274  uint32 mAnisotropicSamples = 1;
1275  WindowList mWindows;
1276  SceneService* mSceneService = nullptr;
1277  bool mIsRenderingFrame = false;
1278  bool mCanDestroyVulkanObjectsImmediately = true;
1279 
1280  // Empty textures
1281  std::unique_ptr<Texture2D> mEmptyTexture2D;
1282  std::unique_ptr<TextureCube> mEmptyTextureCube;
1283  std::unique_ptr<DepthRenderTexture2D> mEmptyDepthTexture2D;
1284  std::unique_ptr<DepthRenderTextureCube> mEmptyDepthTextureCube;
1285 
1286  // Error textures
1287  std::unique_ptr<Texture2D> mErrorTexture2D;
1288  std::unique_ptr<TextureCube> mErrorTextureCube;
1289  const RGBAColorFloat mErrorColor = { 1.0f, 0.3137f, 0.3137f, 1.0f };
1290 
1291  TextureSet mTexturesToClear;
1292  Texture2DSet mTexturesToUpload;
1293  BufferSet mBuffersToClear;
1294  BufferSet mBuffersToUpload;
1295 
1296  int mCurrentFrameIndex = 0;
1297  std::vector<Frame> mFramesInFlight;
1298  RenderWindow* mCurrentRenderWindow = nullptr;
1299 
1300  DescriptorSetCacheMap mDescriptorSetCaches;
1301  std::unique_ptr<DescriptorSetAllocator> mDescriptorSetAllocator;
1302 
1303  VkInstance mInstance = VK_NULL_HANDLE;
1304  VmaAllocator mVulkanAllocator = VK_NULL_HANDLE;
1305  VkDebugReportCallbackEXT mDebugCallback = VK_NULL_HANDLE;
1306  VkDebugUtilsMessengerEXT mDebugUtilsMessengerCallback = VK_NULL_HANDLE;
1307 
1308  PhysicalDevice mPhysicalDevice;
1309  VkDevice mDevice = VK_NULL_HANDLE;
1310  VkCommandBuffer mCurrentCommandBuffer = VK_NULL_HANDLE;
1311 
1312  VkCommandPool mCommandPool = VK_NULL_HANDLE;
1313  VkQueue mQueue = VK_NULL_HANDLE;
1314 
1315  PipelineCache mPipelineCache;
1316  ComputePipelineCache mComputePipelineCache;
1317 
1318  VkFormat mDepthFormat = VK_FORMAT_UNDEFINED;
1319  VkSampleCountFlagBits mMaxRasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
1320 
1321  uint32 mAPIVersion = 0;
1322  bool mInitialized = false;
1323  bool mSDLInitialized = false;
1324  bool mShInitialized = false;
1325  bool mHeadless = false;
1326 
1327  UniqueMaterialCache mMaterials;
1328 
1329  // Render command queues
1330  std::vector<RenderCommand> mHeadlessCommandQueue;
1331  std::vector<RenderCommand> mComputeCommandQueue;
1332 
1333  // The registered render tag and layer registries
1334  std::vector<const RenderTag*> mRenderTags;
1335 
1336  // Cache read from ini file, contains saved settings
1337  std::vector<std::unique_ptr<rtti::Object>> mCache;
1338 
1339  // Render chains
1340  std::vector<const RenderChain*> mRenderChains;
1341 
1342  // Video backend driver
1343  EVideoDriver mVideoDriver = EVideoDriver::Unknown;
1344  };
1345 } // nap
nap::RenderService::getPhysicalDeviceVersion
uint32 getPhysicalDeviceVersion() const
Definition: renderservice.h:702
nap::RenderService::getErrorTextureCube
TextureCube & getErrorTextureCube() const
Definition: renderservice.h:868
nap::uint
unsigned int uint
Definition: numeric.h:23
nap::RenderService::getAnisotropicSamples
uint32 getAnisotropicSamples() const
Definition: renderservice.h:795
nap::IRenderTarget
Definition: irendertarget.h:21
nap::RenderService::isHeadlessCommandQueued
bool isHeadlessCommandQueued() const
Definition: renderservice.h:645
nap::PhysicalDevice::getQueueIndex
int getQueueIndex() const
Definition: renderservice.h:125
nap::DescriptorSetCache
Definition: descriptorsetcache.h:48
nap::RenderService::windowRemoved
nap::Signal< nap::RenderWindow & > windowRemoved
Definition: renderservice.h:1011
nap::RenderWindow
Definition: renderwindow.h:43
nap::RenderService::isComputeCommandQueued
bool isComputeCommandQueued() const
Definition: renderservice.h:650
nap::RenderServiceConfiguration::EPhysicalDeviceType
EPhysicalDeviceType
Definition: renderservice.h:70
nap::RenderService::getDepthFormat
VkFormat getDepthFormat() const
Definition: renderservice.h:801
nap::RenderService::Pipeline
Definition: renderservice.h:216
nap::RenderService::isInitialized
bool isInitialized() const
Definition: renderservice.h:1018
nap::RenderService::isHeadless
bool isHeadless() const
Definition: renderservice.h:658
nap::Texture
Definition: texture.h:31
nap::RenderTag
Definition: rendertag.h:51
nap::TextureCube
Definition: texture.h:302
nap::EPolygonMode
EPolygonMode
Definition: mesh.h:55
nap::ERasterizationSamples
ERasterizationSamples
Definition: renderutils.h:25
nap::RenderService::getWideLinesSupported
bool getWideLinesSupported() const
Definition: renderservice.h:755
nap::CameraComponentInstance
Definition: cameracomponent.h:38
nap::RenderService::getEmptyDepthTextureCube
TextureCube & getEmptyDepthTextureCube() const
Definition: renderservice.h:856
nap::utility::ErrorState
Definition: errorstate.h:19
nap::RenderService::getEmptyDepthTexture2D
Texture2D & getEmptyDepthTexture2D() const
Definition: renderservice.h:850
nap::IMesh
Definition: mesh.h:401
nap::RenderService::getCurrentRenderWindow
RenderWindow * getCurrentRenderWindow()
Definition: renderservice.h:674
nap::Material
Definition: material.h:83
nap::RenderService::getEmptyTexture2D
Texture2D & getEmptyTexture2D() const
Definition: renderservice.h:838
nap::Display
Definition: display.h:24
nap::RenderMask
uint64 RenderMask
Definition: rendertag.h:23
nap::RenderService::getLargePointsSupported
bool getLargePointsSupported() const
Definition: renderservice.h:773
nap::EVideoDriver
EVideoDriver
Definition: videodriver.h:20
nap::RenderService::getNonSolidFillSupported
bool getNonSolidFillSupported() const
Definition: renderservice.h:761
nap::RenderService::getVulkanVersion
uint32 getVulkanVersion() const
Definition: renderservice.h:956
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:708
nap::RenderLayer
Definition: renderlayer.h:43
nap::RenderService::getVideoDriver
EVideoDriver getVideoDriver() const
Definition: renderservice.h:978
nap::PhysicalDevice::getProperties
const VkPhysicalDeviceProperties & getProperties() const
Definition: renderservice.h:130
nap::Texture2D
Definition: texture.h:117
nap::PhysicalDevice::getFeatures
const VkPhysicalDeviceFeatures & getFeatures() const
Definition: renderservice.h:135
nap::Signal< nap::RenderWindow & >
nap::RenderService::getPhysicalDevice
VkPhysicalDevice getPhysicalDevice() const
Definition: renderservice.h:687
nap::RenderServiceConfiguration::getServiceType
rtti::TypeInfo getServiceType() const override
Definition: renderservice.h:94
nap::SurfaceDescriptor
Definition: surfacedescriptor.h:46
nap::RenderService
Definition: renderservice.h:198
nap::EVideoDriver::Default
@ Default
Property: 'Default' Most reasonable, first available video back-end.
nap::RenderService::getQueue
VkQueue getQueue() const
Definition: renderservice.h:826
nap::EVideoDriver::Unknown
@ Unknown
Unsupported video driver [NOT EXPOSED].
nap::RenderService::getCurrentCommandBuffer
VkCommandBuffer getCurrentCommandBuffer()
Definition: renderservice.h:667
nap::RenderService::getVulkanInstance
VkInstance getVulkanInstance() const
Definition: renderservice.h:680
nap::RenderService::getMaxFramesInFlight
constexpr int getMaxFramesInFlight() const
Definition: renderservice.h:934
nap::mask::all
constexpr RenderMask all
Definition: rendertag.h:28
nap::Service
Definition: templateservice.h:8
nap::RenderChain
Definition: renderlayer.h:66
nap::PhysicalDevice::isValid
bool isValid() const
Definition: renderservice.h:145
nap::EPolygonMode::Fill
@ Fill
Polygons are interpreted and rendered using the specified 'EDrawMode'.
nap::RenderableMesh
Definition: renderablemesh.h:22
nap::MaterialInstance
Definition: materialinstance.h:297
nap::RenderService::VulkanObjectDestructor
std::function< void(RenderService &)> VulkanObjectDestructor
Definition: renderservice.h:210
nap::RenderService::Pipeline::isValid
bool isValid() const
Definition: renderservice.h:222
nap::WindowEventPtr
std::unique_ptr< WindowEvent > WindowEventPtr
Definition: windowevent.h:188
nap::ComputeMaterialInstance
Definition: materialinstance.h:360
nap::RenderService::getCommandPool
VkCommandPool getCommandPool() const
Definition: renderservice.h:808
nap::RenderService::getDevice
VkDevice getDevice() const
Definition: renderservice.h:715
nap::RenderService::getOrCreateMaterial
Material * getOrCreateMaterial(utility::ErrorState &error)
Definition: renderservice.h:913
nap::PhysicalDevice
Definition: renderservice.h:108
nap::RGBAColorFloat
RGBAColor< float > RGBAColorFloat
Definition: color.h:580
nap::RenderService::getEmptyTextureCube
TextureCube & getEmptyTextureCube() const
Definition: renderservice.h:844
nap::RenderServiceConfiguration
Definition: renderservice.h:50
nap
Definition: templateapp.h:17
nap::RenderService::getPolygonModeSupported
bool getPolygonModeSupported(EPolygonMode mode)
Definition: renderservice.h:767
nap::GPUBuffer
Definition: gpubuffer.h:64
nap::PhysicalDevice::getHandle
VkPhysicalDevice getHandle() const
Definition: renderservice.h:120
nap::PhysicalDevice::getQueueCapabilities
const VkQueueFlags & getQueueCapabilities() const
Definition: renderservice.h:140
nap::RenderService::SortFunction
std::function< void(std::vector< RenderableComponentInstance * > &, const glm::mat4 &viewMatrix)> SortFunction
Definition: renderservice.h:209
nap::rtti::TypeInfo
rttr::type TypeInfo
Definition: typeinfo.h:141
nap::RenderService::getVulkanAllocator
VmaAllocator getVulkanAllocator() const
Definition: renderservice.h:640
nap::RenderService::getQueueIndex
uint32 getQueueIndex() const
Definition: renderservice.h:819
nap::RenderService::windowAdded
nap::Signal< nap::RenderWindow & > windowAdded
Definition: renderservice.h:1006
nap::RenderService::getCurrentFrameIndex
int getCurrentFrameIndex() const
Definition: renderservice.h:921
nap::RenderService::getHighDPIEnabled
bool getHighDPIEnabled() const
Definition: renderservice.h:788
nap::RenderService::isRenderingFrame
bool isRenderingFrame() const
Definition: renderservice.h:949
nap::RenderService::getErrorTexture2D
Texture2D & getErrorTexture2D() const
Definition: renderservice.h:862
nap::RenderService::getPhysicalDeviceFeatures
const VkPhysicalDeviceFeatures & getPhysicalDeviceFeatures() const
Definition: renderservice.h:693
nap::RenderService::RenderCommand
std::function< void(RenderService &)> RenderCommand
Definition: renderservice.h:211