Skip to content

Commit 4507898

Browse files
andyb-unityfredinfinite23
authored andcommitted
fix Godot typo
fix syntax and schema Removed color option as discussed and allowed multiple components to be listed
1 parent a692dcf commit 4507898

File tree

6 files changed

+21
-46
lines changed

6 files changed

+21
-46
lines changed

client_schema.json

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,6 @@
103103
"title": "Abbreviation shown in matrix",
104104
"type": "string"
105105
},
106-
"color": {
107-
"title": "Background color used in matrix",
108-
"type": "string",
109-
"enum": [
110-
"black",
111-
"white",
112-
"gray",
113-
"silver",
114-
"maroon",
115-
"red",
116-
"purple",
117-
"fushsia",
118-
"green",
119-
"lime",
120-
"olive",
121-
"yellow",
122-
"navy",
123-
"blue",
124-
"teal",
125-
"aqua"
126-
]
127-
},
128106
"extensions": {
129107
"title": "Supported extensions",
130108
"description": "A list of all supported extensions in this client, on this platform. Details or caveats may be included in 'notes'.",
@@ -137,7 +115,6 @@
137115
"required": [
138116
"name",
139117
"abbreviation",
140-
"color",
141118
"extensions"
142119
]
143120
},

clients/godot.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
"Linux (Desktop/Embedded)",
99
"Android (All-in-one)",
1010
"Android (Phone/Installable)",
11-
"MacOS (Desktop)"
11+
"macOS (Desktop)"
1212
],
1313
"components": [
1414
{
1515
"name": "Godot Core",
1616
"abbreviation": "Core",
17-
"color": "green",
1817
"extensions": [
1918
"XR_KHR_android_create_instance",
2019
"XR_KHR_android_surface_swapchain",
@@ -57,7 +56,6 @@
5756
{
5857
"name": "Godot Vendors plugin",
5958
"abbreviation": "Vendors",
60-
"color": "yellow",
6159
"extensions": [
6260
"XR_FB_body_tracking",
6361
"XR_FB_composition_layer_alpha_blend",

clients/unity.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"extensions": [
1616
"XR_KHR_android_create_instance",
1717
"XR_KHR_android_surface_swapchain",
18-
"XR_KHR_android_thread_settings"
18+
"XR_KHR_android_thread_settings",
1919
"XR_KHR_composition_layer_depth",
2020
"XR_KHR_D3D11_enable",
2121
"XR_KHR_D3D12_enable",

openxr_inventory/client_inventory.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class ComponentEntry:
2020
abbreviation: str
2121
"""The abbreviation to use in the client matrix"""
2222

23-
color: str
24-
"""The color to use in the client matrix"""
25-
2623
extensions: List[ExtensionEntry]
2724
"""The supported extensions"""
2825

@@ -32,7 +29,6 @@ def from_json(self, d: Dict) -> "ComponentEntry":
3229
return ComponentEntry(
3330
name=d["name"],
3431
abbreviation=d["abbreviation"],
35-
color=d["color"],
3632
extensions=exts
3733
)
3834

@@ -59,29 +55,27 @@ class ClientData:
5955
form_factors: List[FormFactorEntry]
6056
"""The supported form factors"""
6157

62-
def get_component_for_extension(self, ext_name: str) -> Optional[ComponentEntry]:
58+
def get_component_for_extension(self, ext_name: str) -> List[ComponentEntry]:
59+
component_entries = []
6360
for component in self.components:
6461
for entry in component.extensions:
6562
if entry.name == ext_name:
66-
return component
63+
component_entries += [ component ]
6764

68-
return None
65+
return component_entries
6966

70-
def get_extension_entry(self, ext_name: str) -> Optional[ExtensionEntry]:
67+
def get_extension_entry(self, ext_name: str) -> List[ExtensionEntry]:
7168
"""
72-
Get the entry for the named extension, if it exists.
69+
Get the entries for the named extension, if they exists.
7370
74-
This can tell you if the runtime supports that extension, as well as any notes from the inventory.
71+
This can tell you if the client supports that extension, as well as any notes from the inventory.
7572
"""
7673
extension_entries = []
7774

7875
for component in self.components:
7976
extension_entries += [ entry for entry in component.extensions if entry.name == ext_name ]
8077

81-
if not extension_entries:
82-
return
83-
assert len(extension_entries) == 1
84-
return extension_entries[0]
78+
return extension_entries
8579

8680
@property
8781
def conformance_submission_url(self) -> Optional[str]:

openxr_inventory/extensions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ def compute_extension_support(
201201

202202
# Get all the client support
203203
for client in clients:
204-
if client.get_extension_entry(extension_name):
205-
client_count += 1
204+
client_count += len(client.get_extension_entry(extension_name))
206205

207206
# Filter out the empty ones
208207
extension_support[extension_name] = ExtensionSupport(runtime_count, client_count)

openxr_inventory/templates/extension_support.jinja2.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,16 @@ <h2>Client support matrix</h2>
309309
</a>
310310
</th>
311311
{% for client in clients | sort %}
312-
{% set component = client.get_component_for_extension(extension_name) %}
313-
{% if component %}
314-
<td class="text-center bg-success" style="background-color:{{ component.color }}"><span><abbr title="{{component.name}}">{{ component.abbreviation }}</abbr></span></td>
312+
{% set components = client.get_component_for_extension(extension_name) %}
313+
{% if components|length > 0 %}
314+
<td class="text-center bg-success">
315+
{% for component in components %}
316+
<span><abbr title="{{component.name}}">{{ component.abbreviation }}</abbr></span>
317+
{% if not loop.last %}
318+
<br>
319+
{% endif %}
320+
{% endfor %}
321+
</td>
315322
{% else %}
316323
<td class="text-center"><span class="glyphicon glyphicon-minus" style="opacity:0.1"></span><span class="sr-only">Not supported or not applicable</span></td>
317324
{% endif %}

0 commit comments

Comments
 (0)