Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly propagate 'enabled_features' modifications #8001

Open
arno-lunarg opened this issue May 13, 2024 · 2 comments
Open

Correctly propagate 'enabled_features' modifications #8001

arno-lunarg opened this issue May 13, 2024 · 2 comments
Assignees
Labels
Enhancement New feature or request GPU-AV GPU Assisted Validation

Comments

@arno-lunarg
Copy link
Contributor

arno-lunarg commented May 13, 2024

Setting enabled_features.bufferDeviceAddress to true in GpuShaderInstrumentor::PreCallRecordCreateDevice
when adding missing features will modify another validator object, one associated to VkInstance,
gpuav::Validator is associated to a device. enabled_features is not inherited, (and besides
would be reset in GetEnabledDeviceFeatures). So for instance, looking at enabled_features.bufferDeviceAddress in gpuav::Validator::GetBufferDeviceAddress will not show the value updated in GpuShaderInstrumentor::PreCallRecordCreateDevice.

Note: The switch from the instance validator object to the device one happens in state_tracker.cpp, ValidationStateTracker::PostCallRecordCreateDevice

@arno-lunarg arno-lunarg added Enhancement New feature or request GPU-AV GPU Assisted Validation labels May 13, 2024
@arno-lunarg arno-lunarg removed their assignment May 13, 2024
@spencer-lunarg
Copy link
Contributor

so I don't get the problem here fully

yes, there are currently two DeviceFeatures enabled_features, one for the Instance level and one for Device level, but the Instance Level one should never matter for GPU-AV

I think the only call that we use as an instance level is PostCallRecordGetPhysicalDeviceProperties and it doesn't care about the enabled_features there


So the flow should be

  • We call GetEnabledDeviceFeatures() which sets it
  • We check if not enabled, and set it to true and enable it
  • It is marked as true everywhere as expected

@arno-lunarg
Copy link
Contributor Author

arno-lunarg commented May 13, 2024

I updated the issue. Not sure about how to fix this. It looks like modifying enabled_features in GpuShaderInstrumentor::PreCallRecordCreateDevice is a hack, I do not want to go down that route.
I would have expected modifications made to modified_create_info to be propagated correctly and used in GetEnabledDeviceFeatures but it is not the case. See CreateDevice in chassis, and how modified_create_info is used.
The unmodified device create info ends up being up for this function. I think that using the modified one here should be the fix, but I am unsure about other implications of such a change...

I think the features we enforce in GPU-AV are correctly enabled on the device, it is just a matter of toggling the corresponding flags in state tracking

@spencer-lunarg spencer-lunarg self-assigned this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request GPU-AV GPU Assisted Validation
Projects
None yet
Development

No branches or pull requests

2 participants