summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2020-07-12 05:05:04 -0300
committerGravatar ReinUsesLisp2020-11-11 19:52:19 -0300
commit622830f4e16a8f0eabeb1b81dea5fca613402d8c (patch)
tree7b800235ffe39690a60f7024578f42c54ed0f2d5 /src
parentmaxwell_3d: Move code to separate functions (diff)
downloadyuzu-622830f4e16a8f0eabeb1b81dea5fca613402d8c.tar.gz
yuzu-622830f4e16a8f0eabeb1b81dea5fca613402d8c.tar.xz
yuzu-622830f4e16a8f0eabeb1b81dea5fca613402d8c.zip
maxwell_3d: Use insert instead of loop push_back
This reduces the overhead of bounds checking on each element. It won't reduce the cost of allocation because usually this vector's capacity is usually large enough to hold whatever we push to it.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index f7fa5fea7..6287df633 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -132,9 +132,7 @@ void Maxwell3D::ProcessMacro(u32 method, const u32* base_start, u32 amount, bool
132 executing_macro = method; 132 executing_macro = method;
133 } 133 }
134 134
135 for (std::size_t i = 0; i < amount; i++) { 135 macro_params.insert(macro_params.end(), base_start, base_start + amount);
136 macro_params.push_back(base_start[i]);
137 }
138 136
139 // Call the macro when there are no more parameters in the command buffer 137 // Call the macro when there are no more parameters in the command buffer
140 if (is_last_call) { 138 if (is_last_call) {