@@ -345,29 +345,20 @@ RID OpenXRRenderModelExtension::render_model_create(XrRenderModelIdEXT p_render_
345345 RenderModel render_model;
346346 render_model.xr_render_model_id = p_render_model_id;
347347
348- // Start with the extensions that are supported in our base (see GLTFDocument::_parse_gltf_extensions).
349- Vector<const char *> supported_gltf_extensions = {
350- " KHR_lights_punctual" ,
351- " KHR_materials_pbrSpecularGlossiness" ,
352- " KHR_texture_transform" ,
353- " KHR_materials_unlit" ,
354- " KHR_materials_emissive_strength" ,
355- };
356-
357- // Now find anything we support through plugins, which is a bit of a pain as they are converted to Strings
358- // and we need to convert them back.
359- Vector<CharString> char_extensions; // Just for temp storage of our c-strings.
360- Vector<Ref<GLTFDocumentExtension>> gltf_document_extensions = GLTFDocument::get_all_gltf_document_extensions ();
361- for (Ref<GLTFDocumentExtension> &gltf_document_extension : gltf_document_extensions) {
362- Vector<String> supported_extensions = gltf_document_extension->get_supported_extensions ();
363- for (const String &extension : supported_extensions) {
364- char_extensions.push_back (extension.utf8 ());
365- }
366- }
367-
368- // Now we can add them to our supported extensions list.
369- for (const CharString &cs : char_extensions) {
370- supported_gltf_extensions.push_back (cs.get_data ());
348+ // Get a list of supported glTF extensions.
349+ const HashSet<String> supported_gltf_extensions_hash_set = GLTFDocument::get_supported_gltf_extensions_hashset ();
350+ Vector<CharString> supported_gltf_extensions_char_string; // Just for temp storage of our c-strings.
351+ supported_gltf_extensions_char_string.resize (supported_gltf_extensions_hash_set.size ());
352+ int64_t supported_gltf_extension_index = 0 ;
353+ for (const String &ext : supported_gltf_extensions_hash_set) {
354+ supported_gltf_extensions_char_string.set (supported_gltf_extension_index, ext.utf8 ());
355+ supported_gltf_extension_index++;
356+ }
357+ // Now we can convert them to the `const char *` format.
358+ Vector<const char *> supported_gltf_extensions;
359+ supported_gltf_extensions.resize (supported_gltf_extensions_char_string.size ());
360+ for (int64_t i = 0 ; i < supported_gltf_extensions_char_string.size (); i++) {
361+ supported_gltf_extensions.write [i] = supported_gltf_extensions_char_string[i].get_data ();
371362 }
372363
373364 XrRenderModelCreateInfoEXT create_info = {
0 commit comments