Fix device group rendering CTS crash
authorRicardo Garcia <rgarcia@igalia.com>
Wed, 25 Sep 2019 09:51:47 +0000 (11:51 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Mon, 2 Dec 2019 10:40:15 +0000 (05:40 -0500)
commit25464dd9355a8d9da958d346ade296f4822430cc
tree4f02d4c53d37f893f2d8e79b8b2bcb476095837c
parent2c7c23eee23c988694761a237c83334acd226fa8
Fix device group rendering CTS crash

dEQP-VK.device_group.* tests use --deqp-vk-device-group-id as the group
id to use and --deqp-vk-device-id as the index for the physical device
to use from that group when creating the logical device.

--deqp-vk-device-id is checked by the program, in general, to be valid
regarding the total number of physical devices in the system, but these
tests were not verifying it to be valid regarding the selected group.

In a machine with two devices in two separate groups (one device per
group), the program would accept the following options as valid, only to
segfault later:

  $ deqp-vk --deqp-vk-device-group-id=1 --deqp-vk-device-id=2 ...

  or

  $ deqp-vk --deqp-vk-device-group-id=2 --deqp-vk-device-id=2 ...

This commit checks the provided device id is valid for the selected
group.

Affected tests:
dEQP-VK.device_group.*

Components: Vulkan
VK-GL-CTS issue: 1553

Change-Id: Ied8f2fb73384303b793258cbaeaa7fad503a03c1
external/vulkancts/modules/vulkan/device_group/vktDeviceGroupRendering.cpp