diff options
Diffstat (limited to 'servers')
-rw-r--r-- | servers/display_server.cpp | 28 | ||||
-rw-r--r-- | servers/display_server.h | 8 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp | 35 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h | 3 | ||||
-rw-r--r-- | servers/rendering/rendering_device.h | 4 | ||||
-rw-r--r-- | servers/rendering/shader_language.cpp | 14 | ||||
-rw-r--r-- | servers/rendering/shader_language.h | 1 |
7 files changed, 22 insertions, 71 deletions
diff --git a/servers/display_server.cpp b/servers/display_server.cpp index 2fa333cc05..7bd1075006 100644 --- a/servers/display_server.cpp +++ b/servers/display_server.cpp @@ -253,27 +253,6 @@ bool DisplayServer::get_swap_cancel_ok() { void DisplayServer::enable_for_stealing_focus(OS::ProcessID pid) { } -//plays video natively, in fullscreen, only implemented in mobile for now, likely not possible to implement on linux also. -Error DisplayServer::native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track, int p_screen) { - ERR_FAIL_V_MSG(ERR_UNAVAILABLE, "Native video not supported by this display server."); -} - -bool DisplayServer::native_video_is_playing() const { - return false; -} - -void DisplayServer::native_video_pause() { - WARN_PRINT("Native video not supported by this display server."); -} - -void DisplayServer::native_video_unpause() { - WARN_PRINT("Native video not supported by this display server."); -} - -void DisplayServer::native_video_stop() { - WARN_PRINT("Native video not supported by this display server."); -} - Error DisplayServer::dialog_show(String p_title, String p_description, Vector<String> p_buttons, const Callable &p_callback) { WARN_PRINT("Native dialogs not supported by this display server."); return OK; @@ -477,12 +456,6 @@ void DisplayServer::_bind_methods() { ClassDB::bind_method(D_METHOD("enable_for_stealing_focus", "process_id"), &DisplayServer::enable_for_stealing_focus); - ClassDB::bind_method(D_METHOD("native_video_play", "path", "volume", "audio_track", "subtitle_track", "screen"), &DisplayServer::native_video_play); - ClassDB::bind_method(D_METHOD("native_video_is_playing"), &DisplayServer::native_video_is_playing); - ClassDB::bind_method(D_METHOD("native_video_stop"), &DisplayServer::native_video_stop); - ClassDB::bind_method(D_METHOD("native_video_pause"), &DisplayServer::native_video_pause); - ClassDB::bind_method(D_METHOD("native_video_unpause"), &DisplayServer::native_video_unpause); - ClassDB::bind_method(D_METHOD("dialog_show", "title", "description", "buttons", "callback"), &DisplayServer::dialog_show); ClassDB::bind_method(D_METHOD("dialog_input_text", "title", "description", "existing_text", "callback"), &DisplayServer::dialog_input_text); @@ -518,7 +491,6 @@ void DisplayServer::_bind_methods() { BIND_ENUM_CONSTANT(FEATURE_VIRTUAL_KEYBOARD); BIND_ENUM_CONSTANT(FEATURE_CURSOR_SHAPE); BIND_ENUM_CONSTANT(FEATURE_CUSTOM_CURSOR_SHAPE); - BIND_ENUM_CONSTANT(FEATURE_NATIVE_VIDEO); BIND_ENUM_CONSTANT(FEATURE_NATIVE_DIALOG); BIND_ENUM_CONSTANT(FEATURE_CONSOLE_WINDOW); BIND_ENUM_CONSTANT(FEATURE_IME); diff --git a/servers/display_server.h b/servers/display_server.h index 3aab572120..f05aa1f59a 100644 --- a/servers/display_server.h +++ b/servers/display_server.h @@ -97,7 +97,6 @@ public: FEATURE_VIRTUAL_KEYBOARD, FEATURE_CURSOR_SHAPE, FEATURE_CUSTOM_CURSOR_SHAPE, - FEATURE_NATIVE_VIDEO, FEATURE_NATIVE_DIALOG, FEATURE_CONSOLE_WINDOW, FEATURE_IME, @@ -324,13 +323,6 @@ public: virtual void enable_for_stealing_focus(OS::ProcessID pid); - //plays video natively, in fullscreen, only implemented in mobile for now, likely not possible to implement on linux also. - virtual Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track, int p_screen = SCREEN_OF_MAIN_WINDOW); - virtual bool native_video_is_playing() const; - virtual void native_video_pause(); - virtual void native_video_unpause(); - virtual void native_video_stop(); - virtual Error dialog_show(String p_title, String p_description, Vector<String> p_buttons, const Callable &p_callback); virtual Error dialog_input_text(String p_title, String p_description, String p_partial, const Callable &p_callback); diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp index b2aaa50421..041476adf3 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp @@ -1272,42 +1272,12 @@ void RenderForwardMobile::_fill_instance_data(RenderListType p_render_list, uint rl->element_info.resize(p_offset + element_total); - uint32_t repeats = 0; - GeometryInstanceSurfaceDataCache *prev_surface = nullptr; for (uint32_t i = 0; i < element_total; i++) { GeometryInstanceSurfaceDataCache *surface = rl->elements[i + p_offset]; - GeometryInstanceForwardMobile *inst = surface->owner; - - bool cant_repeat = inst->flags_cache & INSTANCE_DATA_FLAG_MULTIMESH || inst->mesh_instance.is_valid(); - - if (prev_surface != nullptr && !cant_repeat && prev_surface->sort.sort_key1 == surface->sort.sort_key1 && prev_surface->sort.sort_key2 == surface->sort.sort_key2) { - //this element is the same as the previous one, count repeats to draw it using instancing - repeats++; - } else { - if (repeats > 0) { - for (uint32_t j = 1; j <= repeats; j++) { - rl->element_info[p_offset + i - j].repeat = j; - } - } - repeats = 1; - } - RenderElementInfo &element_info = rl->element_info[p_offset + i]; element_info.lod_index = surface->lod_index; element_info.uses_lightmap = surface->sort.uses_lightmap; - - if (cant_repeat) { - prev_surface = nullptr; - } else { - prev_surface = surface; - } - } - - if (repeats > 0) { - for (uint32_t j = 1; j <= repeats; j++) { - rl->element_info[p_offset + element_total - j].repeat = j; - } } } @@ -1523,13 +1493,12 @@ void RenderForwardMobile::_render_list_template(RenderingDevice::DrawListID p_dr RD::get_singleton()->draw_list_set_push_constant(draw_list, &push_constant, sizeof(GeometryInstanceForwardMobile::PushConstant)); - uint32_t instance_count = surf->owner->instance_count > 1 ? surf->owner->instance_count : element_info.repeat; + uint32_t instance_count = surf->owner->instance_count > 1 ? surf->owner->instance_count : 1; if (surf->flags & GeometryInstanceSurfaceDataCache::FLAG_USES_PARTICLE_TRAILS) { instance_count /= surf->owner->trail_steps; } RD::get_singleton()->draw_list_draw(draw_list, index_array_rd.is_valid(), instance_count); - i += element_info.repeat - 1; //skip equal elements } } @@ -1872,7 +1841,7 @@ void RenderForwardMobile::_geometry_instance_add_surface_with_material(GeometryI sdcache->sort.material_id_low = p_material_id & 0x0000FFFF; sdcache->sort.material_id_hi = p_material_id >> 16; sdcache->sort.shader_id = p_shader_id; - sdcache->sort.geometry_id = p_mesh.get_local_index(); //only meshes can repeat anyway + sdcache->sort.geometry_id = p_mesh.get_local_index(); // sdcache->sort.uses_forward_gi = ginstance->can_sdfgi; sdcache->sort.priority = p_material->priority; } diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h index d356d88335..232ad0066b 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h @@ -363,10 +363,9 @@ protected: }; struct RenderElementInfo { - uint32_t repeat : 22; uint32_t uses_lightmap : 1; uint32_t lod_index : 8; - uint32_t reserved : 1; // was uses_forward_gi but we don't use that here + uint32_t reserved : 23; }; template <PassMode p_pass_mode> diff --git a/servers/rendering/rendering_device.h b/servers/rendering/rendering_device.h index 2de0549e8d..d86c44a206 100644 --- a/servers/rendering/rendering_device.h +++ b/servers/rendering/rendering_device.h @@ -93,10 +93,14 @@ public: DeviceFamily device_family = DEVICE_UNKNOWN; uint32_t version_major = 1.0; uint32_t version_minor = 0.0; + // subgroup capabilities uint32_t subgroup_size = 0; uint32_t subgroup_in_shaders = 0; // Set flags using SHADER_STAGE_VERTEX_BIT, SHADER_STAGE_FRAGMENT_BIT, etc. uint32_t subgroup_operations = 0; // Set flags, using SubgroupOperations + + // features + bool supports_multiview = false; // If true this device supports multiview options }; typedef Vector<uint8_t> (*ShaderCompileFunction)(ShaderStage p_stage, const String &p_source_code, ShaderLanguage p_language, String *r_error, const Capabilities *p_capabilities); diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 0d6d3f5e13..a81306b97d 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -2969,6 +2969,20 @@ void ShaderLanguage::get_keyword_list(List<String> *r_keywords) { } } +bool ShaderLanguage::is_control_flow_keyword(String p_keyword) { + return p_keyword == "break" || + p_keyword == "case" || + p_keyword == "continue" || + p_keyword == "default" || + p_keyword == "do" || + p_keyword == "else" || + p_keyword == "for" || + p_keyword == "if" || + p_keyword == "return" || + p_keyword == "switch" || + p_keyword == "while"; +} + void ShaderLanguage::get_builtin_funcs(List<String> *r_keywords) { Set<String> kws; diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h index 470f3d38d5..e00f4dce19 100644 --- a/servers/rendering/shader_language.h +++ b/servers/rendering/shader_language.h @@ -748,6 +748,7 @@ public: static uint32_t get_type_size(DataType p_type); static void get_keyword_list(List<String> *r_keywords); + static bool is_control_flow_keyword(String p_keyword); static void get_builtin_funcs(List<String> *r_keywords); struct BuiltInInfo { |