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

Avoid passing of redundant vertex 'z' data to vertex shader

XMLWordPrintable

    • 2d
    • x86_64
    • os_x

      In metal shader, a vertex position needs to be represented as float4 SIMD type for efficient transform matrix multiplication.
      The vertex position is specified as (x,y,z,w) coordinates.

      As of now, (x,y,z) are passed in as part of vertex data (while using MTLRenderEncoder.setVertexBytes) and w is set to 1.0 in vertex shader.

      To implement Java 2D APIs using metal rendering pipeline all we need is 'x' and 'y' vertex position data. In all cases value of 'z' coordinate is 0. Hence, 'z' need not be passed in as part of vertex data, but can easily be specified as literal constant 0.0 in vertex shader.

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

              Created:
              Updated:
              Resolved: