mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0028276: Visualization, Graphic3d_ArrayOfPrimitives - fix usage of 16-bit indices
Graphic3d_ArrayOfPrimitives now check the amount of vertex data rather than amount of indices.
This commit is contained in:
parent
ad03c23449
commit
09f30297f4
@ -56,7 +56,7 @@ Graphic3d_ArrayOfPrimitives::Graphic3d_ArrayOfPrimitives (const Graphic3d_TypeOf
|
||||
if (theMaxEdges > 0)
|
||||
{
|
||||
myIndices = new Graphic3d_IndexBuffer (anAlloc);
|
||||
if (theMaxEdges < Standard_Integer(USHRT_MAX))
|
||||
if (theMaxVertexs < Standard_Integer(USHRT_MAX))
|
||||
{
|
||||
if (!myIndices->Init<unsigned short> (theMaxEdges))
|
||||
{
|
||||
|
@ -943,12 +943,13 @@ void OpenGl_PrimitiveArray::setDrawMode (const Graphic3d_TypeOfPrimitiveArray th
|
||||
Standard_Boolean OpenGl_PrimitiveArray::processIndices (const Handle(OpenGl_Context)& theContext) const
|
||||
{
|
||||
if (myIndices.IsNull()
|
||||
|| myAttribs.IsNull()
|
||||
|| theContext->hasUintIndex)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
if (myIndices->NbElements > std::numeric_limits<GLushort>::max())
|
||||
if (myAttribs->NbElements > std::numeric_limits<GLushort>::max())
|
||||
{
|
||||
Handle(Graphic3d_Buffer) anAttribs = new Graphic3d_Buffer (new NCollection_AlignedAllocator (16));
|
||||
if (!anAttribs->Init (myIndices->NbElements, myAttribs->AttributesArray(), myAttribs->NbAttributes))
|
||||
|
Loading…
x
Reference in New Issue
Block a user