Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8230641

MTLRenderer_FillSpans method needs to be optimized by reducing total number of drawPrimitives calls

    Details

    • Subcomponent:
      2d
    • CPU:
      x86_64
    • OS:
      os_x

      Description

      MTLRenderer_FillSpans method in MTLRenderer.m gets invoked for variety of 2D primitive draw and fill operations - especially with HiDPI.

      Span count and span data is passed to this method.
      It draws each span as a quad using MTLRenderCommandEncoder::drawPrimitives.
      There is 1:1 mapping between a span and MTLRenderCommandEncoder::drawPrimitives call.

      Usually, for filled 2d primitives or stroked 2d primitives - the spancount is high. It results in multiple MTLRenderCommandEncoder::drawPrimitives calls.
      It is observed that this slows down the rendering of these primitives.

      Solution :
      We can reduce the number of draw calls by buffering data and issuing one draw call when the buffer is full. Experimentation has shown good results for rendering of primitives that uses this method.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aghaisas Ajit Ghaisas
                Reporter:
                aghaisas Ajit Ghaisas
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: