summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/attribute.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-03-16 13:01:43 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-03-17 08:27:53 -0700
commit0dca6cd9bfdb1fb77f7755d639f92a6a1ba06dc1 (patch)
treec6fac4540cd77f4e815580fcc1f584860d815132 /src/mbgl/gl/attribute.cpp
parent9544dcc4834bf816e9e75f0aa9937a1562b2353f (diff)
downloadqtlocation-mapboxgl-0dca6cd9bfdb1fb77f7755d639f92a6a1ba06dc1.tar.gz
[core] Don't need to use normalized attributes anymore
Diffstat (limited to 'src/mbgl/gl/attribute.cpp')
-rw-r--r--src/mbgl/gl/attribute.cpp47
1 files changed, 1 insertions, 46 deletions
diff --git a/src/mbgl/gl/attribute.cpp b/src/mbgl/gl/attribute.cpp
index ff313fdcd0..eacaa37457 100644
--- a/src/mbgl/gl/attribute.cpp
+++ b/src/mbgl/gl/attribute.cpp
@@ -1,13 +1,10 @@
#include <mbgl/gl/attribute.hpp>
#include <mbgl/gl/context.hpp>
#include <mbgl/gl/gl.hpp>
-#include <mbgl/gl/normalization.hpp>
namespace mbgl {
namespace gl {
-static_assert(offsetof(Normalized<uint8_t>, value) == 0, "unexpected normalized offset");
-
AttributeLocation bindAttributeLocation(ProgramID id, AttributeLocation location, const char* name) {
MBGL_CHECK_ERROR(glBindAttribLocation(id, location, name));
return location;
@@ -22,10 +19,6 @@ template <> DataType DataTypeOf< int32_t> = DataType::Integer;
template <> DataType DataTypeOf<uint32_t> = DataType::UnsignedInteger;
template <> DataType DataTypeOf<float> = DataType::Float;
-template <class T> bool IsNormalized = false;
-template <class T> bool IsNormalized<Normalized<T>> = true;
-template <class T> DataType DataTypeOf<Normalized<T>> = DataTypeOf<T>;
-
template <class T, std::size_t N>
void VariableAttributeBinding<T, N>::bind(Context& context,
AttributeLocation location,
@@ -40,7 +33,7 @@ void VariableAttributeBinding<T, N>::bind(Context& context,
location,
static_cast<GLint>(attributeSize),
static_cast<GLenum>(DataTypeOf<T>),
- static_cast<GLboolean>(IsNormalized<T>),
+ static_cast<GLboolean>(false),
static_cast<GLsizei>(vertexSize),
reinterpret_cast<GLvoid*>(attributeOffset + (vertexSize * vertexOffset))));
}
@@ -50,11 +43,6 @@ template class VariableAttributeBinding<uint8_t, 2>;
template class VariableAttributeBinding<uint8_t, 3>;
template class VariableAttributeBinding<uint8_t, 4>;
-template class VariableAttributeBinding<Normalized<uint8_t>, 1>;
-template class VariableAttributeBinding<Normalized<uint8_t>, 2>;
-template class VariableAttributeBinding<Normalized<uint8_t>, 3>;
-template class VariableAttributeBinding<Normalized<uint8_t>, 4>;
-
template class VariableAttributeBinding<uint16_t, 1>;
template class VariableAttributeBinding<uint16_t, 2>;
template class VariableAttributeBinding<uint16_t, 3>;
@@ -104,39 +92,6 @@ void ConstantAttributeBinding<uint8_t, 4>::bind(Context&, AttributeLocation loca
template <>
-void ConstantAttributeBinding<Normalized<uint8_t>, 1>::bind(Context&, AttributeLocation location, optional<VariableAttributeBinding<Normalized<uint8_t>, 1>>& oldBinding, std::size_t) const {
- assert(location != 0);
- oldBinding = {};
- MBGL_CHECK_ERROR(glDisableVertexAttribArray(location));
- MBGL_CHECK_ERROR(glVertexAttrib1f(location, value[0].denormalized()));
-}
-
-template <>
-void ConstantAttributeBinding<Normalized<uint8_t>, 2>::bind(Context&, AttributeLocation location, optional<VariableAttributeBinding<Normalized<uint8_t>, 2>>& oldBinding, std::size_t) const {
- assert(location != 0);
- oldBinding = {};
- MBGL_CHECK_ERROR(glDisableVertexAttribArray(location));
- MBGL_CHECK_ERROR(glVertexAttrib2f(location, value[0].denormalized(), value[1].denormalized()));
-}
-
-template <>
-void ConstantAttributeBinding<Normalized<uint8_t>, 3>::bind(Context&, AttributeLocation location, optional<VariableAttributeBinding<Normalized<uint8_t>, 3>>& oldBinding, std::size_t) const {
- assert(location != 0);
- oldBinding = {};
- MBGL_CHECK_ERROR(glDisableVertexAttribArray(location));
- MBGL_CHECK_ERROR(glVertexAttrib3f(location, value[0].denormalized(), value[1].denormalized(), value[2].denormalized()));
-}
-
-template <>
-void ConstantAttributeBinding<Normalized<uint8_t>, 4>::bind(Context&, AttributeLocation location, optional<VariableAttributeBinding<Normalized<uint8_t>, 4>>& oldBinding, std::size_t) const {
- assert(location != 0);
- oldBinding = {};
- MBGL_CHECK_ERROR(glDisableVertexAttribArray(location));
- MBGL_CHECK_ERROR(glVertexAttrib4f(location, value[0].denormalized(), value[1].denormalized(), value[2].denormalized(), value[3].denormalized()));
-}
-
-
-template <>
void ConstantAttributeBinding<uint16_t, 1>::bind(Context&, AttributeLocation location, optional<VariableAttributeBinding<uint16_t, 1>>& oldBinding, std::size_t) const {
assert(location != 0);
oldBinding = {};