Add shader draw parameters detection
This commit is contained in:
parent
86c349e5f2
commit
421293b8e9
@ -34,6 +34,8 @@ bool supportsMultiDrawIndirect();
|
|||||||
bool supportsBaseVertexRendering();
|
bool supportsBaseVertexRendering();
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool supportsComputeInMainQueue();
|
bool supportsComputeInMainQueue();
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
bool supportsShaderDrawParameters();
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool supportsS3TCBC3();
|
bool supportsS3TCBC3();
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@ -28,6 +28,7 @@ uint32_t g_max_sampler_supported = 0;
|
|||||||
bool g_supports_multi_draw_indirect = false;
|
bool g_supports_multi_draw_indirect = false;
|
||||||
bool g_supports_base_vertex_rendering = true;
|
bool g_supports_base_vertex_rendering = true;
|
||||||
bool g_supports_compute_in_main_queue = false;
|
bool g_supports_compute_in_main_queue = false;
|
||||||
|
bool g_supports_shader_draw_parameters = false;
|
||||||
bool g_supports_s3tc_bc3 = false;
|
bool g_supports_s3tc_bc3 = false;
|
||||||
bool g_supports_bptc_bc7 = false;
|
bool g_supports_bptc_bc7 = false;
|
||||||
bool g_supports_astc_4x4 = false;
|
bool g_supports_astc_4x4 = false;
|
||||||
@ -127,6 +128,11 @@ void GEVulkanFeatures::init(GEVulkanDriver* vk)
|
|||||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES;
|
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES;
|
||||||
supported_features.pNext = &descriptor_indexing_features;
|
supported_features.pNext = &descriptor_indexing_features;
|
||||||
|
|
||||||
|
VkPhysicalDeviceShaderDrawParametersFeatures shader_draw = {};
|
||||||
|
shader_draw.sType =
|
||||||
|
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES;
|
||||||
|
descriptor_indexing_features.pNext = &shader_draw;
|
||||||
|
|
||||||
PFN_vkGetPhysicalDeviceFeatures2 get_features = vkGetPhysicalDeviceFeatures2;
|
PFN_vkGetPhysicalDeviceFeatures2 get_features = vkGetPhysicalDeviceFeatures2;
|
||||||
if (vk->getPhysicalDeviceProperties().apiVersion < VK_API_VERSION_1_1 ||
|
if (vk->getPhysicalDeviceProperties().apiVersion < VK_API_VERSION_1_1 ||
|
||||||
!get_features)
|
!get_features)
|
||||||
@ -145,6 +151,8 @@ void GEVulkanFeatures::init(GEVulkanDriver* vk)
|
|||||||
.shaderSampledImageArrayNonUniformIndexing == VK_TRUE);
|
.shaderSampledImageArrayNonUniformIndexing == VK_TRUE);
|
||||||
g_supports_partially_bound = (descriptor_indexing_features
|
g_supports_partially_bound = (descriptor_indexing_features
|
||||||
.descriptorBindingPartiallyBound == VK_TRUE);
|
.descriptorBindingPartiallyBound == VK_TRUE);
|
||||||
|
g_supports_shader_draw_parameters = (shader_draw
|
||||||
|
.shaderDrawParameters == VK_TRUE);
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
bool missing_vkGetPhysicalDeviceProperties2 =
|
bool missing_vkGetPhysicalDeviceProperties2 =
|
||||||
@ -212,6 +220,9 @@ void GEVulkanFeatures::printStats()
|
|||||||
os::Printer::log(
|
os::Printer::log(
|
||||||
"Vulkan supports compute in main queue",
|
"Vulkan supports compute in main queue",
|
||||||
g_supports_compute_in_main_queue ? "true" : "false");
|
g_supports_compute_in_main_queue ? "true" : "false");
|
||||||
|
os::Printer::log(
|
||||||
|
"Vulkan supports shader draw parameters",
|
||||||
|
g_supports_shader_draw_parameters ? "true" : "false");
|
||||||
os::Printer::log(
|
os::Printer::log(
|
||||||
"Vulkan supports s3 texture compression (bc3, dxt5)",
|
"Vulkan supports s3 texture compression (bc3, dxt5)",
|
||||||
g_supports_s3tc_bc3 ? "true" : "false");
|
g_supports_s3tc_bc3 ? "true" : "false");
|
||||||
@ -300,6 +311,12 @@ bool GEVulkanFeatures::supportsComputeInMainQueue()
|
|||||||
return g_supports_compute_in_main_queue;
|
return g_supports_compute_in_main_queue;
|
||||||
} // supportsComputeInMainQueue
|
} // supportsComputeInMainQueue
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
bool GEVulkanFeatures::supportsShaderDrawParameters()
|
||||||
|
{
|
||||||
|
return g_supports_shader_draw_parameters;
|
||||||
|
} // supportsShaderDrawParameters
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool GEVulkanFeatures::supportsS3TCBC3()
|
bool GEVulkanFeatures::supportsS3TCBC3()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user