comp: avoid an unnecessary struct copy for print modes

This commit is contained in:
Christoph Haag 2022-01-12 21:57:18 +01:00
parent 3dfec5f1ab
commit d36123927d

View file

@ -62,10 +62,10 @@ print_modes(struct comp_target *ct, VkDisplayModePropertiesKHR *mode_properties,
{
COMP_PRINT_MODE(ct->c, "Available Vk modes for direct mode");
for (int i = 0; i < mode_count; i++) {
VkDisplayModePropertiesKHR props = mode_properties[i];
uint16_t width = props.parameters.visibleRegion.width;
uint16_t height = props.parameters.visibleRegion.height;
float refresh = (float)props.parameters.refreshRate / 1000.f;
VkDisplayModePropertiesKHR *props = &mode_properties[i];
uint16_t width = props->parameters.visibleRegion.width;
uint16_t height = props->parameters.visibleRegion.height;
float refresh = (float)props->parameters.refreshRate / 1000.f;
COMP_PRINT_MODE(ct->c, "| %2d | %dx%d@%.2f", i, width, height, refresh);
}