[Vulkan] Handle unsupported fillModeNonSolid + fix portability subset feature checks
This commit is contained in:
parent
d30d59883a
commit
d8b2944caa
|
@ -525,6 +525,7 @@ bool VulkanPipelineCache::GetCurrentStateDescription(
|
||||||
bool cull_back = pa_su_sc_mode_cntl.cull_back;
|
bool cull_back = pa_su_sc_mode_cntl.cull_back;
|
||||||
description_out.cull_front = cull_front;
|
description_out.cull_front = cull_front;
|
||||||
description_out.cull_back = cull_back;
|
description_out.cull_back = cull_back;
|
||||||
|
if (device_features.fillModeNonSolid) {
|
||||||
xenos::PolygonType polygon_type = xenos::PolygonType::kTriangles;
|
xenos::PolygonType polygon_type = xenos::PolygonType::kTriangles;
|
||||||
if (!cull_front) {
|
if (!cull_front) {
|
||||||
polygon_type =
|
polygon_type =
|
||||||
|
@ -557,6 +558,9 @@ bool VulkanPipelineCache::GetCurrentStateDescription(
|
||||||
assert_unhandled_case(polygon_type);
|
assert_unhandled_case(polygon_type);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
description_out.polygon_mode = PipelinePolygonMode::kFill;
|
||||||
|
}
|
||||||
description_out.front_face_clockwise = pa_su_sc_mode_cntl.face != 0;
|
description_out.front_face_clockwise = pa_su_sc_mode_cntl.face != 0;
|
||||||
} else {
|
} else {
|
||||||
description_out.polygon_mode = PipelinePolygonMode::kFill;
|
description_out.polygon_mode = PipelinePolygonMode::kFill;
|
||||||
|
@ -701,7 +705,6 @@ bool VulkanPipelineCache::ArePipelineRequirementsMet(
|
||||||
|
|
||||||
const ui::vulkan::VulkanProvider& provider =
|
const ui::vulkan::VulkanProvider& provider =
|
||||||
command_processor_.GetVulkanProvider();
|
command_processor_.GetVulkanProvider();
|
||||||
const VkPhysicalDeviceFeatures& device_features = provider.device_features();
|
|
||||||
|
|
||||||
const VkPhysicalDevicePortabilitySubsetFeaturesKHR*
|
const VkPhysicalDevicePortabilitySubsetFeaturesKHR*
|
||||||
device_portability_subset_features =
|
device_portability_subset_features =
|
||||||
|
@ -709,13 +712,15 @@ bool VulkanPipelineCache::ArePipelineRequirementsMet(
|
||||||
if (device_portability_subset_features) {
|
if (device_portability_subset_features) {
|
||||||
if (description.primitive_topology ==
|
if (description.primitive_topology ==
|
||||||
PipelinePrimitiveTopology::kTriangleFan &&
|
PipelinePrimitiveTopology::kTriangleFan &&
|
||||||
device_portability_subset_features->triangleFans) {
|
!device_portability_subset_features->triangleFans) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (description.polygon_mode == PipelinePolygonMode::kPoint &&
|
if (description.polygon_mode == PipelinePolygonMode::kPoint &&
|
||||||
device_portability_subset_features->pointPolygons) {
|
!device_portability_subset_features->pointPolygons) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!device_portability_subset_features->constantAlphaColorBlendFactors) {
|
if (!device_portability_subset_features->constantAlphaColorBlendFactors) {
|
||||||
uint32_t color_rts_remaining =
|
uint32_t color_rts_remaining =
|
||||||
description.render_pass_key.depth_and_color_used >> 1;
|
description.render_pass_key.depth_and_color_used >> 1;
|
||||||
|
@ -738,11 +743,18 @@ bool VulkanPipelineCache::ArePipelineRequirementsMet(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const VkPhysicalDeviceFeatures& device_features = provider.device_features();
|
||||||
|
|
||||||
if (!device_features.geometryShader &&
|
if (!device_features.geometryShader &&
|
||||||
description.geometry_shader != PipelineGeometryShader::kNone) {
|
description.geometry_shader != PipelineGeometryShader::kNone) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!device_features.fillModeNonSolid &&
|
||||||
|
description.polygon_mode != PipelinePolygonMode::kFill) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!device_features.independentBlend) {
|
if (!device_features.independentBlend) {
|
||||||
uint32_t color_rts_remaining =
|
uint32_t color_rts_remaining =
|
||||||
description.render_pass_key.depth_and_color_used >> 1;
|
description.render_pass_key.depth_and_color_used >> 1;
|
||||||
|
|
Loading…
Reference in New Issue