diff --git a/internal/graphics/vertex.go b/internal/graphics/vertex.go index ca1e8e78e..f8d5c114b 100644 --- a/internal/graphics/vertex.go +++ b/internal/graphics/vertex.go @@ -14,10 +14,6 @@ package graphics -import ( - "math" -) - const ( ShaderImageCount = 4 @@ -52,13 +48,8 @@ const ( ) const ( - IndicesCount = (1 << 16) / 3 * 3 // Adjust num for triangles. TODO: Remove this (#2460). -) - -const ( - VertexFloatCount = 8 - MaxVertexCount = math.MaxUint16 + 1 - MaxVertexFloatCount = MaxVertexCount * VertexFloatCount + IndicesCount = (1 << 16) / 3 * 3 // Adjust num for triangles. TODO: Remove this (#2460). + VertexFloatCount = 8 ) var ( diff --git a/internal/graphicscommand/command.go b/internal/graphicscommand/command.go index b8d23c09c..dfbc1c0b7 100644 --- a/internal/graphicscommand/command.go +++ b/internal/graphicscommand/command.go @@ -86,15 +86,11 @@ func (q *commandQueue) appendIndices(indices []uint16, offset uint16) { // mustUseDifferentVertexBuffer reports whether a different vertex buffer must be used. func mustUseDifferentVertexBuffer(nextNumVertexFloats int) bool { - return nextNumVertexFloats > graphics.MaxVertexFloatCount + return nextNumVertexFloats > graphics.IndicesCount*graphics.VertexFloatCount } // EnqueueDrawTrianglesCommand enqueues a drawing-image command. func (q *commandQueue) EnqueueDrawTrianglesCommand(dst *Image, srcs [graphics.ShaderImageCount]*Image, offsets [graphics.ShaderImageCount - 1][2]float32, vertices []float32, indices []uint16, blend graphicsdriver.Blend, dstRegion, srcRegion graphicsdriver.Region, shader *Shader, uniforms []uint32, evenOdd bool) { - if len(vertices) > graphics.MaxVertexFloatCount { - panic(fmt.Sprintf("graphicscommand: len(vertices) must not exceed %d but was %d", graphics.MaxVertexFloatCount, len(vertices))) - } - split := false if mustUseDifferentVertexBuffer(q.tmpNumVertexFloats + len(vertices)) { q.tmpNumVertexFloats = 0