google/filament

VulkanDriver always reports FEATURE_LEVEL_1

Opened this issue · 2 comments

Describe the bug

I'm running some code which uses filament with a vulkan backend on a NVIDIA GeForce RTX 2080 Ti, with debug output enabled, and see log lines like:

Backend feature level: 1
FEngine feature level: 1

This is surprising, given how recent the GPU is.

Looking at the source code for VulkanDriver::getFeatureLevel, it appears that if the driver has a very large maxPerStageDescriptorSamplers, it will get FeatureLevel::FEATURE_LEVEL_1, which doesn't sound right.

This logic was inverted in commit 8cdac43. Before that commit, the logic was:

    if (imageCubeArray) {
        if (supportedSamplerCount >= 31) {
            return FeatureLevel::FEATURE_LEVEL_3;
        }
        return FeatureLevel::FEATURE_LEVEL_2;
    }
    return FeatureLevel::FEATURE_LEVEL_1;

i.e.: if maxPerStageDescriptorSamplers is big, you get FEATURE_LEVEL_3.

Was the change intentional?

Steps to reproduce

Try to instantiate an engine like:

filament::Engine* engine =
      filament::Engine::Builder()
          .backend(filament::Engine::Backend::VULKAN)
          .featureLevel(filament::Engine::FeatureLevel::FEATURE_LEVEL_3)
          .build();

Expected behavior

On a powerful enough GPU, I would expect the logs to say

Backend feature level: 3
FEngine feature level: 3

Logs

WARNING: Using soft CircularBuffer (6144 KiB)
FEngine (64 bits) created at 0x556fbe5a4750 (threading is enabled)
FEngine resolved backend: Vulkan
Vulkan device driver: NVIDIA 525.147.05
Selected physical device 'NVIDIA GeForce RTX 2080 Ti' from 2 physical devices. (vendor 0x10de, device 0x1e04, driver 0x8364c140, api 1.3)
Backend feature level: 1
FEngine feature level: 1

Desktop (please complete the following information):

  • OS: Linux
  • GPU: NVIDIA GeForce RTX 2080 Ti
  • Backend: Vulkan

Additional context

I'm working in the Google codebase. I haven't tried compiling externally.

I think the inversion of the conditional is unintentional. I'll make a change. Thank you for pointing it out!

Has this change been merged?