Merge pull request #54027 from akien-mga/doctool-headless

This commit is contained in:
Rémi Verschelde 2021-10-20 18:31:56 +02:00 committed by GitHub
commit 160d5908c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 11 deletions

View file

@ -85,6 +85,15 @@ jobs:
run: |
${{ matrix.bin }} --test
# Check class reference
- name: Check for class reference updates
if: ${{ matrix.doc-test }}
run: |
echo "Running --doctool to see if this changes the public API without updating the documentation."
echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n"
${{ matrix.bin }} --doctool --headless 2>&1 > /dev/null || true
git diff --color --exit-code && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$'
# Download, unzip and setup SwiftShader library [4466040]
- name: Download SwiftShader
if: ${{ matrix.tests }}
@ -95,15 +104,6 @@ jobs:
curr="$(pwd)/libvk_swiftshader.so"
sed -i "s|PATH_TO_CHANGE|$curr|" vk_swiftshader_icd.json
# Check class reference
- name: Check for class reference updates
if: ${{ matrix.doc-test }}
run: |
echo "Running --doctool to see if this changes the public API without updating the documentation."
echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n"
VK_ICD_FILENAMES=$(pwd)/vk_swiftshader_icd.json DRI_PRIME=0 xvfb-run ${{ matrix.bin }} --doctool . 2>&1 > /dev/null || true
git diff --color --exit-code && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$'
# Download and extract zip archive with project, folder is renamed to be able to easy change used project
- name: Download test project
if: ${{ matrix.proj-test }}

View file

@ -8913,6 +8913,8 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context, bool p_local_de
}
}
// Note: If adding new project settings here, also duplicate their definition in
// rendering_server.cpp for headless doctool.
staging_buffer_block_size = GLOBAL_DEF("rendering/vulkan/staging_buffer/block_size_kb", 256);
staging_buffer_block_size = MAX(4, staging_buffer_block_size);
staging_buffer_block_size *= 1024; //kb -> bytes

View file

@ -1343,8 +1343,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
display_driver_idx = 0;
}
if (audio_driver == "") { // specified in project.godot
audio_driver = GLOBAL_DEF_RST_NOVAL("audio/driver/driver", AudioDriverManager::get_driver(0)->get_name());
GLOBAL_DEF_RST_NOVAL("audio/driver/driver", AudioDriverManager::get_driver(0)->get_name());
if (audio_driver == "") { // Specified in project.godot.
audio_driver = GLOBAL_GET("audio/driver/driver");
}
for (int i = 0; i < AudioDriverManager::get_driver_count(); i++) {

View file

@ -532,6 +532,7 @@ void GPUParticles2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_trail_section_subdivisions"), &GPUParticles2D::get_trail_section_subdivisions);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emitting"), "set_emitting", "is_emitting");
ADD_PROPERTY_DEFAULT("emitting", true); // Workaround for doctool in headless mode, as dummy rasterizer always returns false.
ADD_PROPERTY(PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_RANGE, "1,1000000,1,exp"), "set_amount", "get_amount");
ADD_GROUP("Time", "");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "lifetime", PROPERTY_HINT_RANGE, "0.01,600.0,0.01,or_greater"), "set_lifetime", "get_lifetime");

View file

@ -562,6 +562,7 @@ void GPUParticles3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_transform_align"), &GPUParticles3D::get_transform_align);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emitting"), "set_emitting", "is_emitting");
ADD_PROPERTY_DEFAULT("emitting", true); // Workaround for doctool in headless mode, as dummy rasterizer always returns false.
ADD_PROPERTY(PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_RANGE, "1,1000000,1,exp"), "set_amount", "get_amount");
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "sub_emitter", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "GPUParticles3D"), "set_sub_emitter", "get_sub_emitter");
ADD_GROUP("Time", "");

View file

@ -2810,6 +2810,12 @@ RenderingServer::RenderingServer() {
PropertyInfo(Variant::INT,
"rendering/vulkan/rendering/back_end",
PROPERTY_HINT_ENUM, "Forward Clustered (Supports Desktop Only),Forward Mobile (Supports Desktop and Mobile)"));
// Already defined in RenderingDeviceVulkan::initialize which runs before this code.
// We re-define them here just for doctool's sake. Make sure to keep default values in sync.
GLOBAL_DEF("rendering/vulkan/staging_buffer/block_size_kb", 256);
GLOBAL_DEF("rendering/vulkan/staging_buffer/max_size_mb", 128);
GLOBAL_DEF("rendering/vulkan/staging_buffer/texture_upload_region_size_px", 64);
GLOBAL_DEF("rendering/vulkan/descriptor_pools/max_descriptors_per_pool", 64);
GLOBAL_DEF("rendering/3d/viewport/scale", 1.0);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/3d/viewport/scale",