Foundation
Loading...
Searching...
No Matches
Device.hpp
Go to the documentation of this file.
1#pragma once
2#include "Command.hpp"
3#include "Descriptor.hpp"
4#include "PipelineState.hpp"
5#include "Resource.hpp"
6#include "Shader.hpp"
7#include "Surface.hpp"
8#include "Swapchain.hpp"
9
10namespace Foundation::RHI
11{
12 class RHIApplication;
13 class RHIDevice;
14 class RHIDeviceSemaphore;
15 class RHIDeviceFence;
17 {
18 protected:
20
21 public:
22 RHIDeviceQueue(RHIDevice const& device) : mDevice(device) {}
23
24 virtual void WaitIdle() const = 0;
27 {
28 // Semaphore(s) and the minimum values to wait on
30 // Semaphore(s) and the values to signal
32 // Binary semaphore(s) to wait when the command lists are done
34 // Stages the semaphore waits occur in [timeline_waits..., waits...]
36 // Binary semaphore(s) to signal when the command lists are done
38 // Command lists to submit
40 };
41 virtual void Submit(Span<const SubmitDesc> desc, RHIDeviceFence* completionFence = nullptr) const = 0;
42
44 {
45 uint32_t imageIndex;
47 // Binary semaphore(s) to wait
49 };
50 virtual RHISwapchainResult Present(PresentDesc const& desc) const = 0;
51 [[nodiscard]] virtual uint32_t GetVkQueueFamily() const = 0;
52 virtual void DebugSetObjectName(const char* name) = 0;
53 };
54 // https://docs.vulkan.org/samples/latest/samples/extensions/timeline_semaphore/README.html
56 {
57 protected:
59
60 public:
61 const bool mIsTimeline;
62 RHIDeviceSemaphore(RHIDevice const& device, bool is_timeline) : mDevice(device), mIsTimeline(is_timeline) {}
63
64 virtual void DebugSetObjectName(const char* name) = 0;
65 };
67 {
68 protected:
70
71 public:
72 RHIDeviceFence(RHIDevice const& device) : mDevice(device) {}
73
74 virtual void DebugSetObjectName(const char* name) = 0;
75 };
77 {
78 struct Binding
79 {
80 uint32_t count{1}; // Array size for array access
81 RHIShaderStage stage{RHIShaderStageBits::All}; // Stage this binding is used in
82 RHIDescriptorType type; // Type of this binding
83 };
84 // Bindings that make up this layout
86 // Allow updating descriptors after being bound to a command buffer when
87 // they are not used
88 bool updateAfterBind{false};
89 };
91 {
92 protected:
94
95 public:
98 mDevice(device), mDesc(desc)
99 {
100 }
101
102 virtual void DebugSetObjectName(const char* name) = 0;
103 };
105 {
106 protected:
108
109 public:
111 {
113 {
114 bool enable{false}; // Enable anisotropic filtering
115 float maxLevel{16.0f}; // Max anisotropy level
118 {
127 v{Repeat}, w{Repeat}; // Address modes for U, V, W coordinates
129 struct Mipmap
130 {
132 {
134 Nearest
135 } mipmapMode{Linear}; // Mipmap mode;
136 float bias{0.0f}; // Mipmap LOD bias
138 struct Filter
139 {
140 enum Type
141 {
144 Cubic
145 } minFilter{Linear},
146 magFilter{Linear}; // Minification and magnification filters
148 struct LOD
149 {
150 float min{0.0f}; // Minimum level of detail
151 float max{16.0f}; // Maximum level of detail
152 } lod; // Level of detail settings;
153 enum class Reduction
154 {
156 Min,
157 Max
159 } const mDesc;
160 RHIDeviceSampler(RHIDevice const& device, SamplerDesc const& desc) : mDevice(device), mDesc(desc) {}
161
162 virtual void DebugSetObjectName(const char* name) = 0;
163 };
165 {
166 protected:
168
169 public:
179 RHIDeviceQueryPool(RHIDevice const& device, QueryPoolDesc const& desc) : mDevice(device), mDesc(desc) {}
180
181 // NOTE: In nanoseconds
182 virtual const float GetTimestampResolution() = 0;
183
184 virtual void Reset() = 0;
185
186 virtual Span<const uint64_t> GetResults(bool wait = true) = 0;
187 virtual void DebugSetObjectName(const char* name) = 0;
188 };
190 {
200 // Direct GPU memory access thanks to either UMA or ReBAR
201 // https://asawicki.info/news_1740_vulkan_memory_types_on_pc_and_how_to_use_them
204 };
206 {
207 uint32_t heapIndex{};
209 size_t heapSize{};
210 size_t usage{};
211 size_t budget{};
212 uint32_t blockCount{};
213 uint32_t allocationCount{};
214 size_t blockBytes{};
216 };
245 class RHIDevice : public RHIObject
246 {
247 public:
249 {
250 uint32_t id = 0;
251 String name = "RHIDevice";
253 };
255 RHIDevice(RHIApplication const& app) : mApp(app) {}
256
257 [[nodiscard]] virtual RHIDeviceCapabilities GetCapabilities() const = 0;
258 [[nodiscard]] virtual RHIPipelineStateCacheKey GetPipelineCacheKey() const = 0;
259 [[nodiscard]] virtual RHIDeviceScopedHandle<RHISurface>
261 [[nodiscard]] virtual RHISurface* GetSurface(Handle handle) const = 0;
262 virtual void DestroySurface(Handle handle) = 0;
263
264 [[nodiscard]] virtual RHIDeviceScopedHandle<RHISwapchain>
266 [[nodiscard]] virtual RHISwapchain* GetSwapchain(Handle handle) const = 0;
267 virtual void DestroySwapchain(Handle handle) = 0;
268
271 [[nodiscard]] virtual RHIPipelineStateCache* GetPipelineCache(Handle handle) const = 0;
272 virtual void DestroyPipelineCache(Handle handle) = 0;
273
274 [[nodiscard]] virtual RHIDeviceScopedHandle<RHIPipelineState>
276 [[nodiscard]] virtual RHIPipelineState* GetPipelineState(Handle handle) const = 0;
277 virtual void DestroyPipelineState(Handle handle) = 0;
278
279 [[nodiscard]] virtual RHIDeviceScopedHandle<RHIShaderModule>
281 [[nodiscard]] virtual RHIShaderModule* GetShaderModule(Handle handle) const = 0;
282 virtual void DestroyShaderModule(Handle handle) = 0;
283
284 [[nodiscard]] virtual RHIDeviceScopedHandle<RHICommandPool>
286 [[nodiscard]] virtual RHICommandPool* GetCommandPool(Handle handle) const = 0;
287 virtual void DestroyCommandPool(Handle handle) = 0;
288
289 [[nodiscard]] virtual RHIDeviceQueue* GetDeviceQueue(RHIDeviceQueueType type) const = 0;
290
291 [[nodiscard]] virtual RHIDeviceScopedHandle<RHIDeviceSemaphore> CreateSemaphore(bool is_timeline = false) = 0;
292 [[nodiscard]] virtual RHIDeviceSemaphore* GetSemaphore(Handle handle) const = 0;
293 virtual void DestroySemaphore(Handle handle) = 0;
294
295 [[nodiscard]] virtual RHIDeviceScopedHandle<RHIDeviceFence> CreateFence(bool signaled = true) = 0;
296 [[nodiscard]] virtual RHIDeviceFence* GetFence(Handle handle) const = 0;
297 virtual void DestroyFence(Handle handle) = 0;
298
299 [[nodiscard]] virtual RHIDeviceScopedHandle<RHIBuffer> CreateBuffer(RHIBufferDesc const& desc) = 0;
300 [[nodiscard]] virtual RHIBuffer* GetBuffer(Handle handle) const = 0;
301 virtual void DestroyBuffer(Handle handle) = 0;
302
303 [[nodiscard]] virtual RHIDeviceScopedHandle<RHITexture> CreateTexture(RHITextureDesc const& desc) = 0;
304 [[nodiscard]] virtual RHITexture* GetTexture(Handle handle) const = 0;
305 virtual void DestroyTexture(Handle handle) = 0;
306
309 [[nodiscard]] virtual RHIAccelerationStructure* GetAccelerationStructure(Handle handle) const = 0;
310 virtual void DestroyAccelerationStructure(Handle handle) = 0;
311
314 [[nodiscard]] virtual RHIDeviceDescriptorSetLayout* GetDescriptorSetLayout(Handle handle) const = 0;
315 virtual void DestroyDescriptorSetLayout(Handle handle) = 0;
316
319 [[nodiscard]] virtual RHIDeviceDescriptorPool* GetDescriptorPool(Handle handle) const = 0;
320 virtual void DestroyDescriptorPool(Handle handle) = 0;
321
322 [[nodiscard]] virtual RHIDeviceScopedHandle<RHIDeviceSampler>
324 [[nodiscard]] virtual RHIDeviceSampler* GetSampler(Handle handle) const = 0;
325 virtual void DestroySampler(Handle handle) = 0;
326
329 [[nodiscard]] virtual RHIDeviceQueryPool* GetQueryPool(Handle handle) const = 0;
330 virtual void DestroyQueryPool(Handle handle) = 0;
331
333 [[nodiscard]] virtual RHIVirtualAllocator* GetVirtualAllocator(Handle handle) const = 0;
334 virtual void DestroyVirtualAllocator(Handle handle) = 0;
335
336 [[nodiscard]] virtual RHIAccelerationStructureSizeInfo
338 Allocator* scratchAllocator = nullptr) const = 0;
343 [[nodiscard]] virtual size_t
345 void* dest) const = 0;
346
347 virtual void ResetFences(Span<RHIDeviceFence* const> fences) = 0;
354 virtual bool WaitForFences(Span<RHIDeviceFence* const> fences, bool wait_all, size_t timeout) = 0;
355
363 size_t timeout) = 0;
364
365 virtual void WaitIdle() const = 0;
366
367 virtual void QueryBudget(RHIDeviceHeapType heapType, size_t& used, size_t& budget) const = 0;
368 virtual void QueryAllocationStats(size_t& blockBytes, size_t& allocationBytes) const = 0;
369 virtual void QueryMemoryStats(RHIDeviceMemoryStats& outStats) const = 0;
370 virtual String QueryDeviceString() const = 0;
371
372 virtual void DebugSetObjectName(const char* name) = 0;
373 };
378 {
379 RHIDevice const* mDevice{nullptr};
381 RHIDeviceIdleGuard(RHIDevice const* device) : mDevice(device) {};
382 void WaitIdle() const
383 {
384 if (mDevice)
385 mDevice->WaitIdle();
386 }
388 };
389
390 template<>
392 {
393 static RHISurface* Get(const RHIDevice* device, Handle handle) { return device->GetSurface(handle); }
394 static void Destroy(RHIDevice* device, Handle handle) { device->DestroySurface(handle); }
395 };
396
397 template <>
399 {
400 static RHISwapchain* Get(RHIDevice const* device, Handle handle) { return device->GetSwapchain(handle); }
401 static void Destroy(RHIDevice* device, Handle handle) { device->DestroySwapchain(handle); }
402 };
403 template <>
405 {
406 static RHIPipelineState* Get(RHIDevice const* device, Handle handle)
407 {
408 return device->GetPipelineState(handle);
409 }
410 static void Destroy(RHIDevice* device, Handle handle) { device->DestroyPipelineState(handle); }
411 };
412 template <>
414 {
415 static RHIShaderModule* Get(RHIDevice const* device, Handle handle) { return device->GetShaderModule(handle); }
416 static void Destroy(RHIDevice* device, Handle handle) { device->DestroyShaderModule(handle); }
417 };
418 template <>
420 {
421 static RHICommandPool* Get(RHIDevice const* device, Handle handle) { return device->GetCommandPool(handle); }
422 static void Destroy(RHIDevice* device, Handle handle) { device->DestroyCommandPool(handle); }
423 };
424 template <>
426 {
427 static RHIDeviceSemaphore* Get(RHIDevice const* device, Handle handle) { return device->GetSemaphore(handle); }
428 static void Destroy(RHIDevice* device, Handle handle) { device->DestroySemaphore(handle); }
429 };
430 template <>
432 {
433 static RHIDeviceFence* Get(RHIDevice const* device, Handle handle) { return device->GetFence(handle); }
434 static void Destroy(RHIDevice* device, Handle handle) { device->DestroyFence(handle); }
435 };
436 template <>
438 {
439 static RHIBuffer* Get(RHIDevice const* device, Handle handle) { return device->GetBuffer(handle); }
440 static void Destroy(RHIDevice* device, Handle handle) { device->DestroyBuffer(handle); }
441 };
442 template <>
444 {
445 static RHITexture* Get(RHIDevice const* device, Handle handle) { return device->GetTexture(handle); }
446 static void Destroy(RHIDevice* device, Handle handle) { device->DestroyTexture(handle); }
447 };
448 template <>
450 {
451 static RHIDeviceDescriptorSetLayout* Get(RHIDevice const* device, Handle handle)
452 {
453 return device->GetDescriptorSetLayout(handle);
454 }
455 static void Destroy(RHIDevice* device, Handle handle) { device->DestroyDescriptorSetLayout(handle); }
456 };
457 template <>
459 {
460 static RHIDeviceDescriptorPool* Get(RHIDevice const* device, Handle handle)
461 {
462 return device->GetDescriptorPool(handle);
463 }
464 static void Destroy(RHIDevice* device, Handle handle) { device->DestroyDescriptorPool(handle); }
465 };
466 template <>
468 {
469 static RHIDeviceSampler* Get(RHIDevice const* device, Handle handle) { return device->GetSampler(handle); }
470 static void Destroy(RHIDevice* device, Handle handle) { device->DestroySampler(handle); }
471 };
472 template <>
474 {
475 static RHIPipelineStateCache* Get(RHIDevice const* device, Handle handle)
476 {
477 return device->GetPipelineCache(handle);
478 }
479 static void Destroy(RHIDevice* device, Handle handle) { device->DestroyPipelineCache(handle); }
480 };
481 template <>
483 {
484 static RHIVirtualAllocator* Get(RHIDevice const* device, Handle handle) { return device->GetVirtualAllocator(handle); }
485 static void Destroy(RHIDevice* device, Handle handle) { device->DestroyVirtualAllocator(handle); }
486 };
487 template <>
489 {
490 static RHIDeviceQueryPool* Get(RHIDevice const* device, Handle handle) { return device->GetQueryPool(handle); }
491 static void Destroy(RHIDevice* device, Handle handle) { device->DestroyQueryPool(handle); }
492 };
493 template <>
495 {
496 static RHIAccelerationStructure* Get(RHIDevice const* device, Handle handle)
497 {
498 return device->GetAccelerationStructure(handle);
499 }
500 static void Destroy(RHIDevice* device, Handle handle) { device->DestroyAccelerationStructure(handle); }
501 };
502} // namespace Foundation::RHI
Allocator interface (noexcept)
Definition Allocator.hpp:29
The root object of everything RHI. Implementation of this class inherently defines the RHI backend.
Definition Application.hpp:24
Definition Resource.hpp:57
Definition Command.hpp:18
Definition Descriptor.hpp:49
const RHIDeviceDescriptorSetLayoutDesc mDesc
Definition Device.hpp:96
RHIDeviceDescriptorSetLayout(RHIDevice const &device, RHIDeviceDescriptorSetLayoutDesc const &desc)
Definition Device.hpp:97
const RHIDevice & mDevice
Definition Device.hpp:93
virtual void DebugSetObjectName(const char *name)=0
Definition Device.hpp:67
const RHIDevice & mDevice
Definition Device.hpp:69
RHIDeviceFence(RHIDevice const &device)
Definition Device.hpp:72
virtual void DebugSetObjectName(const char *name)=0
Definition Device.hpp:165
virtual Span< const uint64_t > GetResults(bool wait=true)=0
struct Foundation::RHI::RHIDeviceQueryPool::QueryPoolDesc mDesc
virtual const float GetTimestampResolution()=0
const RHIDevice & mDevice
Definition Device.hpp:167
virtual void DebugSetObjectName(const char *name)=0
RHIDeviceQueryPool(RHIDevice const &device, QueryPoolDesc const &desc)
Definition Device.hpp:179
Definition Device.hpp:17
RHIDeviceQueue(RHIDevice const &device)
Definition Device.hpp:22
virtual void Submit(Span< const SubmitDesc > desc, RHIDeviceFence *completionFence=nullptr) const =0
virtual void DebugSetObjectName(const char *name)=0
Pair< RHIDeviceSemaphore *, size_t > TimelinePair
Definition Device.hpp:25
virtual uint32_t GetVkQueueFamily() const =0
virtual void WaitIdle() const =0
const RHIDevice & mDevice
Definition Device.hpp:19
virtual RHISwapchainResult Present(PresentDesc const &desc) const =0
Definition Device.hpp:105
struct Foundation::RHI::RHIDeviceSampler::SamplerDesc mDesc
const RHIDevice & mDevice
Definition Device.hpp:107
RHIDeviceSampler(RHIDevice const &device, SamplerDesc const &desc)
Definition Device.hpp:160
virtual void DebugSetObjectName(const char *name)=0
Definition Device.hpp:56
RHIDeviceSemaphore(RHIDevice const &device, bool is_timeline)
Definition Device.hpp:62
const RHIDevice & mDevice
Definition Device.hpp:58
const bool mIsTimeline
Definition Device.hpp:61
virtual void DebugSetObjectName(const char *name)=0
Definition Device.hpp:246
virtual RHIDeviceScopedHandle< RHISurface > CreateSurface(RHISurface::SurfaceDesc const &desc)=0
virtual RHIBuffer * GetBuffer(Handle handle) const =0
virtual void DestroySurface(Handle handle)=0
virtual RHIDeviceScopedHandle< RHIPipelineState > CreatePipelineState(RHIPipelineState::PipelineStateDesc const &desc)=0
virtual RHISurface * GetSurface(Handle handle) const =0
virtual void DestroyAccelerationStructure(Handle handle)=0
virtual RHIDeviceScopedHandle< RHIBuffer > CreateBuffer(RHIBufferDesc const &desc)=0
virtual RHIDeviceDescriptorPool * GetDescriptorPool(Handle handle) const =0
virtual void DestroyQueryPool(Handle handle)=0
virtual RHIDeviceSampler * GetSampler(Handle handle) const =0
virtual RHIPipelineState * GetPipelineState(Handle handle) const =0
virtual bool WaitForTimelineSemaphores(Span< const Pair< RHIDeviceSemaphore *, size_t > > semaphores, size_t timeout)=0
Wait for timeline semaphores to reach specified values.
virtual String QueryDeviceString() const =0
virtual void DestroyVirtualAllocator(Handle handle)=0
virtual RHIDeviceScopedHandle< RHICommandPool > CreateCommandPool(RHICommandPool::PoolDesc type)=0
virtual bool WaitForFences(Span< RHIDeviceFence *const > fences, bool wait_all, size_t timeout)=0
Wait for fences to arrive.
virtual RHIAccelerationStructureSizeInfo GetAccelerationStructureSizeInfo(RHIAccelerationStructureBuildDesc const &desc, Allocator *scratchAllocator=nullptr) const =0
virtual RHIDeviceFence * GetFence(Handle handle) const =0
virtual RHISwapchain * GetSwapchain(Handle handle) const =0
virtual RHIDeviceScopedHandle< RHIShaderModule > CreateShaderModule(RHIShaderModule::ShaderModuleDesc const &desc)=0
virtual void DestroyDescriptorPool(Handle handle)=0
virtual RHIPipelineStateCache * GetPipelineCache(Handle handle) const =0
virtual void DestroyPipelineState(Handle handle)=0
virtual RHIPipelineStateCacheKey GetPipelineCacheKey() const =0
const RHIApplication & mApp
Definition Device.hpp:254
virtual RHITexture * GetTexture(Handle handle) const =0
virtual RHIDeviceScopedHandle< RHIDeviceDescriptorSetLayout > CreateDescriptorSetLayout(RHIDeviceDescriptorSetLayoutDesc const &desc)=0
virtual void DestroyShaderModule(Handle handle)=0
virtual void DestroyTexture(Handle handle)=0
virtual RHIDeviceScopedHandle< RHIAccelerationStructure > CreateAccelerationStructure(RHIAccelerationStructureDesc const &desc)=0
virtual RHIAccelerationStructure * GetAccelerationStructure(Handle handle) const =0
virtual RHIDeviceScopedHandle< RHITexture > CreateTexture(RHITextureDesc const &desc)=0
virtual RHIDeviceScopedHandle< RHIVirtualAllocator > CreateVirtualAllocator(uint64_t size)=0
virtual void DestroySemaphore(Handle handle)=0
virtual void DebugSetObjectName(const char *name)=0
virtual void ResetFences(Span< RHIDeviceFence *const > fences)=0
virtual void DestroyPipelineCache(Handle handle)=0
virtual void DestroySampler(Handle handle)=0
virtual void WaitIdle() const =0
virtual RHIDeviceScopedHandle< RHIDeviceSampler > CreateSampler(RHIDeviceSampler::SamplerDesc const &desc)=0
virtual size_t WriteAccelerationStructureInstanceData(RHIAccelerationStructureGeometryInstance const &data, void *dest) const =0
virtual RHIDeviceScopedHandle< RHIPipelineStateCache > CreatePipelineCache(RHIPipelineStateCache::PipelineStateCacheDesc const &desc)=0
virtual RHIDeviceScopedHandle< RHIDeviceDescriptorPool > CreateDescriptorPool(RHIDeviceDescriptorPool::PoolDesc const &desc)=0
virtual void QueryMemoryStats(RHIDeviceMemoryStats &outStats) const =0
virtual void QueryAllocationStats(size_t &blockBytes, size_t &allocationBytes) const =0
virtual RHIDeviceQueryPool * GetQueryPool(Handle handle) const =0
virtual RHIDeviceSemaphore * GetSemaphore(Handle handle) const =0
virtual RHIDeviceCapabilities GetCapabilities() const =0
virtual RHIVirtualAllocator * GetVirtualAllocator(Handle handle) const =0
virtual RHIDeviceScopedHandle< RHIDeviceFence > CreateFence(bool signaled=true)=0
virtual RHIShaderModule * GetShaderModule(Handle handle) const =0
virtual RHIDeviceScopedHandle< RHIDeviceQueryPool > CreateQueryPool(RHIDeviceQueryPool::QueryPoolDesc const &desc)=0
virtual void SignalTimelineSemaphores(Span< const Pair< RHIDeviceSemaphore *, size_t > > semaphores)=0
virtual void DestroyBuffer(Handle handle)=0
virtual void QueryBudget(RHIDeviceHeapType heapType, size_t &used, size_t &budget) const =0
virtual void DestroyFence(Handle handle)=0
virtual RHICommandPool * GetCommandPool(Handle handle) const =0
virtual void DestroyDescriptorSetLayout(Handle handle)=0
virtual void DestroySwapchain(Handle handle)=0
virtual RHIDeviceDescriptorSetLayout * GetDescriptorSetLayout(Handle handle) const =0
virtual RHIDeviceQueue * GetDeviceQueue(RHIDeviceQueueType type) const =0
virtual RHIDeviceScopedHandle< RHISwapchain > CreateSwapchain(RHISwapchain::SwapchainDesc const &desc)=0
virtual RHIDeviceScopedHandle< RHIDeviceSemaphore > CreateSemaphore(bool is_timeline=false)=0
virtual void DestroyCommandPool(Handle handle)=0
RHIDevice(RHIApplication const &app)
Definition Device.hpp:255
Base class for all RHI objects.
Definition Details.hpp:17
Definition PipelineState.hpp:43
Definition PipelineState.hpp:60
Scoped move-only RAII handle wrapper for RHI Objects.
Definition Details.hpp:85
Definition Shader.hpp:5
Definition Surface.hpp:6
Definition Swapchain.hpp:32
Definition Resource.hpp:216
Sub-allocates byte ranges within an abstract fixed-size space.
Definition Resource.hpp:124
std::vector< T, StlAllocator< T > > Vector
std::vector with explicit Foundation::Core::StlAllocator constructor
Definition Container.hpp:149
std::pair< First, Second > Pair
Alias for std::pair
Definition Container.hpp:33
std::basic_string< char, std::char_traits< char >, StlDefaultAllocator< char > > String
Alias for std::basic_string<char>, without an explicit allocator constructor.
Definition Container.hpp:120
std::span< T > Span
Alias for std::span
Definition Container.hpp:62
Low-level Rendering Hardware Interface (RHI) abstractions.
Definition Application.hpp:3
RHIDeviceHeapType
Definition Common.hpp:212
uintptr_t Handle
Definition Details.hpp:9
RHIDeviceType
Definition Common.hpp:164
RHIDeviceQueueType
Definition Common.hpp:179
RHIDescriptorType
Definition Common.hpp:255
RHISwapchainResult
Definition Swapchain.hpp:9
Definition Resource.hpp:28
bool meshShaders
Definition Device.hpp:194
size_t maxStorageBufferRange
Definition Device.hpp:203
bool dedicatedCompute
Definition Device.hpp:191
bool deviceLocalHostVisibleBuffers
Definition Device.hpp:199
bool timestampQueries
Definition Device.hpp:197
bool raytracingInline
Definition Device.hpp:195
bool dedicatedTransfer
Definition Device.hpp:192
bool raytracingPipeline
Definition Device.hpp:196
bool shaderExecutionReordering
Definition Device.hpp:193
size_t deviceLocalHostVisibleHeapSize
Definition Device.hpp:202
bool integratedGPU
Definition Device.hpp:198
RHIDescriptorType type
Definition Device.hpp:82
RHIShaderStage stage
Definition Device.hpp:81
Span< const Binding > bindings
Definition Device.hpp:85
bool updateAfterBind
Definition Device.hpp:88
RAII guard to wait for device idle on destruction.
Definition Device.hpp:378
~RHIDeviceIdleGuard()
Definition Device.hpp:387
void WaitIdle() const
Definition Device.hpp:382
RHIDeviceIdleGuard(RHIDevice const *device)
Definition Device.hpp:381
RHIDevice const * mDevice
Definition Device.hpp:379
size_t heapSize
Definition Device.hpp:209
uint32_t heapIndex
Definition Device.hpp:207
bool deviceLocal
Definition Device.hpp:208
size_t blockBytes
Definition Device.hpp:214
size_t usage
Definition Device.hpp:210
uint32_t blockCount
Definition Device.hpp:212
size_t allocationBytes
Definition Device.hpp:215
uint32_t allocationCount
Definition Device.hpp:213
size_t budget
Definition Device.hpp:211
Definition Device.hpp:238
Vector< RHIDeviceMemoryTypeStat > memoryTypes
Definition Device.hpp:240
Vector< RHIDeviceMemoryHeapStat > heaps
Definition Device.hpp:239
RHIDeviceMemoryStats(Allocator *allocator)
Definition Device.hpp:243
RHIDeviceMemoryTypeStat total
Definition Device.hpp:241
uint32_t unusedRangeCount
Definition Device.hpp:229
size_t unusedRangeSizeMax
Definition Device.hpp:235
uint32_t allocationCount
Definition Device.hpp:228
bool protectedMemory
Definition Device.hpp:226
bool hostCached
Definition Device.hpp:224
bool hostCoherent
Definition Device.hpp:223
size_t blockBytes
Definition Device.hpp:230
size_t unusedRangeSizeMin
Definition Device.hpp:234
size_t allocationSizeMin
Definition Device.hpp:232
uint32_t blockCount
Definition Device.hpp:227
bool hostVisible
Definition Device.hpp:222
size_t allocationSizeMax
Definition Device.hpp:233
bool deviceLocal
Definition Device.hpp:221
bool lazilyAllocated
Definition Device.hpp:225
uint32_t heapIndex
Definition Device.hpp:220
uint32_t typeIndex
Definition Device.hpp:219
size_t allocationBytes
Definition Device.hpp:231
uint32_t count
Definition Device.hpp:177
@ AccelerationStructureCompactedSize
Definition Device.hpp:175
enum Foundation::RHI::RHIDeviceQueryPool::QueryPoolDesc::QueryType type
RHISwapchain * swapchain
Definition Device.hpp:46
Span< RHIDeviceSemaphore *const > waits
Definition Device.hpp:48
uint32_t imageIndex
Definition Device.hpp:45
Span< RHICommandList *const > cmdLists
Definition Device.hpp:39
Span< RHIDeviceSemaphore *const > signals
Definition Device.hpp:37
Span< const TimelinePair > timelineSignals
Definition Device.hpp:31
Span< RHIDeviceSemaphore *const > waits
Definition Device.hpp:33
Span< const TimelinePair > timelineWaits
Definition Device.hpp:29
Span< const RHIPipelineStage > waitsStages
Definition Device.hpp:35
enum Foundation::RHI::RHIDeviceSampler::SamplerDesc::AddressMode::Mode Repeat
enum Foundation::RHI::RHIDeviceSampler::SamplerDesc::Filter::Type Linear
enum Foundation::RHI::RHIDeviceSampler::SamplerDesc::Mipmap::MipmapMode Linear
struct Foundation::RHI::RHIDeviceSampler::SamplerDesc::LOD lod
struct Foundation::RHI::RHIDeviceSampler::SamplerDesc::Mipmap mipmap
struct Foundation::RHI::RHIDeviceSampler::SamplerDesc::Anisotropy anisotropy
struct Foundation::RHI::RHIDeviceSampler::SamplerDesc::AddressMode addressMode
enum Foundation::RHI::RHIDeviceSampler::SamplerDesc::Reduction WeightedAverage
struct Foundation::RHI::RHIDeviceSampler::SamplerDesc::Filter filter
String name
Definition Device.hpp:251
RHIDeviceType type
Definition Device.hpp:252
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:500
static RHIAccelerationStructure * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:496
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:440
static RHIBuffer * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:439
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:422
static RHICommandPool * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:421
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:464
static RHIDeviceDescriptorPool * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:460
static RHIDeviceDescriptorSetLayout * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:451
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:455
static RHIDeviceFence * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:433
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:434
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:491
static RHIDeviceQueryPool * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:490
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:470
static RHIDeviceSampler * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:469
static RHIDeviceSemaphore * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:427
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:428
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:479
static RHIPipelineStateCache * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:475
static RHIPipelineState * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:406
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:410
static RHIShaderModule * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:415
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:416
static RHISurface * Get(const RHIDevice *device, Handle handle)
Definition Device.hpp:393
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:394
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:401
static RHISwapchain * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:400
static RHITexture * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:445
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:446
static RHIVirtualAllocator * Get(RHIDevice const *device, Handle handle)
Definition Device.hpp:484
static void Destroy(RHIDevice *device, Handle handle)
Definition Device.hpp:485
Provides type traits for types derived from RHIObject.
Definition Details.hpp:31
Definition PipelineState.hpp:18
Definition Resource.hpp:142