1{
2"$schema": "http://json-schema.org/draft-04/schema#",
3"id": "https://schema.khronos.org/vulkan/vkpcc.json#",
4"title": "JSON schema for Vulkan pipeline state",
5"description": "Schema for representing Vulkan pipeline state for use with the offline Pipeline Cache Compiler.",
6"type": "object",
7"additionalProperties": true,
8
9"definitions": {
10    "ShaderInfo" : {
11        "stage" : {"type": "string", "format": "uri"},
12        "filename" : {"type": "string", "format": "uri"}
13    },
14
15    "GraphicsPipelineState": {
16        "type": "object",
17        "additionalProperties": false,
18        "properties": {
19            "Renderpass": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkRenderPassCreateInfo"},
20            "Renderpass2": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkRenderPassCreateInfo2"},
21            "YcbcrSamplers": {"type": "array", "minItems": 0, "maxItems": 255, "items": {"type": "object", "patternProperties": {"^\\w+$": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkSamplerYcbcrConversionCreateInfo"}}}},
22            "ImmutableSamplers": {"type": "array", "minItems": 0, "maxItems": 255, "items": {"type": "object", "patternProperties": {"^\\w+$": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkSamplerCreateInfo"}}}},
23            "DescriptorSetLayouts": {"type": "array", "minItems": 0, "maxItems": 255, "items": {"type": "object", "patternProperties": {"^\\w+$": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkDescriptorSetLayoutCreateInfo"}}}},
24            "PipelineLayout": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkPipelineLayoutCreateInfo"},
25            "GraphicsPipeline": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkGraphicsPipelineCreateInfo"},
26            "ShaderFileNames": {"type": "array", "minItems": 0, "maxItems": 255, "items": {"$ref": "#/definitions/ShaderInfo"}},
27            "PhysicalDeviceFeatures": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkPhysicalDeviceFeatures2"}
28        },
29        "oneOf" : [{"required" : ["Renderpass"]}, {"required" : ["Renderpass2"]}],
30        "required" : ["PipelineLayout", "GraphicsPipeline", "ShaderFileNames"]
31    },
32
33    "ComputePipelineState": {
34        "type": "object",
35        "additionalProperties": false,
36        "properties": {
37            "YcbcrSamplers": {"type": "array", "minItems": 0, "maxItems": 255, "items": {"type": "object", "patternProperties": {"^\\w+$": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkSamplerYcbcrConversionCreateInfo"}}}},
38            "ImmutableSamplers": {"type": "array", "minItems": 0, "maxItems": 255, "items": {"type": "object", "patternProperties": {"^\\w+$": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkSamplerCreateInfo"}}}},
39            "DescriptorSetLayouts": {"type": "array", "minItems": 0, "maxItems": 255, "items": {"type": "object", "patternProperties": {"^\\w+$": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkDescriptorSetLayoutCreateInfo"}}}},
40            "PipelineLayout": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkPipelineLayoutCreateInfo"},
41            "ComputePipeline": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkComputePipelineCreateInfo"},
42            "ShaderFileNames": {"$ref": "#/definitions/ShaderInfo"},
43            "PhysicalDeviceFeatures": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/VkPhysicalDeviceFeatures2"}
44        },
45        "required" : ["PipelineLayout", "ComputePipeline", "ShaderFileNames"]
46    }
47},
48
49"properties": {
50    "GraphicsPipelineState"  : {"$ref": "#/definitions/GraphicsPipelineState"},
51    "ComputePipelineState"   : {"$ref": "#/definitions/ComputePipelineState"},
52    "PipelineUUID"           : {"type": "array", "minItems": 16, "maxItems": 16, "items": {"$ref": "https://schema.khronos.org/vulkan/vk.json#/definitions/uint8_t"}},
53    "DeviceExtensions"       : {"type": "array", "items": {"type": "string", "format": "uri"}}
54},
55
56"anyOf": [
57    {"required": ["GraphicsPipelineState"]},
58    {"required": ["ComputePipelineState"]}
59]
60}
61