Depsgraph: Enable copy on write by default

As was decided at today's dev kickoff, we're now moving to having
Copy-on-Write enabled by default, as 2.8 is barely functional with
it off.

To run Blender *without* COW (e.g. for testing), use:
--disable-copy-on-write
This commit is contained in:
Joshua Leung
2018-05-22 12:00:23 +02:00
parent 9fc5a0c95e
commit 7f714fdbb2
3 changed files with 8 additions and 8 deletions

View File

@@ -92,7 +92,7 @@ extern "C" {
#endif
bool DEG_depsgraph_use_copy_on_write(void);
void DEG_depsgraph_enable_copy_on_write(void);
void DEG_depsgraph_disable_copy_on_write(void);
/* ************************************************ */
/* Depsgraph API */

View File

@@ -70,16 +70,16 @@ extern "C" {
#include "intern/depsgraph_intern.h"
#include "util/deg_util_foreach.h"
static bool use_copy_on_write = false;
static bool use_copy_on_write = true;
bool DEG_depsgraph_use_copy_on_write(void)
{
return use_copy_on_write;
}
void DEG_depsgraph_enable_copy_on_write(void)
void DEG_depsgraph_disable_copy_on_write(void)
{
use_copy_on_write = true;
use_copy_on_write = false;
}
namespace DEG {

View File

@@ -588,7 +588,7 @@ static int arg_handle_print_help(int UNUSED(argc), const char **UNUSED(argv), vo
printf("\n");
printf("Experimental Features:\n");
BLI_argsPrintArgDoc(ba, "--enable-copy-on-write");
BLI_argsPrintArgDoc(ba, "--disable-copy-on-write");
/* Other options _must_ be last (anything not handled will show here) */
printf("\n");
@@ -1294,8 +1294,8 @@ static const char arg_handle_use_copy_on_write_doc[] =
;
static int arg_handle_use_copy_on_write(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data))
{
printf("Using copy on write. This is highly EXPERIMENTAL!\n");
DEG_depsgraph_enable_copy_on_write();
printf("Disabling copy on write. Only use for testing whether something else is at fault\n");
DEG_depsgraph_disable_copy_on_write();
return 0;
}
@@ -1896,7 +1896,7 @@ void main_args_setup(bContext *C, bArgs *ba)
BLI_argsAdd(ba, 1, NULL, "--debug-gpu-shaders",
CB_EX(arg_handle_debug_mode_generic_set, gpumem), (void *)G_DEBUG_GPU_SHADERS);
BLI_argsAdd(ba, 1, NULL, "--enable-copy-on-write", CB(arg_handle_use_copy_on_write), NULL);
BLI_argsAdd(ba, 1, NULL, "--disable-copy-on-write", CB(arg_handle_use_copy_on_write), NULL);
BLI_argsAdd(ba, 1, NULL, "--verbose", CB(arg_handle_verbosity_set), NULL);