Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 1020 vs 1021 for /trunk/Source Code/Platform/Video/PushConstants.cpp

Diff revisions: vs.
  @@ -5,26 +5,22 @@
5 5 namespace Divide {
6 6 PushConstants::PushConstants()
7 7 {
8 + _data.reserve(3);
8 9 }
9 10
10 11 PushConstants::PushConstants(const GFX::PushConstant& constant)
12 + : _data({constant})
11 13 {
12 - set(constant._binding,
13 - constant._type,
14 - constant._buffer,
15 - constant._flag);
16 14 }
17 15
18 16 PushConstants::PushConstants(const vectorImpl<GFX::PushConstant>& data)
17 + : _data(data)
19 18 {
20 - for (const GFX::PushConstant& constant : data) {
21 - set(constant);
22 - }
23 19 }
24 20
25 21 PushConstants::~PushConstants()
26 22 {
27 - clear();
23 + //clear();
28 24 }
29 25
30 26 PushConstants::PushConstants(const PushConstants& other)
  @@ -38,10 +34,14 @@
38 34 }
39 35
40 36 void PushConstants::set(const GFX::PushConstant& constant) {
41 - set(constant._binding,
42 - constant._type,
43 - constant._buffer,
44 - constant._flag);
37 + for (GFX::PushConstant& iter : _data) {
38 + if (iter._bindingHash == constant._bindingHash) {
39 + iter.assign(constant);
40 + return;
41 + }
42 + }
43 +
44 + _data.emplace_back(constant);
45 45 }
46 46
47 47 void PushConstants::clear() {