[vulkan] Extending conversative rasterization detection and handling
This commit is contained in:
parent
6408867c6c
commit
7fdbc33aaf
|
|
@ -732,11 +732,21 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) {
|
|||
.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT,
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
.conservativeRasterizationMode = key.state.conservative_raster_enable != 0
|
||||
? VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT
|
||||
: VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT,
|
||||
.conservativeRasterizationMode = VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT,
|
||||
.extraPrimitiveOverestimationSize = 0.0f,
|
||||
};
|
||||
const bool conservative_requested = key.state.conservative_raster_enable != 0;
|
||||
if (conservative_requested) {
|
||||
const bool is_point_topology = input_assembly_topology == VK_PRIMITIVE_TOPOLOGY_POINT_LIST;
|
||||
const bool is_line_topology = IsLine(input_assembly_topology);
|
||||
const bool needs_point_or_line_support = is_point_topology || is_line_topology;
|
||||
const bool supports_requested_topology =
|
||||
!needs_point_or_line_support || device.SupportsConservativePointAndLineRasterization();
|
||||
|
||||
conservative_raster.conservativeRasterizationMode =
|
||||
supports_requested_topology ? VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT
|
||||
: VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT;
|
||||
}
|
||||
const bool preserve_provoking_vertex_for_xfb =
|
||||
!key.state.xfb_enabled || device.IsTransformFeedbackProvokingVertexPreserved();
|
||||
const bool use_last_provoking_vertex =
|
||||
|
|
|
|||
|
|
@ -1068,6 +1068,11 @@ bool Device::GetSuitability(bool requires_swapchain) {
|
|||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR;
|
||||
SetNext(next, properties.push_descriptor);
|
||||
}
|
||||
if (extensions.conservative_rasterization) {
|
||||
properties.conservative_rasterization.sType =
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT;
|
||||
SetNext(next, properties.conservative_rasterization);
|
||||
}
|
||||
if (extensions.subgroup_size_control || features.subgroup_size_control.subgroupSizeControl) {
|
||||
properties.subgroup_size_control.sType =
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES;
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ public:
|
|||
return extensions.viewport_array2;
|
||||
}
|
||||
|
||||
/// Returns true if the device supporst VK_EXT_DESCRIPTOR_INDEXING
|
||||
/// Returns true if the device supporst VK_EXT_DESCRIPTOR_INDEXING.
|
||||
bool isExtDescriptorIndexingSupported() const {
|
||||
return extensions.descriptor_indexing;
|
||||
}
|
||||
|
|
@ -615,12 +615,12 @@ public:
|
|||
return features.format_a4b4g4r4.formatA4B4G4R4;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_EXT_filter_cubic
|
||||
/// Returns true if the device supports VK_EXT_filter_cubic.
|
||||
bool IsExtFilterCubicSupported() const {
|
||||
return extensions.filter_cubic;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_QCOM_filter_cubic_weights
|
||||
/// Returns true if the device supports VK_QCOM_filter_cubic_weights.
|
||||
bool IsQcomFilterCubicWeightsSupported() const {
|
||||
return extensions.filter_cubic_weights;
|
||||
}
|
||||
|
|
@ -647,7 +647,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
/// Returns true if the device supports VK_EXT_shader_demote_to_helper_invocation
|
||||
/// Returns true if the device supports VK_EXT_shader_demote_to_helper_invocation.
|
||||
bool IsExtShaderDemoteToHelperInvocationSupported() const {
|
||||
return extensions.shader_demote_to_helper_invocation;
|
||||
}
|
||||
|
|
@ -656,6 +656,12 @@ public:
|
|||
bool IsExtConservativeRasterizationSupported() const {
|
||||
return extensions.conservative_rasterization;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports conservative rasterization for points and lines.
|
||||
bool SupportsConservativePointAndLineRasterization() const {
|
||||
return extensions.conservative_rasterization &&
|
||||
properties.conservative_rasterization.conservativePointAndLineRasterization;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_EXT_provoking_vertex.
|
||||
bool IsExtProvokingVertexSupported() const {
|
||||
|
|
@ -667,7 +673,8 @@ public:
|
|||
return extensions.shader_atomic_int64;
|
||||
}
|
||||
|
||||
bool IsExtConditionalRendering() const {
|
||||
/// Returns true if the device supports VK_EXT_conditional_rendering.
|
||||
bool IsExtConditionalRenderingSupported() const {
|
||||
return extensions.conditional_rendering;
|
||||
}
|
||||
|
||||
|
|
@ -965,6 +972,7 @@ private:
|
|||
VkPhysicalDeviceSubgroupProperties subgroup_properties{};
|
||||
VkPhysicalDeviceFloatControlsProperties float_controls{};
|
||||
VkPhysicalDevicePushDescriptorPropertiesKHR push_descriptor{};
|
||||
VkPhysicalDeviceConservativeRasterizationPropertiesEXT conservative_rasterization{};
|
||||
VkPhysicalDeviceSubgroupSizeControlProperties subgroup_size_control{};
|
||||
VkPhysicalDeviceTransformFeedbackPropertiesEXT transform_feedback{};
|
||||
VkPhysicalDeviceMaintenance5PropertiesKHR maintenance5{};
|
||||
|
|
|
|||
Loading…
Reference in New Issue