Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
DeviceSelection.cpp File Reference
#include "precompiled.h"
#include "DeviceSelection.h"
#include "lib/code_annotation.h"
#include "lib/config2.h"
#include "renderer/backend/vulkan/Device.h"
#include "renderer/backend/vulkan/Utilities.h"
#include "scriptinterface/JSON.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptInterface.h"
#include "scriptinterface/ScriptRequest.h"
#include <algorithm>
#include <limits>
#include <string>
#include <type_traits>
#include <vector>
Include dependency graph for DeviceSelection.cpp:

Classes

struct  Renderer::Backend::Vulkan::anonymous_namespace{DeviceSelection.cpp}::ReportFormatHelper< T, Tag >
 
struct  Renderer::Backend::Vulkan::anonymous_namespace{DeviceSelection.cpp}::ReportFormatHelper< T, typename std::enable_if_t< std::is_floating_point_v< T > > >
 
struct  Renderer::Backend::Vulkan::anonymous_namespace{DeviceSelection.cpp}::ReportFormatHelper< T, typename std::enable_if_t< std::is_integral_v< T > > >
 
struct  Renderer::Backend::Vulkan::anonymous_namespace{DeviceSelection.cpp}::ReportFormatHelper< T, typename std::enable_if_t< std::is_enum_v< T > > >
 
struct  Renderer::Backend::Vulkan::anonymous_namespace{DeviceSelection.cpp}::ReportFormatHelper< T, typename std::enable_if_t< std::is_array_v< T > > >
 

Namespaces

namespace  Renderer
 
namespace  Renderer::Backend
 
namespace  Renderer::Backend::Vulkan
 
namespace  Renderer::Backend::Vulkan::anonymous_namespace{DeviceSelection.cpp}
 

Macros

#define REPORT_LIMITS_CONSTANT(NAME)
 
#define REPORT_DESCRIPTOR_INDEXING_CONSTANT(NAME)
 
#define REPORT_FEATURE(NAME)    Script::SetProperty(rq, features, #NAME, static_cast<bool>(device.features.NAME));
 
#define REPORT_DESCRIPTOR_INDEXING_FEATURE(NAME)    Script::SetProperty(rq, features, #NAME, static_cast<bool>(device.descriptorIndexingFeatures.NAME));
 
#define REPORT_SURFACE_CAPABILITIES_CONSTANT(NAME)
 

Functions

std::vector< std::string > Renderer::Backend::Vulkan::anonymous_namespace{DeviceSelection.cpp}::GetPhysicalDeviceExtensions (VkPhysicalDevice device)
 
uint32_t Renderer::Backend::Vulkan::anonymous_namespace{DeviceSelection.cpp}::GetDeviceTypeScore (const VkPhysicalDeviceType deviceType)
 
VkDeviceSize Renderer::Backend::Vulkan::anonymous_namespace{DeviceSelection.cpp}::GetDeviceTotalMemory (const VkPhysicalDeviceMemoryProperties &memoryProperties)
 
VkDeviceSize Renderer::Backend::Vulkan::anonymous_namespace{DeviceSelection.cpp}::GetHostTotalMemory (const VkPhysicalDeviceMemoryProperties &memoryProperties)
 
SAvailablePhysicalDevice Renderer::Backend::Vulkan::anonymous_namespace{DeviceSelection.cpp}::MakeAvailablePhysicalDevice (const uint32_t physicalDeviceIndex, VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, const std::vector< const char * > &requiredDeviceExtensions)
 
std::vector< SAvailablePhysicalDevice > Renderer::Backend::Vulkan::GetAvailablePhysicalDevices (VkInstance instance, VkSurfaceKHR surface, const std::vector< const char * > &requiredDeviceExtensions)
 
bool Renderer::Backend::Vulkan::IsPhysicalDeviceUnsupported (const SAvailablePhysicalDevice &device)
 
bool Renderer::Backend::Vulkan::ComparePhysicalDevices (const SAvailablePhysicalDevice &device1, const SAvailablePhysicalDevice &device2)
 
bool Renderer::Backend::Vulkan::IsSurfaceFormatSupported (const VkSurfaceFormatKHR &surfaceFormat)
 
void Renderer::Backend::Vulkan::ReportAvailablePhysicalDevice (const SAvailablePhysicalDevice &device, const ScriptRequest &rq, JS::HandleValue settings)
 Report all desired information about the available physical device. More...
 

Macro Definition Documentation

◆ REPORT_DESCRIPTOR_INDEXING_CONSTANT

#define REPORT_DESCRIPTOR_INDEXING_CONSTANT (   NAME)
Value:
do \
{ \
const ReportFormatHelper<decltype(device.descriptorIndexingProperties.NAME)> helper{}; \
Script::SetProperty(rq, descriptorIndexingConstants, #NAME, helper(device.descriptorIndexingProperties.NAME)); \
} while (0)
bool SetProperty(const ScriptRequest &rq, JS::HandleValue obj, PropType name, JS::HandleValue value, bool constant=false, bool enumerable=true)
Set the named property on the given object.
Definition: Object.h:98

◆ REPORT_DESCRIPTOR_INDEXING_FEATURE

#define REPORT_DESCRIPTOR_INDEXING_FEATURE (   NAME)     Script::SetProperty(rq, features, #NAME, static_cast<bool>(device.descriptorIndexingFeatures.NAME));

◆ REPORT_FEATURE

#define REPORT_FEATURE (   NAME)     Script::SetProperty(rq, features, #NAME, static_cast<bool>(device.features.NAME));

◆ REPORT_LIMITS_CONSTANT

#define REPORT_LIMITS_CONSTANT (   NAME)
Value:
do \
{ \
const ReportFormatHelper<decltype(device.properties.limits.NAME)> helper{}; \
Script::SetProperty(rq, limitsConstants, #NAME, helper(device.properties.limits.NAME)); \
} while (0)

◆ REPORT_SURFACE_CAPABILITIES_CONSTANT

#define REPORT_SURFACE_CAPABILITIES_CONSTANT (   NAME)
Value:
do \
{ \
const ReportFormatHelper<decltype(device.surfaceCapabilities.NAME)> helper{}; \
Script::SetProperty(rq, surfaceCapabilities, #NAME, helper(device.surfaceCapabilities.NAME)); \
} while (0)