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/Headers/PushConstants.h

Diff revisions: vs.
  @@ -60,10 +60,16 @@
60 60 GFX::PushConstantType type,
61 61 const vectorImpl<T>& values,
62 62 bool flag = false) {
63 - auto ret = hashAlg::emplace(_data, _ID_RT(binding.c_str()), binding, type, values, flag);
64 - if (!ret.second) {
65 - ret.first->second.assign({ binding, type, values, flag });
63 +
64 + U64 bindingID = _ID_RT(binding.c_str());
65 + for (GFX::PushConstant& constant : _data) {
66 + if (constant._bindingHash == bindingID) {
67 + constant.assign({ binding, type, values, flag });
68 + return;
69 + }
66 70 }
71 +
72 + _data.emplace_back(binding, type, values, flag );
67 73 }
68 74
69 75 template<typename T, size_t N>
  @@ -72,22 +78,28 @@
72 78 const std::array<T, N>& values,
73 79 bool flag = false) {
74 80
75 - auto ret = hashAlg::emplace(_data, _ID_RT(binding.c_str()), binding, type, values, flag);
76 - if (!ret.second) {
77 - ret.first->second.assign({ binding, type, values, flag });
81 + U64 bindingID = _ID_RT(binding.c_str());
82 + for (GFX::PushConstant& constant : _data) {
83 + if (constant._bindingHash == bindingID) {
84 + constant.assign({ binding, type, values, flag });
85 + return;
86 + }
78 87 }
88 +
89 + _data.emplace_back(binding, type, values, flag);
79 90 }
80 91
81 92 void clear();
82 93
83 94 inline bool empty() const { return _data.empty(); }
84 95
85 - inline hashMapImpl<U64, GFX::PushConstant>& data() { return _data; }
96 + inline vectorImpl<GFX::PushConstant>& data() { return _data; }
86 97
87 - inline const hashMapImpl<U64, GFX::PushConstant>& data() const { return _data; }
98 + inline const vectorImpl<GFX::PushConstant>& data() const { return _data; }
88 99
100 +
89 101 protected:
90 - hashMapImpl<U64, GFX::PushConstant> _data;
102 + vectorImpl<GFX::PushConstant> _data;
91 103 };
92 104
93 105 }; //namespace Divide