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

[WIP] schema: refactoring to improve checking #172

Closed
wants to merge 1 commit into from

Conversation

christophe-lunarg
Copy link
Collaborator

@christophe-lunarg christophe-lunarg commented Mar 22, 2022

Done:

  • This refactoring allows not defining a structure without the version or extension related to this structure.
  • Add VK_KHR_surface query, this would not be taken into account by the API library but could be implemented by the layer (I think)

TODO:

  • Investigating whether we can prevent using an extension when requiring a version which made this extension a core capability.
  • Handling partial vs full profiles

@ci-tester-lunarg
Copy link
Collaborator

CI VulkanProfiles build # 1671 running.

@ci-tester-lunarg
Copy link
Collaborator

CI VulkanProfiles build # 1671 failed.

@christophe-lunarg
Copy link
Collaborator Author

christophe-lunarg commented Mar 22, 2022

  • Add extensions and version requirements checking.
    • Eg: VK_KHR_device_group requires VK_KHR_device_group_creation

Schema Implementation:

{
	"type": "object",
	"additionalProperties": false,
	"properties": {
		"VK_KHR_device_group": {
			"type": "object"
		},
		"VK_KHR_device_group_creation": {
			"type": "object"
		}
	},
	"dependentRequired": {
		"VK_KHR_device_group": [ "VK_KHR_device_group_creation" ]
	}
}

JSON file example (if VK_KHR_device_group_creation is removed, then we get an error):

{
    "VK_KHR_device_group": {
      
    },
    "VK_KHR_device_group_creation": {
      
    }  
}

@christophe-lunarg christophe-lunarg changed the title schema: refactoring to improve checking [WIP] schema: refactoring to improve checking Mar 22, 2022
@christophe-lunarg
Copy link
Collaborator Author

christophe-lunarg commented Mar 22, 2022

We could implement exclusion of extension vs core version like this:
schema:

{
	"type": "object",
	"additionalProperties": {
		"type": "object",
		"oneOf": [
			{
				"additionalProperties": false,
				"properties": {
					"VK_VERSION_1_1": {
						"type": "object"
					}
				}
			},
			{
				"additionalProperties": false,
				"properties": {
					"VK_KHR_device_group": {
						"type": "object"
					},
					"VK_KHR_device_group_creation": {
						"type": "object"
					}
				},
				"dependentRequired": {
					"VK_KHR_device_group": [ "VK_KHR_device_group_creation" ]
				}
			}
		]
	}
}

JSON files (if VK_VERSION_1_1 is defined, we get errors):

{
	"baseline": {
		"VK_KHR_device_group": {

		},
		"VK_KHR_device_group_creation": {

		}
	}
}

This said, a device profiles will have both the core and the extension defined so we should somehow make this a mode.

Copy link
Contributor

@ziga-lunarg ziga-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. If I see this correctly this would also fix the problem where we had structs from extensions used, but the extension itself was not listed, correct?

@christophe-lunarg
Copy link
Collaborator Author

Looks good to me. If I see this correctly this would also fix the problem where we had structs from extensions used, but the extension itself was not listed, correct?

Yes, and ensure the extension dependencies are resolved.

@christophe-lunarg
Copy link
Collaborator Author

Similarly we could prevent a profile file to specify both the bundle and the core structure with oneOf.

@christophe-lunarg
Copy link
Collaborator Author

Moved to future version 2.0 issue: #310

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants