Skip to content

Commit fe4ed1a

Browse files
committed
fix: fixed failing linux build
1 parent fd58547 commit fe4ed1a

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

src/lepus/gfx/Material/MaterialAttributes.h

+36-36
Original file line numberDiff line numberDiff line change
@@ -98,42 +98,6 @@ namespace lepus
9898
m_AttribValues[index] = value;
9999
}
100100

101-
template <>
102-
inline void Set<float>(uint8_t index, float value)
103-
{
104-
m_AttribTypes[index] = UniformType::FLOAT;
105-
UnsafeSet(index, value);
106-
}
107-
108-
template <>
109-
inline void Set<const lepus::math::Matrix4x4&>(uint8_t index, const lepus::math::Matrix4x4& value)
110-
{
111-
// Clear existing data
112-
if (m_AttribTypes[index] == UniformType::MATRIX4)
113-
{
114-
delete[] static_cast<float*>(m_AttribValues[index]);
115-
}
116-
117-
m_AttribValues[index] = new float[4 * 4];
118-
119-
m_AttribTypes[index] = UniformType::MATRIX4;
120-
memcpy((void*)m_AttribValues[index], value.data(), sizeof(float) * 4 * 4);
121-
}
122-
123-
template <>
124-
inline void Set<const lepus::types::Vector3&>(uint8_t index, const lepus::types::Vector3& value)
125-
{
126-
if (m_AttribTypes[index] == UniformType::VEC3)
127-
{
128-
delete[] static_cast<float*>(m_AttribValues[index]);
129-
}
130-
131-
m_AttribValues[index] = new float[3];
132-
133-
m_AttribTypes[index] = UniformType::VEC3;
134-
memcpy((void*)m_AttribValues[index], value.GetData(), sizeof(float) * 3);
135-
}
136-
137101
template <typename TValue = void*>
138102
inline TValue Get(uint8_t index) const
139103
{
@@ -174,6 +138,42 @@ namespace lepus
174138
}
175139
};
176140

141+
template <>
142+
inline void MaterialAttributes::Set<float>(uint8_t index, float value)
143+
{
144+
m_AttribTypes[index] = UniformType::FLOAT;
145+
UnsafeSet(index, value);
146+
}
147+
148+
template <>
149+
inline void MaterialAttributes::Set<const lepus::math::Matrix4x4&>(uint8_t index, const lepus::math::Matrix4x4& value)
150+
{
151+
// Clear existing data
152+
if (m_AttribTypes[index] == UniformType::MATRIX4)
153+
{
154+
delete[] static_cast<float*>(m_AttribValues[index]);
155+
}
156+
157+
m_AttribValues[index] = new float[4 * 4];
158+
159+
m_AttribTypes[index] = UniformType::MATRIX4;
160+
memcpy((void*)m_AttribValues[index], value.data(), sizeof(float) * 4 * 4);
161+
}
162+
163+
template <>
164+
inline void MaterialAttributes::Set<const lepus::types::Vector3&>(uint8_t index, const lepus::types::Vector3& value)
165+
{
166+
if (m_AttribTypes[index] == UniformType::VEC3)
167+
{
168+
delete[] static_cast<float*>(m_AttribValues[index]);
169+
}
170+
171+
m_AttribValues[index] = new float[3];
172+
173+
m_AttribTypes[index] = UniformType::VEC3;
174+
memcpy((void*)m_AttribValues[index], value.GetData(), sizeof(float) * 3);
175+
}
176+
177177
template <>
178178
inline float MaterialAttributes::Get<float>(uint8_t index) const
179179
{

0 commit comments

Comments
 (0)