Significantly reduce duplicate layer scanning code
authorCharles Giessen <charles@lunarg.com>
Sat, 6 May 2023 04:45:19 +0000 (22:45 -0600)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Mon, 29 May 2023 23:45:08 +0000 (17:45 -0600)
commitfe73c418743e158febe3c838a45dd7b1563b609f
tree3bcd094fce8068cb9f636138bc994bcb51258e25
parentc145941e6dc48ef519c3ff1e4ddaa5932dd68fd2
Significantly reduce duplicate layer scanning code

The layer scan functions had a pattern of calling loader_get_data_files,
parse the json found, and put the resulting parsed loader_layer_properties
into the output instance_layers list. This pattern was done twice in each
layer scan function, so in total 4 times. Thus, it was ripe for pulling the
common code into a new function, loader_parse_instance_layers().

The one bit of logic not shared between the two paths is whether or not the
layers being scanned are implicit or explicit. This is made easy by the fact
that the manifest_type dictates whether to parse the scanned manifests as
implicit or explicit layers.

Also, the code to get the override path was identical - but was copy pasted.
Moving it into a separate function cleans up the functions quite
siginificantly.
loader/loader.c