mirror of
https://github.com/blender/blender
synced 2026-10-22 11:58:35 +03:00
On Windows and macOS, the default maximum number of stdio file handles is 512 and 256 respectively. On Linux it's usually some very high number. This increases that limit on startup to 8192, to better handle some production files and have more uniform limits across platforms. This is commonly done in VFX software. Some code in Blender keeps file handles open for a long time, particularly the Cycles texture cache and Alembic cache file datablocks. This helps improve performance when reading tiles or frames on demand, without having to reopen the file each time. Cycles limits itself to 128 file handles, but there is no limit on cache file datablocks. The production file in #160383 has 480 open file handles for Alembic, so it was already near the limit on Windows, and then a few more pushed it over. By increasing the limit, at a minimum all production files that worked before should continue to work when enabling the texture cache. Improving the cache file datablock to use fewer handles is left for another time. Fix #160383: Cycles texture missing images in production file Pull Request: https://projects.blender.org/blender/blender/pulls/160488
33 lines
765 B
C++
33 lines
765 B
C++
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <cstdlib>
|
|
|
|
#include <string>
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
/* Get width in characters of the current console output. */
|
|
int system_console_width();
|
|
|
|
std::string system_cpu_brand_string();
|
|
int system_cpu_bits();
|
|
bool system_cpu_support_sse42();
|
|
bool system_cpu_support_avx2();
|
|
|
|
size_t system_physical_ram();
|
|
|
|
/* Get identifier of the currently running process. */
|
|
uint64_t system_self_process_id();
|
|
|
|
size_t system_max_open_files();
|
|
|
|
/* Ensure the process can open many files simultaneously.
|
|
* This should be called once on application startup, as it is not thread safe. */
|
|
void system_max_open_files_ensure();
|
|
|
|
CCL_NAMESPACE_END
|