Skip to content

Commit

Permalink
Merge pull request #951 from Spartan322/merge/b15b24b
Browse files Browse the repository at this point in the history
  • Loading branch information
Spartan322 authored Jan 24, 2025
2 parents 7f6ba60 + e0ff42e commit dc9eade
Show file tree
Hide file tree
Showing 60 changed files with 980 additions and 401 deletions.
39 changes: 39 additions & 0 deletions .github/actions/godot-cpp-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build godot-cpp
description: Build godot-cpp with the provided options.

env:
GODOT_CPP_BRANCH: 4.3

inputs:
bin:
description: Path to the Godot binary.
required: true
type: string
scons-flags:
description: Additional SCons flags.
type: string
scons-cache:
description: The SCons cache path.
default: ${{ github.workspace }}/.scons_cache/
type: string

runs:
using: composite
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
repository: godotengine/godot-cpp
ref: ${{ env.GODOT_CPP_BRANCH }}
path: godot-cpp

- name: Extract API
shell: sh
run: ${{ inputs.bin }} --headless --dump-gdextension-interface --dump-extension-api

- name: SCons Build
shell: sh
env:
SCONS_CACHE: ${{ inputs.scons-cache }}
run: scons --directory=./godot-cpp/test "gdextension_dir=${{ github.workspace }}" ${{ inputs.scons-flags }}
57 changes: 0 additions & 57 deletions .github/workflows/godot_cpp_test.yml

This file was deleted.

19 changes: 10 additions & 9 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ jobs:
proj-conv: true
api-compat: true
artifact: true
cache-limit: 1
# Validate godot-cpp compatibility on one arbitrary editor build.
godot-cpp: true
cache-limit: 2

- name: Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)
cache-name: linux-editor-double-sanitizers
Expand All @@ -44,8 +46,6 @@ jobs:
build-mono: false
tests: true
proj-test: true
# Generate an API dump for godot-cpp tests.
api-dump: true
# Skip 2GiB artifact speeding up action.
artifact: false
cache-limit: 7
Expand Down Expand Up @@ -158,6 +158,13 @@ jobs:
tests: ${{ matrix.tests }}
scons-cache-limit: ${{ matrix.cache-limit }}

- name: Compilation (godot-cpp)
uses: ./.github/actions/godot-cpp-build
if: matrix.godot-cpp
with:
bin: ${{ matrix.bin }}
scons-flags: target=template_debug dev_build=yes verbose=yes

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
Expand Down Expand Up @@ -187,12 +194,6 @@ jobs:
with:
name: ${{ matrix.cache-name }}

- name: Dump Godot API
uses: ./.github/actions/godot-api-dump
if: matrix.api-dump
with:
bin: ${{ matrix.bin }}

- name: Unit tests
if: matrix.tests
run: |
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,3 @@ jobs:
name: 🌐 Web
needs: static-checks
uses: ./.github/workflows/web_builds.yml

# Third stage: Run auxiliary tests using build artifacts from previous jobs.

# Can be turned off for PRs that intentionally break compat with godot-cpp,
# until both the upstream PR and the matching godot-cpp changes are merged.
godot-cpp-test:
name: 🪲 Godot CPP
# This can be changed to depend on another platform, if we decide to use it for
# godot-cpp instead. Make sure to move the .github/actions/godot-api-dump step
# appropriately.
needs: linux-build
uses: ./.github/workflows/godot_cpp_test.yml
4 changes: 2 additions & 2 deletions core/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ PackedStringArray ResourceLoader::get_dependencies(const String &p_path) {
}

bool ResourceLoader::has_cached(const String &p_path) {
String local_path = ProjectSettings::get_singleton()->localize_path(p_path);
String local_path = ::ResourceLoader::_validate_local_path(p_path);
return ResourceCache::has(local_path);
}

Ref<Resource> ResourceLoader::get_cached_ref(const String &p_path) {
String local_path = ProjectSettings::get_singleton()->localize_path(p_path);
String local_path = ::ResourceLoader::_validate_local_path(p_path);
return ResourceCache::get_ref(local_path);
}

Expand Down
2 changes: 1 addition & 1 deletion core/io/resource_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ void ResourceLoader::_run_load_task(void *p_userdata) {
curr_load_task = curr_load_task_backup;
}

static String _validate_local_path(const String &p_path) {
String ResourceLoader::_validate_local_path(const String &p_path) {
ResourceUID::ID uid = ResourceUID::get_singleton()->text_to_id(p_path);
if (uid != ResourceUID::INVALID_ID) {
return ResourceUID::get_singleton()->get_id_path(uid);
Expand Down
7 changes: 7 additions & 0 deletions core/io/resource_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
#include "core/object/worker_thread_pool.h"
#include "core/os/thread.h"

namespace core_bind {
class ResourceLoader;
}

class ConditionVariable;

template <int Tag>
Expand Down Expand Up @@ -103,6 +107,7 @@ typedef void (*ResourceLoadedCallback)(Ref<Resource> p_resource, const String &p

class ResourceLoader {
friend class LoadToken;
friend class core_bind::ResourceLoader;

enum {
MAX_LOADERS = 64
Expand Down Expand Up @@ -219,6 +224,8 @@ class ResourceLoader {

static bool _ensure_load_progress();

static String _validate_local_path(const String &p_path);

public:
static Error load_threaded_request(const String &p_path, const String &p_type_hint = "", bool p_use_sub_threads = false, ResourceFormatLoader::CacheMode p_cache_mode = ResourceFormatLoader::CACHE_MODE_REUSE);
static ThreadLoadStatus load_threaded_get_status(const String &p_path, float *r_progress = nullptr);
Expand Down
1 change: 1 addition & 0 deletions doc/classes/CPUParticles2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
<member name="particle_flag_align_y" type="bool" setter="set_particle_flag" getter="get_particle_flag" default="false">
Align Y axis of particle with the direction of its velocity.
</member>
<member name="physics_interpolation_mode" type="int" setter="set_physics_interpolation_mode" getter="get_physics_interpolation_mode" overrides="Node" enum="Node.PhysicsInterpolationMode" default="2" />
<member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" default="0.0">
Particle system starts as if it had already run for this many seconds.
</member>
Expand Down
8 changes: 4 additions & 4 deletions doc/classes/Cubemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
A cubemap is made of 6 textures organized in layers. They are typically used for faking reflections in 3D rendering (see [ReflectionProbe]). It can be used to make an object look as if it's reflecting its surroundings. This usually delivers much better performance than other reflection methods.
This resource is typically used as a uniform in custom shaders. Few core Redot methods make use of [Cubemap] resources.
To create such a texture file yourself, reimport your image files using the Redot Editor import presets. The expected image order is X+, X-, Y+, Y-, Z+, Z- (in Redot's coordinate system, so Y+ is "up" and Z- is "forward"). You can use one of the following templates as a base:
- [url=https://raw.githubusercontent.com/Redot-Engine/redot-docs/master/img/cubemap_template_2x3.webp]2×3 cubemap template (default layout option)[/url]
- [url=https://raw.githubusercontent.com/Redot-Engine/redot-docs/master/img/cubemap_template_3x2.webp]3×2 cubemap template[/url]
- [url=https://raw.githubusercontent.com/Redot-Engine/redot-docs/master/img/cubemap_template_1x6.webp]1×6 cubemap template[/url]
- [url=https://raw.githubusercontent.com/Redot-Engine/redot-docs/master/img/cubemap_template_6x1.webp]6×1 cubemap template[/url]
- [url=https://raw.githubusercontent.com/Redot-Engine/redot-docs/master/tutorials/assets_pipeline/img/cubemap_template_2x3.webp]2×3 cubemap template (default layout option)[/url]
- [url=https://raw.githubusercontent.com/Redot-Engine/redot-docs/master/tutorials/assets_pipeline/img/cubemap_template_3x2.webp]3×2 cubemap template[/url]
- [url=https://raw.githubusercontent.com/Redot-Engine/redot-docs/master/tutorials/assets_pipeline/img/cubemap_template_1x6.webp]1×6 cubemap template[/url]
- [url=https://raw.githubusercontent.com/Redot-Engine/redot-docs/master/tutorials/assets_pipeline/img/cubemap_template_6x1.webp]6×1 cubemap template[/url]
[b]Note:[/b] Redot doesn't support using cubemaps in a [PanoramaSkyMaterial]. To use a cubemap as a skybox, convert the default [PanoramaSkyMaterial] to a [ShaderMaterial] using the [b]Convert to ShaderMaterial[/b] resource dropdown option, then replace its code with the following:
[codeblock lang=text]
shader_type sky;
Expand Down
3 changes: 3 additions & 0 deletions doc/classes/EditorSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,9 @@
- [b]Launch in PiP mode[/b] will launch the Play window directly in picture-in-picture (PiP) mode if PiP mode is supported and enabled. When maximized, the Play window will occupy the same window as the Editor.
[b]Note:[/b] Only available in the Android editor.
</member>
<member name="run/window_placement/game_embed_mode" type="int" setter="" getter="">
Overrides game embedding setting for all newly opened projects. If enabled, game embedding settings are not saved.
</member>
<member name="run/window_placement/play_window_pip_mode" type="int" setter="" getter="">
Specifies the picture-in-picture (PiP) mode for the Play window.
- [b]Disabled:[/b] PiP is disabled for the Play window.
Expand Down
11 changes: 10 additions & 1 deletion drivers/gles3/storage/texture_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1511,8 +1511,17 @@ void TextureStorage::_texture_set_data(RID p_texture, const Ref<Image> &p_image,
GLenum internal_format;
bool compressed = false;

bool needs_decompress = texture->resize_to_po2;

// Support for RGTC-compressed Texture Arrays isn't mandated by GLES3/WebGL.
if (!RasterizerGLES3::is_gles_over_gl() && texture->target == GL_TEXTURE_2D_ARRAY) {
if (p_image->get_format() == Image::FORMAT_RGTC_R || p_image->get_format() == Image::FORMAT_RGTC_RG) {
needs_decompress = true;
}
}

Image::Format real_format;
Ref<Image> img = _get_gl_image_and_format(p_image, p_image->get_format(), real_format, format, internal_format, type, compressed, texture->resize_to_po2);
Ref<Image> img = _get_gl_image_and_format(p_image, p_image->get_format(), real_format, format, internal_format, type, compressed, needs_decompress);
ERR_FAIL_COND(img.is_null());
if (texture->resize_to_po2) {
if (p_image->is_compressed()) {
Expand Down
2 changes: 2 additions & 0 deletions drivers/vulkan/rendering_device_driver_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1532,10 +1532,12 @@ RDD::BufferID RenderingDeviceDriverVulkan::buffer_create(uint64_t p_size, BitFie
if (is_src && !is_dst) {
// Looks like a staging buffer: CPU maps, writes sequentially, then GPU copies to VRAM.
alloc_create_info.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT;
alloc_create_info.preferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
}
if (is_dst && !is_src) {
// Looks like a readback buffer: GPU copies from VRAM, then CPU maps and reads.
alloc_create_info.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT;
alloc_create_info.preferredFlags |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
}
alloc_create_info.requiredFlags = (VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
} break;
Expand Down
2 changes: 2 additions & 0 deletions editor/code_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -935,12 +935,14 @@ void CodeTextEditor::_text_editor_gui_input(const Ref<InputEvent> &p_event) {
}
}

#ifndef ANDROID_ENABLED
Ref<InputEventMagnifyGesture> magnify_gesture = p_event;
if (magnify_gesture.is_valid()) {
_zoom_to(zoom_factor * powf(magnify_gesture->get_factor(), 0.25f));
accept_event();
return;
}
#endif

Ref<InputEventKey> k = p_event;

Expand Down
Loading

0 comments on commit dc9eade

Please sign in to comment.