mirror of
https://github.com/godotengine/godot.git
synced 2025-10-23 18:03:35 +00:00
Made Vector::ptrw explicit for writing, compiler was sometimes using the wrong function,
leading to unnecesary copy on writes and reduced performance.
This commit is contained in:
parent
7dfba3cda9
commit
bc2e8d99e5
62 changed files with 148 additions and 147 deletions
|
|
@ -1434,7 +1434,7 @@ void VisualScriptInstance::_dependency_step(VisualScriptNodeInstance *node, int
|
|||
if (!node->dependencies.empty()) {
|
||||
|
||||
int dc = node->dependencies.size();
|
||||
VisualScriptNodeInstance **deps = node->dependencies.ptr();
|
||||
VisualScriptNodeInstance **deps = node->dependencies.ptrw();
|
||||
|
||||
for (int i = 0; i < dc; i++) {
|
||||
|
||||
|
|
@ -1526,7 +1526,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
|
|||
if (!node->dependencies.empty()) {
|
||||
|
||||
int dc = node->dependencies.size();
|
||||
VisualScriptNodeInstance **deps = node->dependencies.ptr();
|
||||
VisualScriptNodeInstance **deps = node->dependencies.ptrw();
|
||||
|
||||
for (int i = 0; i < dc; i++) {
|
||||
|
||||
|
|
@ -1626,7 +1626,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
|
|||
state->flow_stack_pos = flow_stack_pos;
|
||||
state->stack.resize(p_stack_size);
|
||||
state->pass = p_pass;
|
||||
copymem(state->stack.ptr(), p_stack, p_stack_size);
|
||||
copymem(state->stack.ptrw(), p_stack, p_stack_size);
|
||||
//step 2, run away, return directly
|
||||
r_error.error = Variant::CallError::CALL_OK;
|
||||
|
||||
|
|
@ -2277,7 +2277,7 @@ Variant VisualScriptFunctionState::_signal_callback(const Variant **p_args, int
|
|||
|
||||
*working_mem = args; //arguments go to working mem.
|
||||
|
||||
Variant ret = instance->_call_internal(function, stack.ptr(), stack.size(), node, flow_stack_pos, pass, true, r_error);
|
||||
Variant ret = instance->_call_internal(function, stack.ptrw(), stack.size(), node, flow_stack_pos, pass, true, r_error);
|
||||
function = StringName(); //invalidate
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -2319,7 +2319,7 @@ Variant VisualScriptFunctionState::resume(Array p_args) {
|
|||
|
||||
*working_mem = p_args; //arguments go to working mem.
|
||||
|
||||
Variant ret = instance->_call_internal(function, stack.ptr(), stack.size(), node, flow_stack_pos, pass, true, r_error);
|
||||
Variant ret = instance->_call_internal(function, stack.ptrw(), stack.size(), node, flow_stack_pos, pass, true, r_error);
|
||||
function = StringName(); //invalidate
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue