mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 03:15:51 +08:00
Tech ENABLE_GL_CORE_PROFILE set as default into GLModel::Geometry
This commit is contained in:
parent
8718c20a9e
commit
db583640ad
@ -112,7 +112,6 @@ void GLModel::Geometry::add_vertex(const Vec3f& position, const Vec3f& normal)
|
||||
vertices.emplace_back(normal.z());
|
||||
}
|
||||
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
void GLModel::Geometry::add_vertex(const Vec4f& position)
|
||||
{
|
||||
assert(format.vertex_layout == EVertexLayout::P4);
|
||||
@ -121,7 +120,6 @@ void GLModel::Geometry::add_vertex(const Vec4f& position)
|
||||
vertices.emplace_back(position.z());
|
||||
vertices.emplace_back(position.w());
|
||||
}
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
|
||||
void GLModel::Geometry::add_index(unsigned int id)
|
||||
{
|
||||
@ -260,9 +258,7 @@ size_t GLModel::Geometry::vertex_stride_floats(const Format& format)
|
||||
case EVertexLayout::P3: { return 3; }
|
||||
case EVertexLayout::P3T2: { return 5; }
|
||||
case EVertexLayout::P3N3: { return 6; }
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P4: { return 4; }
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
default: { assert(false); return 0; }
|
||||
};
|
||||
}
|
||||
@ -276,9 +272,7 @@ size_t GLModel::Geometry::position_stride_floats(const Format& format)
|
||||
case EVertexLayout::P3:
|
||||
case EVertexLayout::P3T2:
|
||||
case EVertexLayout::P3N3: { return 3; }
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P4: { return 4; }
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
default: { assert(false); return 0; }
|
||||
};
|
||||
}
|
||||
@ -291,12 +285,8 @@ size_t GLModel::Geometry::position_offset_floats(const Format& format)
|
||||
case EVertexLayout::P2T2:
|
||||
case EVertexLayout::P3:
|
||||
case EVertexLayout::P3T2:
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P3N3:
|
||||
case EVertexLayout::P4: { return 0; }
|
||||
#else
|
||||
case EVertexLayout::P3N3: { return 0; }
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P4: { return 0; }
|
||||
default: { assert(false); return 0; }
|
||||
};
|
||||
}
|
||||
@ -358,12 +348,8 @@ bool GLModel::Geometry::has_position(const Format& format)
|
||||
case EVertexLayout::P2T2:
|
||||
case EVertexLayout::P3:
|
||||
case EVertexLayout::P3T2:
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P3N3:
|
||||
case EVertexLayout::P4: { return true; }
|
||||
#else
|
||||
case EVertexLayout::P3N3: { return true; }
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P4: { return true; }
|
||||
default: { assert(false); return false; }
|
||||
};
|
||||
}
|
||||
@ -375,12 +361,8 @@ bool GLModel::Geometry::has_normal(const Format& format)
|
||||
case EVertexLayout::P2:
|
||||
case EVertexLayout::P2T2:
|
||||
case EVertexLayout::P3:
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P3T2:
|
||||
case EVertexLayout::P4: { return false; }
|
||||
#else
|
||||
case EVertexLayout::P3T2: { return false; }
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P4: { return false; }
|
||||
case EVertexLayout::P3N3: { return true; }
|
||||
default: { assert(false); return false; }
|
||||
};
|
||||
@ -394,12 +376,8 @@ bool GLModel::Geometry::has_tex_coord(const Format& format)
|
||||
case EVertexLayout::P3T2: { return true; }
|
||||
case EVertexLayout::P2:
|
||||
case EVertexLayout::P3:
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P3N3:
|
||||
case EVertexLayout::P4: { return false; }
|
||||
#else
|
||||
case EVertexLayout::P3N3: { return false; }
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P4: { return false; }
|
||||
default: { assert(false); return false; }
|
||||
};
|
||||
}
|
||||
|
@ -63,9 +63,7 @@ namespace GUI {
|
||||
P3, // position 3 floats
|
||||
P3T2, // position 3 floats + texture coords 2 floats
|
||||
P3N3, // position 3 floats + normal 3 floats
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
P4, // position 4 floats
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
};
|
||||
|
||||
enum class EIndexType : unsigned char
|
||||
@ -95,9 +93,7 @@ namespace GUI {
|
||||
void add_vertex(const Vec3f& position); // EVertexLayout::P3
|
||||
void add_vertex(const Vec3f& position, const Vec2f& tex_coord); // EVertexLayout::P3T2
|
||||
void add_vertex(const Vec3f& position, const Vec3f& normal); // EVertexLayout::P3N3
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
void add_vertex(const Vec4f& position); // EVertexLayout::P4
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
|
||||
void set_vertex(size_t id, const Vec3f& position, const Vec3f& normal); // EVertexLayout::P3N3
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user