Vulkan: Block geometry shaders on older Mali.

They're too slow to be usable.
This commit is contained in:
Unknown W. Brackets 2022-10-02 07:32:31 -07:00
parent 36eb0d9ad5
commit 8df956b036
3 changed files with 9 additions and 1 deletions

View File

@ -846,6 +846,11 @@ VKContext::VKContext(VulkanContext *vulkan)
if (majorVersion >= 32) {
bugs_.Infest(Bugs::MALI_CONSTANT_LOAD_BUG); // See issue #15661
}
// Older ARM devices have very slow geometry shaders, not worth using. At least before 15.
if (majorVersion <= 15) {
bugs_.Infest(Bugs::GEOMETRY_SHADERS_SLOW);
}
}
// Limited, through input attachments and self-dependencies.

View File

@ -333,11 +333,14 @@ public:
RASPBERRY_SHADER_COMP_HANG = 8,
MALI_CONSTANT_LOAD_BUG = 9,
SUBPASS_FEEDBACK_BROKEN = 10,
GEOMETRY_SHADERS_SLOW = 11,
MAX_BUG,
};
protected:
uint32_t flags_ = 0;
static_assert(sizeof(flags_) * 8 > MAX_BUG, "Ran out of space for bugs.");
};
class RefCountedObject {

View File

@ -233,7 +233,7 @@ u32 GPU_Vulkan::CheckGPUFeatures() const {
}
// Fall back to geometry shader culling if we can't do vertex range culling.
if (enabledFeatures.geometryShader) {
if (enabledFeatures.geometryShader && !draw_->GetBugs().Has(Draw::Bugs::GEOMETRY_SHADERS_SLOW)) {
const bool vertexSupported = draw_->GetDeviceCaps().clipDistanceSupported && draw_->GetDeviceCaps().cullDistanceSupported;
if (!vertexSupported || (features & GPU_SUPPORTS_VS_RANGE_CULLING) == 0) {
// Switch to culling via the geometry shader if not fully supported in vertex.