diff options
Diffstat (limited to 'servers')
12 files changed, 21 insertions, 32 deletions
diff --git a/servers/display_server.h b/servers/display_server.h index 8eafccc040..31ebf12531 100644 --- a/servers/display_server.h +++ b/servers/display_server.h @@ -382,7 +382,7 @@ public: virtual void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID) = 0; virtual void window_set_window_buttons_offset(const Vector2i &p_offset, WindowID p_window = MAIN_WINDOW_ID) {} - virtual Vector2i window_get_safe_title_margins(WindowID p_window = MAIN_WINDOW_ID) const { return Vector2i(); } + virtual Vector3i window_get_safe_title_margins(WindowID p_window = MAIN_WINDOW_ID) const { return Vector3i(); } virtual bool window_can_draw(WindowID p_window = MAIN_WINDOW_ID) const = 0; diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp index 84d2ad328c..039a2d2bf4 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp @@ -754,7 +754,7 @@ void RenderForwardClustered::_fill_instance_data(RenderListType p_render_list, i bool cant_repeat = instance_data.flags & 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 && repeats < RenderElementInfo::MAX_REPEATS) { + if (prev_surface != nullptr && !cant_repeat && prev_surface->sort.sort_key1 == surface->sort.sort_key1 && prev_surface->sort.sort_key2 == surface->sort.sort_key2 && inst->mirror == prev_surface->owner->mirror && repeats < RenderElementInfo::MAX_REPEATS) { //this element is the same as the previous one, count repeats to draw it using instancing repeats++; } else { diff --git a/servers/rendering/renderer_rd/pipeline_cache_rd.cpp b/servers/rendering/renderer_rd/pipeline_cache_rd.cpp index 9151c53823..7a2336970b 100644 --- a/servers/rendering/renderer_rd/pipeline_cache_rd.cpp +++ b/servers/rendering/renderer_rd/pipeline_cache_rd.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "pipeline_cache_rd.h" + #include "core/os/memory.h" RID PipelineCacheRD::_generate_version(RD::VertexFormatID p_vertex_format_id, RD::FramebufferFormatID p_framebuffer_format_id, bool p_wireframe, uint32_t p_render_pass, uint32_t p_bool_specializations) { @@ -70,9 +71,7 @@ RID PipelineCacheRD::_generate_version(RD::VertexFormatID p_vertex_format_id, RD } void PipelineCacheRD::_clear() { -#ifndef _MSC_VER -#warning Clear should probably recompile all the variants already compiled instead to avoid stalls? needs discussion -#endif + // TODO: Clear should probably recompile all the variants already compiled instead to avoid stalls? Needs discussion. if (versions) { for (uint32_t i = 0; i < version_count; i++) { //shader may be gone, so this may not be valid diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp index e5e82552f4..5728444312 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp @@ -1075,10 +1075,7 @@ void RendererCanvasRenderRD::_render_items(RID p_to_render_target, int p_item_co clear_colors.push_back(texture_storage->render_target_get_clear_request_color(p_to_render_target)); texture_storage->render_target_disable_clear_request(p_to_render_target); } -#ifndef _MSC_VER -#warning TODO obtain from framebuffer format eventually when this is implemented -#endif - + // TODO: Obtain from framebuffer format eventually when this is implemented. fb_uniform_set = texture_storage->render_target_get_framebuffer_uniform_set(p_to_render_target); } diff --git a/servers/rendering/renderer_rd/renderer_compositor_rd.cpp b/servers/rendering/renderer_rd/renderer_compositor_rd.cpp index dd3f62e509..3289bfb0ea 100644 --- a/servers/rendering/renderer_rd/renderer_compositor_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_compositor_rd.cpp @@ -102,10 +102,8 @@ void RendererCompositorRD::begin_frame(double frame_step) { } void RendererCompositorRD::end_frame(bool p_swap_buffers) { -#ifndef _MSC_VER -#warning TODO: likely pass a bool to swap buffers to avoid display? -#endif - RD::get_singleton()->swap_buffers(); //probably should pass some bool to avoid display? + // TODO: Likely pass a bool to swap buffers to avoid display? + RD::get_singleton()->swap_buffers(); } void RendererCompositorRD::initialize() { diff --git a/servers/rendering/renderer_rd/shader_rd.cpp b/servers/rendering/renderer_rd/shader_rd.cpp index 0f2dea6fe9..5e9eadadd9 100644 --- a/servers/rendering/renderer_rd/shader_rd.cpp +++ b/servers/rendering/renderer_rd/shader_rd.cpp @@ -180,6 +180,7 @@ void ShaderRD::_build_variant_code(StringBuilder &builder, uint32_t p_variant, c #if defined(MACOS_ENABLED) || defined(IOS_ENABLED) builder.append("#define MOLTENVK_USED\n"); #endif + builder.append(String("#define RENDER_DRIVER_") + OS::get_singleton()->get_current_rendering_driver_name().to_upper() + "\n"); } break; case StageTemplate::Chunk::TYPE_MATERIAL_UNIFORMS: { builder.append(p_version->uniforms.get_data()); //uniforms (same for vertex and fragment) diff --git a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp index 78f4c410c3..240f743387 100644 --- a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "particles_storage.h" + #include "servers/rendering/renderer_rd/renderer_compositor_rd.h" #include "servers/rendering/rendering_server_globals.h" #include "texture_storage.h" @@ -1334,10 +1335,7 @@ void ParticlesStorage::update_particles() { } } -#ifndef _MSC_VER -#warning Should use display refresh rate for all this -#endif - + // TODO: Should use display refresh rate for all this. float screen_hz = 60; int fixed_fps = 0; diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp index b3a7e05ff5..d5285c07f4 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "texture_storage.h" + #include "../effects/copy_effects.h" #include "../framebuffer_cache_rd.h" #include "material_storage.h" @@ -1496,9 +1497,7 @@ Ref<Image> TextureStorage::_validate_texture_format(const Ref<Image> &p_image, T } break; case Image::FORMAT_RGBE9995: { r_format.format = RD::DATA_FORMAT_E5B9G9R9_UFLOAT_PACK32; -#ifndef _MSC_VER -#warning TODO need to make a function in Image to swap bits for this -#endif + // TODO: Need to make a function in Image to swap bits for this. r_format.swizzle_r = RD::TEXTURE_SWIZZLE_IDENTITY; r_format.swizzle_g = RD::TEXTURE_SWIZZLE_IDENTITY; r_format.swizzle_b = RD::TEXTURE_SWIZZLE_IDENTITY; @@ -2462,6 +2461,7 @@ void TextureStorage::_update_render_target(RenderTarget *rt) { RD::TEXTURE_SAMPLES_8, }; rd_color_multisample_format.samples = texture_samples[rt->msaa]; + rd_color_multisample_format.usage_bits = RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT; RD::TextureView rd_view_multisample; rd_color_multisample_format.is_resolve_buffer = false; rt->color_multisample = RD::get_singleton()->texture_create(rd_color_multisample_format, rd_view_multisample); diff --git a/servers/rendering/renderer_scene_cull.cpp b/servers/rendering/renderer_scene_cull.cpp index 2b25e8962f..d0cb46dee9 100644 --- a/servers/rendering/renderer_scene_cull.cpp +++ b/servers/rendering/renderer_scene_cull.cpp @@ -869,12 +869,7 @@ void RendererSceneCull::instance_set_transform(RID p_instance, const Transform3D for (int i = 0; i < 4; i++) { const Vector3 &v = i < 3 ? p_transform.basis.rows[i] : p_transform.origin; - ERR_FAIL_COND(Math::is_inf(v.x)); - ERR_FAIL_COND(Math::is_nan(v.x)); - ERR_FAIL_COND(Math::is_inf(v.y)); - ERR_FAIL_COND(Math::is_nan(v.y)); - ERR_FAIL_COND(Math::is_inf(v.z)); - ERR_FAIL_COND(Math::is_nan(v.z)); + ERR_FAIL_COND(!v.is_finite()); } #endif diff --git a/servers/rendering/rendering_device.h b/servers/rendering/rendering_device.h index 29e5c9cd77..ca30a30786 100644 --- a/servers/rendering/rendering_device.h +++ b/servers/rendering/rendering_device.h @@ -958,7 +958,7 @@ public: bool wireframe; PolygonCullMode cull_mode; PolygonFrontFace front_face; - bool depth_bias_enable; + bool depth_bias_enabled; float depth_bias_constant_factor; float depth_bias_clamp; float depth_bias_slope_factor; @@ -970,7 +970,7 @@ public: wireframe = false; cull_mode = POLYGON_CULL_DISABLED; front_face = POLYGON_FRONT_FACE_CLOCKWISE; - depth_bias_enable = false; + depth_bias_enabled = false; depth_bias_constant_factor = 0; depth_bias_clamp = 0; depth_bias_slope_factor = 0; diff --git a/servers/rendering/rendering_device_binds.h b/servers/rendering/rendering_device_binds.h index d95b46933c..c710bd0a10 100644 --- a/servers/rendering/rendering_device_binds.h +++ b/servers/rendering/rendering_device_binds.h @@ -517,7 +517,7 @@ public: RD_SETGET(bool, wireframe) RD_SETGET(RD::PolygonCullMode, cull_mode) RD_SETGET(RD::PolygonFrontFace, front_face) - RD_SETGET(bool, depth_bias_enable) + RD_SETGET(bool, depth_bias_enabled) RD_SETGET(float, depth_bias_constant_factor) RD_SETGET(float, depth_bias_clamp) RD_SETGET(float, depth_bias_slope_factor) @@ -531,7 +531,7 @@ protected: RD_BIND(Variant::BOOL, RDPipelineRasterizationState, wireframe); RD_BIND(Variant::INT, RDPipelineRasterizationState, cull_mode); RD_BIND(Variant::INT, RDPipelineRasterizationState, front_face); - RD_BIND(Variant::BOOL, RDPipelineRasterizationState, depth_bias_enable); + RD_BIND(Variant::BOOL, RDPipelineRasterizationState, depth_bias_enabled); RD_BIND(Variant::FLOAT, RDPipelineRasterizationState, depth_bias_constant_factor); RD_BIND(Variant::FLOAT, RDPipelineRasterizationState, depth_bias_clamp); RD_BIND(Variant::FLOAT, RDPipelineRasterizationState, depth_bias_slope_factor); diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 627cd9f062..e12c4fc79a 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -2868,12 +2868,13 @@ void RenderingServer::init() { GLOBAL_DEF("rendering/2d/shadow_atlas/size", 2048); - // Already defined in RenderingDeviceVulkan::initialize which runs before this code. + // Already defined in some RenderingDevice*::initialize, which run before this code. // We re-define them here just for doctool's sake. Make sure to keep default values in sync. GLOBAL_DEF("rendering/rendering_device/staging_buffer/block_size_kb", 256); GLOBAL_DEF("rendering/rendering_device/staging_buffer/max_size_mb", 128); GLOBAL_DEF("rendering/rendering_device/staging_buffer/texture_upload_region_size_px", 64); - GLOBAL_DEF("rendering/rendering_device/descriptor_pools/max_descriptors_per_pool", 64); + // Vulkan-specific. + GLOBAL_DEF("rendering/rendering_device/vulkan/max_descriptors_per_pool", 64); // Number of commands that can be drawn per frame. GLOBAL_DEF_RST("rendering/gl_compatibility/item_buffer_size", 16384); |